elastics-search和kibana使用docker安装在容器里,fleet安装在宿主机上
建议先安装Portainer可视化docker管理工具
1.安装elastic-search
docker run -e ES_JAVA_OPTS="-Xms1g -Xmx1g" --name es01 --net elastic -p 9200:9200 -p 9300:9300 -it docker.elastic.co/elasticsearch/elasticsearch:8.5.0
加入ES_JAVA_OPTS参数指定运行内存
在安装过程中记录下输出的参数
━
✅ Elasticsearch security features have been automatically configured!
✅ Authentication is enabled and cluster connections are encrypted.
ℹ️ Password for the elastic user (reset with `bin/elasticsearch-reset-password -u elastic`):
LTwRu***kG
ℹ️ HTTP CA certificate SHA-256 fingerprint:
1596d9ffe3844d8cdfa56ed3d9***74206f39002a34c7cd85c7
ℹ️ Configure Kibana to use this cluster:
• Run Kibana and click the configuration link in the terminal when Kibana starts.
• Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
eyJ2ZXIiOiI4LjUu***ZCR1htT3lPaEEifQ==
ℹ️ Configure other nodes to join this cluster:
• Copy the following enrollment token and start new Elasticsearch nodes with `bin/elasticsearch --enrollment-token <token>` (valid for the next 30 minutes):
eyJ2ZXIiOiI4LjUuMCIs***GszUTJVMmcifQ==
If you're running in Docker, copy the enrollment token and run:
`docker run -e "ENROLLMENT_TOKEN=<token>" docker.elastic.co/elasticsearch/elasticsearch:8.5.0`
2.安装kibana
安装成后打开 localhost:5601按照提示输入上面的enrollment token
3.安装fleet
./elastic-agent install \
--fleet-server-es=https://192.168.0.180:9200 \
--fleet-server-service-token=AAEAAWVsYXN0***5NzE6YVpvS05UOUVUcXU5dG1KZzJESnZyZw \
--fleet-server-policy=fleet-server-policy \
--fleet-server-es-ca-trusted-fingerprint=1596d9ffe3844d8cd***8e717a174206f39002a34c7cd85c7