切换root 用户
su root
拉起镜像
docker pull elasticsearch:7.4.2
docker pull kibana:7.4.2
#1、创建Elasticsearch配置文件夹
mkdir -p /mydata/elasticsearch/config
#2、创建Elasticsearch数据文件夹
mkdir -p /mydata/elasticsearch/data
#3、创建Elasticsearch插件文件夹(如:ik)
mkdir -p /mydata/elasticsearch/plugins
echo "http.host: 0.0.0.0">>/mydata/elasticsearch/config/elasticsearch.yml
chmod -R 777 elasticsearch/
docker run --name elasticsearch -p 9200:9200 \
-p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms64m -Xmx512m" \
-v /mydata/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.4.2
docker update elasticsearch --restart=always
安装kibana
docker run --name kibana \
-e ELASTICSEARCH_HOSTS=http://192.168.56.10:9200 \
-p 5601:5601 \
-d kibana:7.4.2
docker update kibana --restart=always
设置 MySQL 开机自启命令如下:
sudo docker update mysql --restart=always
设置 Redis 开机自启命令如下:
sudo docker update redis --restart=always文章来源:https://www.toymoban.com/news/detail-654854.html
文章来源地址https://www.toymoban.com/news/detail-654854.html
到了这里,关于docker 安装 elasticsearch、kibana 7.4.2的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!