CrateDB单机版和集群版安装
vim ~/.bash_profile
添加如下内容
JAVA_HOME=/home/crate/jdk-11.0.3/
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
使环境变量生效
source ~/.bash_profile
1、新建用户和组
groupadd crate
useradd -g crate crate
不能使用root用户安装否则会报错:
org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run crate as root
2、安装启动
tar -xzf crate-*.tar.gz
cd crate-*
./bin/crate
3、访问地址
http://192.168.X.X:4200/
4、可能遇见的错误
1:initial heap size [268435456] not equal to maximum heap size [3107979264];
this can cause resize pauses and prevents mlockall from locking the entire heap
2:max file descriptors [65535] for crate process is too low,
increase to at least [65536]
3: max virtual memory areas vm.max_map_count [65530] is too low,
increase to at least [262144] by adding `vm.max_map_count = 262144`
to `/etc/sysctl.conf` or invoking `sysctl -w vm.max_map_count=262144`
解决办法:
1:export CRATE_HEAP_SIZE=2g
2:在root用户下修改
vim /etc/security/limits.conf
添加
crate soft nofile 65536
crate hard nofile 65536
退出crate用户再登录
3:vim /etc/sysctl.conf
添加 vm.max_map_count = 262144
执行 sysctl -w vm.max_map_count=262144
5、集群配置
cluster.name: crate
bootstrap.memory_lock : false
node.name: node1
path.data: /data/crate
node.master: true
node.data: true
psql.port: 5432
psql.enabled: true
discovery.seed_hosts:
- 192.168.3.11:4300
- 192.168.3.12:4300
cluster.initial_master_nodes:
- 192.168.3.11
- 192.168.3.12
auth.host_based.enabled: true
auth:
host_based:
config:
:
user: crate
address: _local_
method: trust
99:
method: password
network.host: 192.168.3.11
transport.tcp.port: 4300
transport.tcp.compress: true
http.port: 4200
http.max_content_length: 100mb
bulk.request_timeout: 1m
indices.breaker.query.limit: 60%
indices.breaker.query.overhead: 1.09
gateway.recover_after_nodes: 2
gateway.recover_after_time: 5m
gateway.expected_nodes: 3
相关文章