转载请注明出处:http://blog.csdn.net/l1028386804/article/details/77643732
1、ROOT用户不能正常启动
ElasticSearch2.0版本以后不能使用root来启动,需要创建一个普通用户来启动。
[root@liuyazhuang136 ~]# groupadd elasticsearch
[root@liuyazhuang136 ~]# useradd elasticsearch -g elasticsearch
[root@liuyazhuang136 ~]# chown -R elasticsearch.elasticsearch /usr/local/elasticsearch-5.5.1
[root@liuyazhuang136 ~]# su - elasticsearch
[elasticsearch@liuyazhuang136 ~]$ cd /usr/local/elasticsearch-5.5.1/bin/
[elasticsearch@liuyazhuang136 bin]$ ./elasticsearch
由普通用户启动,则可以正常启动服务。
2.ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]
解决:切换到root用户,编辑limits.conf 添加类似如下内容
vi /etc/security/limits.conf
添加如下内容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
3.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
4.max virtual memory areas vm.max_map_count [65530] likely too low, increase to at least [262144]
解决:切换到root用户修改配置sysctl.conf
vi /etc/sysctl.conf
添加下面配置:
vm.max_map_count=655360
并执行命令:
sysctl -p
然后,重新启动elasticsearch,即可启动成功。
5、bootstrap checks failed
报错:
bootstrap checks failed
system call filters failed to install; check the logs and fix your configuration or disable system call filters at your own risk
解决:
在elasticsearch.yml中加上如下配置即可:
bootstrap.system_call_filter: false
6、安装ES Header插件出现grunt的模块没有安装的问题
安装ES Header插件的时候出现了grunt的模块没有安装的问题,具体如下:
Local Npm module “grunt-contrib-clean” not found. Is it installed?
Local Npm module “grunt-contrib-concat” not found. Is it installed?
Local Npm module “grunt-contrib-watch” not found. Is it installed?
Local Npm module “grunt-contrib-connect” not found. Is it installed?
Local Npm module “grunt-contrib-copy” not found. Is it installed?
Local Npm module “grunt-contrib-jasmine” not found. Is it installed?
Warning: Task “connect:server” not found. Use –force to continue.
通过以下命令:
npm install grunt-contrib-clean –registry=https://registry.npm.taobao.org
npm install grunt-contrib-concat –registry=https://registry.npm.taobao.org
npm install grunt-contrib-watch –registry=https://registry.npm.taobao.org
npm install grunt-contrib-connect –registry=https://registry.npm.taobao.org
npm install grunt-contrib-copy –registry=https://registry.npm.taobao.org
npm install grunt-contrib-jasmine –registry=https://registry.npm.taobao.org
安装成功了。
但是启动之前要配置一下:
在elasticsearch.yml文件最后追加如下内容:
http.cors.enabled: true
http.cors.allow-origin: "*"
bootstrap.system_call_filter: false
用于head 无法跨域访问es的问题
经过这次安装还了解了一些npm install, 如果安装ES Header很慢,可以用以下两种思路解决:
1. 使用淘宝镜像:
淘宝npm镜像
• 搜索地址: http://npm.taobao.org/
• registry地址: http://registry.npm.taobao.org/
2. 看本机是否有其他程序占用网络资源