linux安装elasticsearch

一、检测是否已经安装的elasticsearch

ps aux|grep elasticsearch

二、下载elasticsearch

cd /usr/local
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.6.7.tar.gz

三、解压安装

tar -zxvf elasticsearch-5.6.7.tar.gz
mv elasticsearch-5.6.7.tar.gz elasticsearch

四、修改配置文件

1:进入如下目录

cd /usr/local/elasticsearch/config
vi elasticsearch.yml

添加如下代码(若无将会出现下面常见问题2):

vm.max_map_count=262144

在memory下添加如下(若无将会出现下面常见问题4)

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

退出保存后执行如下命令:

sysctl -p

2:修改如下文件

vi /etc/security/limits.conf

在文件末尾添加如下代码(若无将会出现下面常见问题3):

# python为登录服务器的用户名

python soft nofile 65536
python hard nofile 65536
python soft nproc  4096
python hard nproc  4096

3:创建python用户(root用户不能启动elasticsearch)

useradd python
passwd python

按提示输入两次密码:python

然后授权:

cd /usr/local
sudo chown -R python:python elasticsearch

切换用户

su - python

五、启动elasticsearch

1:控制台启动(ctrl+c 后停止):

./bin/elasticsearch

2:后台启动:

./bin/elasticsearch -d

六、常见问题

1:can not run elasticsearch as root

Elasticsearch版本> = 5.0.0时,是不可用超级管理员运行Elasticsearch的,退出管理员账号,切换成普通用户登录即可
2: max virutal memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决方案,请看上面修改配置文件第2项

3:max number of threads [3750] for user [xxx] is too low, increase to at least [4096]

具体修改配置,请看修改配置文件第3项

4:bootstrap checks failed system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk

具体修改配置,请看修改配置文件第4项


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值