centos7安装es6.4.0

一、首先进入到opt文件夹
cd opt
二、然后下载es安装包
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.4.0.tar.gz
三、解压es安装包
tar -zxvf elasticsearch-6.4.0.tar.gz
四、编辑es配置文件
vim config/elasticsearch.yml
配置文件修改
network.host: 0.0.0.0 http.port: 9200 http.cors.enabled: true http.cors.allow-origin: "*"
五、如果运行报错
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]

max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
使用root用户编辑
vim /etc/security/limits.conf
新增
* soft nofile 65536
* hard nofile 65536
vim /etc/sysctl.conf
新增
vm.max_map_count=655360
然后重新加载系统参数
sysctl -p
六、es不能使用root用户启动
groupadd elsearch
useradd elsearch -g elsearch -p elasticsearch-6.4.0
chown -R elsearch:elsearch elasticsearch-6.4.0
七、启动
切换为elsearch用户
su elsearch
正常启动
./elasticsearch
后台启动
./elasticsearch -d
八、
最后还有一个小问题,如果你在服务器上安装Elasticsearch,而你想在本地机器上进行开发,这时候,你很可能需要在关闭终端的时候,让Elasticsearch继续保持运行。最简单的方法就是使用nohup。先按Ctrl + C,停止当前运行的Elasticsearch,改用下面的命令运行Elasticsearch

nohup./bin/elasticsearch&

这样,你就可以放心地关闭服务器终端,而不用担心Elasticsearch也跟着关闭了。

查找杀死进程:ps aux|grep elasticsearch #显示所有关于es包含其他使用者的进程 kill -9 进程号

posted @ 2018-10-26 11:03  咬轮猫  阅读(978)  评论(0编辑  收藏  举报
Live2D