日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

【Linux部署】elasticsearch can not run elasticsearch as root+vm.max_map_count [65530] is too low 问题解决

發布時間:2024/10/6 linux 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【Linux部署】elasticsearch can not run elasticsearch as root+vm.max_map_count [65530] is too low 问题解决 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

異常一

Caused by: java.lang.RuntimeException: can not run elasticsearch as root

異常一解決

添加 elasticsearch 用戶組和用戶:

[root@tcloud ~]# groupadd elasticsearch [root@tcloud ~]# useradd -g elasticsearch elasticsearch # 設置密碼 [root@tcloud ~]# echo "elasticsearch" | passwd elasticsearch --stdin

將ES的文件轉到 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 權限:

[root@tcloud ~]# vim /etc/sudoers ## Allow root to run any commands anywhere root ALL=(ALL) ALL # 添加elasticsearch elasticsearch ALL=(ALL) ALL

啟動時切換到 elasticsearch 用戶下。

異常二

ERROR: [1] bootstrap checks failed [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

異常二解決

# 查看系統環境變量vm.max_map_count [root@tcloud ~]# sysctl -a | grep vm.max_map_count vm.max_map_count = 65530# 修改系統環境變量vm.max_map_count [root@tcloud ~]# vim /etc/sysctl.conf# 末尾添加 vm.max_map_count = 262144# 配置文件修改完后需要重啟才能生效 可使用下面命令使得本次啟動有效 [root@tcloud ~]# sysctl -w vm.max_map_count=262144 vm.max_map_count = 262144

修改最大文件描述符數量和用戶最大線程數

[root@tcloud ~]# vim /etc/security/limits.conf# 添加下面代碼至文件末尾:* soft nofile 65536* hard nofile 65536* soft nproc 4096* hard nproc 4096

總結

以上是生活随笔為你收集整理的【Linux部署】elasticsearch can not run elasticsearch as root+vm.max_map_count [65530] is too low 问题解决的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。