【Linux部署】elasticsearch can not run elasticsearch as root+vm.max_map_count [65530] is too low 问题解决
生活随笔
收集整理的這篇文章主要介紹了
【Linux部署】elasticsearch can not run elasticsearch as root+vm.max_map_count [65530] is too low 问题解决
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
異常一
Caused by: java.lang.RuntimeException: can not run elasticsearch as root異常一解決
添加 elasticsearch 用戶組和用戶:
[root@tcloud ~]# groupadd elasticsearch [root@tcloud ~]# useradd -g elasticsearch elasticsearch # 設(shè)置密碼 [root@tcloud ~]# echo "elasticsearch" | passwd elasticsearch --stdin將ES的文件轉(zhuǎn)到 elasticsearch 下:
[root@tcloud ~]# cd /usr/local/elasticsearch [root@tcloud ~]# chown -R elasticsearch . [root@tcloud ~]# chgrp -R elasticsearch . [root@tcloud elasticsearch]# ll total 448 drwxr-xr-x 3 elasticsearch elasticsearch 4096 Jul 31 11:22 bin drwxr-xr-x 2 elasticsearch elasticsearch 4096 Jul 31 12:16 config drwxr-xr-x 3 elasticsearch elasticsearch 4096 Oct 31 2018 lib -rw-r--r-- 1 elasticsearch elasticsearch 13675 Oct 31 2018 LICENSE.txt drwxr-xr-x 2 elasticsearch elasticsearch 4096 Jul 31 12:01 logs drwxr-xr-x 27 elasticsearch elasticsearch 4096 Oct 31 2018 modules -rw-r--r-- 1 elasticsearch elasticsearch 401465 Oct 31 2018 NOTICE.txt drwxr-xr-x 2 elasticsearch elasticsearch 4096 Oct 31 2018 plugins -rw-r--r-- 1 elasticsearch elasticsearch 8519 Oct 31 2018 README.textile修改 sudoers 文件,給用戶 elasticsearch 添加 sudo 權(quán)限:
[root@tcloud ~]# vim /etc/sudoers ## Allow root to run any commands anywhere root ALL=(ALL) ALL # 添加elasticsearch elasticsearch ALL=(ALL) ALL啟動(dòng)時(shí)切換到 elasticsearch 用戶下。
異常二
ERROR: [1] bootstrap checks failed [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]異常二解決
# 查看系統(tǒng)環(huán)境變量vm.max_map_count [root@tcloud ~]# sysctl -a | grep vm.max_map_count vm.max_map_count = 65530# 修改系統(tǒng)環(huán)境變量vm.max_map_count [root@tcloud ~]# vim /etc/sysctl.conf# 末尾添加 vm.max_map_count = 262144# 配置文件修改完后需要重啟才能生效 可使用下面命令使得本次啟動(dòng)有效 [root@tcloud ~]# sysctl -w vm.max_map_count=262144 vm.max_map_count = 262144修改最大文件描述符數(shù)量和用戶最大線程數(shù)
[root@tcloud ~]# vim /etc/security/limits.conf# 添加下面代碼至文件末尾:* soft nofile 65536* hard nofile 65536* soft nproc 4096* hard nproc 4096總結(jié)
以上是生活随笔為你收集整理的【Linux部署】elasticsearch can not run elasticsearch as root+vm.max_map_count [65530] is too low 问题解决的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【Linux部署】【elasticsea
- 下一篇: 【Linux环境】Elasticsear