Elasticsearch 弹性搜索(二)单机配制

配制

# 编辑配制文件
vim /usr/local/es1/config/elasticsearch.yml

xpack.ml.enabled: false
network.host: 0.0.0.0
http.port: 8301
#memory                                                                                                                                 
bootstrap.memory_lock: false
bootstrap.system_call_filter: false

启动

注意:非常吃CPU,其次是内存,单核,2G表示OVER!
用虚拟机吧

# 尝试启动
/usr/local/es1/bin/elasticsearch

# 错误
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
[3]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_maste
r_nodes] must be configured

# [1]:max file descriptors
sudo vim /etc/security/limits.conf
# 添加:
* soft nofile 65536                                                                                                                        
* hard nofile 131072  
# 重启
sysctl -p


[2]: max virtual memory
sudo vim /etc/sysctl.conf
# 添加
vm.max_map_count=362144 

[3]: the default discovery settings are unsuitable
vim /home/parallels/SysSoftware/es1/config/elasticsearch.yml
# 取消注释
cluster.initial_master_nodes: ["node-1", "node-2"]  
cluster.initial_master_nodes: ["node-1"]  

测试

curl http://127.0.0.1:8301

重启

可能用到的
shutdown -r now

发布了123 篇原创文章 · 获赞 114 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/yuhezheg/article/details/104343642