解压并运行elasticsearch 发现不能启动和访问
1 修改访问elasticsearch的IP及端口
修改文件 elasticsearch/config/elasticsearch.yml
找到如下代码段,并取消network.host及http.port所在行的注释,修改IP及端口
network.host: 192.168.0.155
#
# Set a custom port for HTTP:
#
http.port: 9200
2 config/elasticsearch.yml文件,找到如下配置, IP为自己的服务器IP即可
discovery.zen.ping.unicast.hosts: ["192.168.0.155"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of nodes / 2 + 1):
#
discovery.zen.minimum_master_nodes: 1
3 错误描述: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
4 错误描述: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
* hard nproc 4096
#修改为
* soft nproc 2048
* hard nproc 4096