ubuntu部署elasticsearch

注:需要用非root账号启动
1.下载安装包:elasticsearch-5.5.1.zip
解压:
unzip elasticsearch-5.5.1.zip

注:启动elasticsearch时可用内存必须大于2G,否则无法启动。

2.修改内存大小
修改elasticsearch-5.5.1/config/jvm.options
-Xms1g
-Xmx1g

3.修改外网访问
conf/elasticsearch.yml
network.host: 0.0.0.0

3.启动
nohup ./bin/elasticsearch &

访问:http://localhost:9200

报错1.OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error=‘Cannot allocate memory’ (errno=12)

修改elasticsearch-5.5.1/config/jvm.options
-Xms1g
-Xmx1g
将内存改为1g(由于我的阿里云机器只有2G内存,所以会启动报错)

报错2.
ERROR: [2] bootstrap checks failed
[1]: max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

a.修改文件 /etc/security/limits.conf

work soft nofile 131072
work hard nofile 131072
work soft nproc 2048
work hard nproc 4096
注:work为启动用户

b.修改/etc/sysctl.conf
vm.max_map_count=655360
执行命令:sysctl -p

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值