安裝elasticsearch遇到的坑

1、max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
elasticsearch啓動時遇到的錯誤,意思是:elasticsearch用戶擁有的內存權限太小,至少需要262144。

解決:
切換到root用戶執行命令:
sysctl -w vm.max_map_count=262144
查看結果:
sysctl -a|grep vm.max_map_count
顯示:
vm.max_map_count = 262144
上述方法修改之後,如果重啓虛擬機將失效,所以:

解決辦法:
/etc/sysctl.conf文件最後添加一行

vm.max_map_count=262144

並使其立即生效,即可永久修改:
/sbin/sysctl -p
在這裏插入圖片描述
在這裏插入圖片描述

2、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

解決:需要修改elasticsearch.yml中配置:cluster.initial_master_nodes: ["node-1"],保留一個節點即可。

3、:配置了阿里雲外網ip,只能通過localhost在本地訪問:curl -XGET 'http://localhost:9200/',如果使用ip方法就拒絕訪問,或者使用瀏覽器訪問也拒絕訪問。
解決:需要在elasticsearch.yml中配置阿里雲的內網IP,這樣就可以通過IP訪問了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章