Docker安装ES
Docker安装ES1. 拉取镜像2. 创建映射目录3. 配置 elasticsearch.yml4. 运行5. 访问1. 拉取镜像docker pull elasticsearch:7.14.0#查看一下镜像拉取是否成功docker images2. 创建映射目录sudo mkdir -p /data/docker/elasticsearch/configsudo mkdir -p /data/
·
1. 拉取镜像
docker pull elasticsearch:7.14.0
#查看一下镜像拉取是否成功
docker images
2. 创建映射目录
sudo mkdir -p /data/docker/elasticsearch/config
sudo mkdir -p /data/docker/elasticsearch/data
sudo mkdir -p /data/docker/elasticsearch/plugins
# 设置文件夹权限
sudo chmod -R 777 /data/dockerelasticsearch
#设置虚拟机内存
sudo sysctl -w vm.max_map_count=262144
3. 配置 elasticsearch.yml
cd /data/docker/elasticsearch/config
vim elasticsearch.yml
# 主机名,通过 hostname 命令查询到
cluster.initial_master_nodes: ["LIZTEST01"]
network.host: 0.0.0.0
http.port: 9200
http.cors.enabled: true
http.cors.allow-origin: "*"
4. 运行
docker run \
--name elasticsearch \
-p 9200:9200 \
-p 9300:9300 \
-v /data/docker/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /data/docker/elasticsearch/data:/usr/share/elasticsearch/data \
-v /data/docker/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.14.0
5. 访问
http://120.24.204.216:9200/
更多推荐
已为社区贡献1条内容
所有评论(0)