本文共 2931 字,大约阅读时间需要 9 分钟。
环境CentOS7
安装了JDK1.8这里用的elasticsearch5.2.2为例,你也可以用5.6.1或者更高的版本1.最好以非root用户解压ElasticSearch,如果用root用户,要不然以后还要将文件的权限以及组转移给非foot用户
1)解压elasticsearch-5.2.2.tar.gz到/opt/module目录下[root@hdp21 ~]# su asy[asy@hdp21 root]$ tar -zxvf elasticsearch-5.2.2.tar.gz -C /opt/module2)在/opt/module/elasticsearch-5.2.2路径下创建data和logs文件夹mkdir datamkdir logs如果你用root账号,请先添加一个非root账号,因为elaticsearch不能用root账号运行
user add asychown -R asy:asy /opt/module/elasticsearch-5.2.2/3)root账号修改配置文件/opt/module/elasticsearch-5.2.2/config/elasticsearch.yml
[root@hdp21 config]# pwd/opt/module/elasticsearch-5.2.2/config[root@hdp21 config]# vi elasticsearch.yml修改以下参数cluster.name: Asy
node.name: node-1
path.data: /opt/module/elasticsearch-5.2.2/data
path.logs: /opt/module/elasticsearch-5.2.2/logsbootstrap.memory_lock: false
bootstrap.system_call_filter: falsenetwork.host: hdp21
http.port: 9200discovery.zen.ping.unicast.hosts: ["hdp21"]
path.data
path.logs data和logs的路径network.host ip地址或者host域名地址
http.port端口号5)配置linux系统环境(参考:
(1)编辑limits.conf 添加类似如下内容[root@hdp21 config]# vi /etc/security/limits.conf添加如下内容:退回到上一级目录
并执行命令:[root@hdp21 config]# cd ..[root@hdp21 elasticsearch-5.2.2]# pwd/opt/module/elasticsearch-5.2.2[root@hdp21 elasticsearch-5.2.2]# sysctl -p
然后,重新启动elasticsearch,即可启动成功。6)启动elasticsearch[asy@hdp21 elasticsearch-5.2.2]$ bin/elasticsearch后台启动方式[asy@hdp21 elasticsearch-5.2.2]$ bin/elasticsearch-d7)测试elasticsearch[root@hdp21 ~]# curl { "name" : "node1","cluster_name" : "Asy","cluster_uuid" : "8T7xJ-NLTbmYHOPKa3a4tA","version" : { "number" : "5.2.2","build_hash" : "f9d9b74","build_date" : "2017-02-24T17:26:45.835Z","build_snapshot" : false,"lucene_version" : "6.4.1"},"tagline" : "You Know, for Search"}执行bin/elasticsearch的时候
如果有 max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536] 的报错这个对应v/etc/security/limits.conf
Google浏览器调试Elastic Search
打开更多工具,扩展程序并且打开开发者模式将elasticsearch-head.crx拖入浏览器窗口成功完成插件的安装输入http://192.168.234.21:9200/其中192.168.234.21为linux主机的IP地址,9200为端口号转载于:https://blog.51cto.com/6989066/2334006