Elasticsearch安装

docker pull elasticsearch:7.6.2
mkdir -p /root/elasticsearch/config
mkdir -p /root/elasticsearch/data
chmod -R 777 /root/elasticsearch/
echo "http.host: 0.0.0.0" >> /root/elasticsearch/config/elasticsearch.yml
# http.host: 0.0.0.0
# xpack.security.enabled: true
# xpack.license.self_generated.type: basic
# xpack.security.transport.ssl.enabled: true
sysctl -w vm.max_map_count=262144

docker run --name elasticsearch -p 9200:9200  -p 9300:9300 \
 -e "discovery.type=single-node" \
 -e ES_JAVA_OPTS="-Xms84m -Xmx512m" \
 -v /root/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
 -v /root/elasticsearch/data:/usr/share/elasticsearch/data \
 -v /root/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
 -d elasticsearch:7.6.2

Kibana安装

mkdir -p /root/kibana    # 创建挂载配置目录
chmod 777 /root/kibana   # 赋值读写执行权限
echo "server.host: 0.0.0.0" >> /root/kibana/kibana.yml
echo "elasticsearch.hosts: http://0.0.0.0:9200" >> /root/kibana/kibana.yml # 0.0.0.0 表示你的ip

# server.host: 0.0.0.0
# elasticsearch.hosts: http://172.17.0.1:9200
# i18n.locale: "zh-CN"
# elasticsearch.username: "elastic"
# elasticsearch.password: "123456"

	
docker run --name kibana -v /root/kibana/kibana.yml:/usr/share/kibana/config/kibana.yml -p 5601:5601 -d kibana:7.6.2