Download Elasticsearch | Elastic
# 解压
tar -xzf elasticsearch-8.6.2-linux-x86_64.tar.gz# 移动
mv elasticsearch-8.6.2 /usr/local/elasticsearch-8.6.2/
vi config/elasticsearch.yml
network.host: 外网IP
http.host: 外网IP
ingest.geoip.downloader.enabled: false
# 创建用户
adduser elasti# 设置密码
passwd elasti# 修改目录归属
chown -R elasti:elasti /usr/local/elasticsearch-8.6.2/# 读写权限修改
chmod 770 /usr/local/elasticsearch-8.6.2/# 指定用户启动
su elasti ./bin/elasticsearch
启动脚本:
#!/bin/bash
# nohup su es ./bin/elasticsearch > logs/out.log 2>&1 &export ES_HOME=/usr/local/elasticsearch-8.6.2case $1 instart)cd $ES_HOMEsudo -u es bin/elasticsearch -d -p pidexitpid=`cat $ES_HOME/pid`echo "启动成功 $pid";;stop)pid=`cat $ES_HOME/pid`kill -9 $pidecho "停止成功 $pid";;restart)cd $ES_HOMEpid=`cat $ES_HOME/pid`kill -9 $pidecho "停止成功 $pid"sudo -u es bin/elasticsearch -d -p pidpid=`cat $ES_HOME/pid`echo "启动成功 $pid";;*)echo "start|stop|restart";;
esac
exit 0
# 重置密码
bin/elasticsearch-reset-password -u elastic
地址:https://外网IP:9200/ 置超级用户`elastic` , 密码在初次运行时控制台有输出。 也可以重置
问题:
bootstrap check failure [1] of [2]: max number of threads [2824] for user [elasti] is too low, increase to at least [4096]
bootstrap check failure [2] of [2]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]处理:
vi /etc/security/limits.conf # 追加或修改下面内容 es 用户名elasti soft nproc 4096 elasti hard nproc 4096
vi /etc/sysctl.conf# 追加或修改 ... vm.max_map_count=655360# 执行下 sysctl -p
Download Kibana Free | Get Started Now | Elastic
# 解压
tar -zxvf kibana-8.6.2-linux-x86_64.tar.gz# 移动
mv kibana-8.6.2 /usr/local/kibana-8.6.2# 修改目录归属
chown -R elasti:elasti /usr/local/kibana-8.6.2
vi config/kibana.yml
server.port: 5601
server.host: "外网IP"
i18n.locale: "zh-CN"
su -u es bin/kibana
启动脚本
#!/bin/bash
nohup sudo -u es bin/kibana > logs/out.log 2>&1 &
http://外网IP:5601/
首次登录需要token
进入elasticsearch目录,创建token
bin/elasticsearch-create-enrollment-token -s kibana