S小魚仔S 網誌搜尋

2017年6月5日 星期一

S小魚仔S ELK 錯誤訊息 max file descriptors [4096] for elasticsearch process is too low ....

檢查「cat ./elasticsearch-5.3.2/logs/elasticsearch.log

警告
max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]」。

解決方案。

切換「root」帳號
su root

編輯「limits.conf
vi /etc/security/limits.conf

加入「下面」配置,「elk」為「elasticsearch」啟動「帳戶
elk soft nofile 65536 
elk hard nofile 65536

檢查「大小
su elk -c 'ulimit -Hn'


警告
max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解決方案。

vi /etc/sysctl.conf

vm.max_map_count=655360

sysctl -p

====重啟「elasticsearch」和「kibana」====

檢查「9200」PID 程序
netstat -ltunp | grep "9200"

停用「進程
kill -9 PID

使用「elk」帳號,背景運行「elasticsearch」 程序。TCP-9200
su elk -c 'nohup /opt/elasticsearch-5.3.2/bin/elasticsearch &'

運行「kibana」程序
/opt/kibana-5.3.2-linux-x86_64/bin/kibana &

檢查「elasticsearch.log
cat ./elasticsearch-5.3.2/logs/elasticsearch.log

參考資料
my.oschina.net」-「Elasticsearch5.1.1 启动报错