Linux(Centos6)搭建ElasticSearch(图文教程)

1. 下载Elasticsearch数据库

    官网:Download Elasticsearch | Elastic

   我之前用的是最新版,后来报错

java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed

目前尚未解决,所以换成6.4.3版本了

 mkdir /usr/local/ES

 cd /usr/local/ES

 wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.3.tar.gz 

2 解压

tar -zxvf elasticsearch-6.4.3.tar.gz

3创建新用户,启动程序

创建用户 

useradd user-es

//权限赋值

chown user-es:user-es -R /usr/local/ES/elasticsearch-6.4.3

切换用户

su user-es

启动

/usr/local/ES/elasticsearch-6.4.3/bin/./elasticsearch

启动报错

(1)

java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kerne

解决办法:

vim /usr/local/ES/elasticsearch-6.4.3/config/elasticsearch.yml

在文件最后加入

       bootstrap.memory_lock: false

  bootstrap.system_call_filter: false

为了能在浏览器访问到,所以还需要再加入

      network.host: 0.0.0.0

(2) 

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决办法

sysctl -w vm.max_map_count=262144

vim /etc/sysctl.conf

检查最后是否有vm.max_map_count=262144,如没有,手动加上

sysctl -p

(3)

max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

解决办法

vim /etc/security/limits.conf

修改为如下内容

* soft nofile 65536

* hard nofile 65536

(4) 

max number of threads [3795] for user [elastic] is too low, increase to at least [4096]

解决办法

vim /etc/security/limits.d/90-nproc.conf

把 里面的nproc大于等于到4096

解决上述错误后启动成功,如图表示启动成功

在浏览器输入 http://113.125.131.108:9200/

注意替换ip地址

 但是我们注意到,如果关闭了那个启动的窗口就不能访问到了,所以我们换一种启动方法

/usr/local/ES/elasticsearch-6.4.3/bin/./elasticsearch -d

可以使用ps -ef|grep elasticsearch查看是否启动成功

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值