【使用root用户操作 --start】
elasticsearch 使用非root用户启动
useradd
elastic
passwordd elastic
下载/解压包
wget https:
//artifacts
.elastic.co
/downloads/elasticsearch/elasticsearch-5
.4.1.
tar
.gz
tar
xf elasticsearch-5.4.1.
tar
.gz
移动/更名
mv
elasticsearch-5.4.1
/usr/local/elsticsearch
chown
-R elastic.elastic
/usr/local/elsticsearch
由于系统的一些配置限制导致启动时候的问题,这里写修改需要修改的配置文件
错误1【PS:我这里打开最大文件数是已修改过为65535的,es提示要65536】
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
错误2
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决:
vim
/etc/sysctl
.conf
vm.max_map_count=262144
sysctl -p
【使用root用户操作 --stop】
【使用elastic用户操作 --start】
su
- elastic
vim
/usr/local/elsticsearch/config/elasticsearch
.yml
network.host: 0.0.0.0
http.port: 9200
/usr/local/elsticsearch/bin/elasticsearch
-d
netstat
-lntp |
egrep
"9200|9300"
tcp 0 0 0.0.0.0:9200 0.0.0.0:* LISTEN 14203
/java
tcp 0 0 0.0.0.0:9300 0.0.0.0:* LISTEN 14203
/java
cat
/usr/local/elsticsearch/logs/elasticsearch
.log
vim
/usr/local/elsticsearch/config/jvm
.options
-Xms1g
-Xmx1g
【使用elasitc用户操作 --stop】