adduser normaluser
passwd normaluser
如下密码设置成功
![](https://img-blog.csdnimg.cn/20190818225238720.png)
2.进入normaluser用户中
su normaluser
3.进入[elasticsearch下载页面]( ),进行对应平台下载es,271M,网速慢的需要耐心等待
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.3.0-linux-x86_64.tar.gz
![](https://img-blog.csdnimg.cn/20190818225649429.png)
4.解压安装包
tar -zxvf elasticsearch-7.3.0-linux-x86_64.tar.gz
5.进入到bin目录下
cd elasticsearch-7.3.0/bin/
6.启动
./elasticsearch
出现以下报错信息
error:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
OpenJDK 64-Bit Server VM warning: INFO: os::commit\_memory(0x00000000c5330000, 986513408, 0) failed; error='Not enough space' (errno=12)
报错原因:说明内存空间不够,需要将占用内存空间改小一点
vi …/config/jvm.options
原先1G改为现在的400M即可
![](https://img-blog.csdnimg.cn/20190818230801460.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MTIzODEzNA==,size_16,color_FFFFFF,t_70)
重新启动,启动成功
![](https://img-blog.csdnimg.cn/201908182307329.png)
7.验证是否启动成功
curl 127.0.0.1:9200
出现以下,代表启动成功
![](https://img-blog.csdnimg.cn/20190818231004451.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MTIzODEzNA==,size_16,color_FFFFFF,t_70)
8.守护进程启动
./elasticsearch -d
二 设置elasticsearch可以外网访问
1.elasticsearch默认端口9200,需要开启服务器端口可以外网访问
2. 修改配置文件,将ip改为0.0.0.0,如果需要特定ip可以访问,可以设定为固定的ip
vi …/config/elasticsearch.yml
![](https://img-blog.csdnimg.cn/20190818231501785.png)
3.启动elasticsearch,发现无法启动会出现报错信息
报错信息
ERROR: [1] bootstrap checks failed
[1]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed\_hosts, discovery.seed\_providers, cluster.initial\_master\_nodes] must be configured
原因没有发现host 需要至少保留一个,取消注释,保留host1
vi …/config/elasticsearch.yml
![](https://img-blog.csdnimg.cn/20190818232018182.png)
4.重新启动后在vindows本地通过外网ip:9200打开是否可以访问
如下启动成功
![](https://img-blog.csdnimg.cn/20190818232356668.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MTIzODEzNA==,size_16,color_FFFFFF,t_70)
### 三 ElasticSearch设置外网启动的其他错误信息汇总
1.`system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk`
`原因`因为Centos6不支持SecComp,而ES5.2.1默认bootstrap.system\_call\_filter为true进行检测,所以导致检测失败,失败后直接导致ES不能启动
解决方案:
vi …/config/elasticsearch.yml
在Memory下添加一下内容
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
![](https://img-blog.csdnimg.cn/2019081823292319.png)