安装es
docker pull comworkio/elasticsearch:7.13.2-arm
安装kibana
docker pull comworkio/kibana:7.13.2-arm
# 1.首先切换至root用户
su - root
# 2.编辑sysctl.conf文件
sudo nano /etc/sysctl.conf
# 3.添加配置
vm.max_map_count=262144
# 4.加载配置
sysctl -p
# 或者可以临时修改参数
sysctl -w vm.max_map_count=262144
# 5.查看修改结果
sysctl -a|grep vm.max_map_count
# 6. 修改完之后需要重启elasticsearch 进入到bin目录下
sh elasticsearch -d
配置elasticsearch.yml为:
http.host: 0.0.0.0
# 配置跨域
http.cors.enabled: true # 开启跨域
# 允许所有都可以访问
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization
xpack.security.enabled: true
执行:
systemctl stop docker
systemctl start docker
docker run --restart=always --name es01 \
-p 9200:9200 -p 9300:9300 \
--net mynetwork --ip 172.18.0.11 \
-e TAKE_FILE_OWNERSHIP="true" \
-e ES_JAVA_OPTS="-Xms512m -Xmx512m" \
-v /home/pi/kdata/es01/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /home/pi/kdata/es01/data:/usr/share/elasticsearch/data \
-v /home/pi/kdata/es01/plugins:/usr/share/elasticsearch/plugins \
-v /home/pi/kdata/es01/logs:/usr/share/elasticsearch/logs \
-d comworkio/elasticsearch:7.13.2-arm
docker run --restart=always --name es02 \
-p 9201:9200 -p 9301:9300 \
--net mynetwork --ip 172.18.0.12 \
-e TAKE_FILE_OWNERSHIP="true" \
-e ES_JAVA_OPTS="-Xms216m -Xmx216m" \
-v /home/pi/kdata/es02/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /home/pi/kdata/es02/data:/usr/share/elasticsearch/data \
-v /home/pi/kdata/es02/plugins:/usr/share/elasticsearch/plugins \
-v /home/pi/kdata/es02/logs:/usr/share/elasticsearch/logs \
-d comworkio/elasticsearch:7.13.2-arm
docker run --restart=always --name kibana \
-p 5601:5601 \
--net mynetwork --ip 172.18.0.13 --privileged=true \
-e "I18N_LOCALE=zh-CN" \
-v /home/pi/kdata/kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml \
-d comworkio/kibana:7.13.2-arm
树莓派docker部署es+kibana
最新推荐文章于 2023-04-27 18:28:28 发布