首页 > 其他 > 详细

elasticsearch安装 centos6.5

时间:2019-09-28 18:21:57      阅读:120      评论:0      收藏:0      [点我收藏+]

版本: elasticsearch-6.4.3.tar.gz

jdk:1.7

注意:安装elasticsearch 不能用root用户安装

1.创建用户

groupadd esgroup

useradd esuser -g esgroup -p espawd

 

2.安装elasticsearch

用新建的用户安装(不可用root用户安装会报错)

tar -zxvf elasticsearch-6.4.3.tar.gz -C /home/hadoop/opt/

elasticsearch.yml 修改

vim elasticsearch-6.4.3/config/elasticsearch.yml

添加内容

network.host: 192.168.179.142
http.port: 9200

#因为Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测

elasticsearch.yml添加内容
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

用root用户修改/etc/sysctl.conf 

vim /etc/sysctl.conf

在文件最后面添加内容:

vm.max_map_count=262144

保存退出后,使用sysctl -p 刷新生效

[root@localhost ~]# sysctl -p
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
vm.max_map_count = 262144
[root@localhost ~]#

root用户 修改文件/etc/security/limits.conf

    vim /etc/security/limits.conf

 

添加如下内容:

 
* hard nofile 65536
* soft nofile 65536
* soft nproc 2048
* hard nproc 4096 

启动elasticesearch 可能还会报如下错误

max number of threads [1024] for user [lish] likely too low, increase to at least [4096]

解决:切换到root用户,进入limits.d目录下修改配置文件。

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

修改如下内容:

* soft nproc 1024

#修改为

* soft nproc 4096

3.启动elasticsearch 

完成上面配置修改后,切换到es 用户,目录切换到 elasticsearch 安装目录下执行

cd elasticsearch-6.4.3/bin/

./elasticsearch

 

在浏览器输入<IP>:9200 验证是否启动成功,如果浏览器输出如下信息,代表安装启动成功

{
  "name" : "node-1",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "8okSnhNzRr6Xo233szO0Vg",
  "version" : {
    "number" : "6.3.2",
    "build_flavor" : "default",
    "build_type" : "tar",
    "build_hash" : "053779d",
    "build_date" : "2018-07-20T05:20:23.451332Z",
    "build_snapshot" : false,
    "lucene_version" : "7.3.1",
    "minimum_wire_compatibility_version" : "5.6.0",
    "minimum_index_compatibility_version" : "5.0.0"
  },
  "tagline" : "You Know, for Search"
}

 

4.安装过程中启动报错解决

异常信息1:expecting token of type [START_OBJECT] but found [VALUE_STRING]]; 

错误原因:elasticsearch.yml 文件内部错误 
解决办法:仔细检查yml文件中的配置项书写格式: (空格)name:(空格)value

---------------------------------------------------------------------------------
异常信息2:java.lang.UnsupportedOperationException: seccomp unavailable: CONFIG_SECCOMP not compiled into kernel, CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER are needed
 错误原因:Centos6不支持SecComp,而ES默认bootstrap.system_call_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动
 
解决办法:修改elasticsearch.yml 添加一下内容 :

bootstrap.memory_lock: false
bootstrap.system_call_filter: false

---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
异常信息3:BindTransportException[Failed to bind to [9300-9400]
解决办法 打开配置文件elasticsearch.yml 将 network.host: 192.168.0.1 修改为本机IP 0.0.0.0


--------------------------------------------------------------------------------------------
异常信息4:max number of threads [1024] for user [lish] likely too low, increase to at least [2048]

解决办法:切换到root用户,进入limits.d目录下修改配置文件。

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

修改如下内容:

* soft nproc 1024

#修改为

* soft nproc 2048

 

5.安装kibana

 

 tar -zxvf kibana-6.4.3-linux-x86_64.tar.gz -C /home/hadoop/opt/kibana/

 vim kibana/kibana-6.4.3-linux-x86_64/config/kibana.yml 

添加内容

server.port: 5601
server.host: "192.168.179.142"
elasticsearch.url: "http://192.168.179.142:9200"

启动

./kibana

验证

http://192.168.179.142:5601/app/kibana

 

elasticsearch安装 centos6.5

原文:https://www.cnblogs.com/zhoufly-blog/p/11604038.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!