安裝前準(zhǔn)備
創(chuàng)建掛載目錄
用于在宿主機(jī)掛載日志,數(shù)據(jù)等內(nèi)容
創(chuàng)建/opt/es/data目錄
創(chuàng)建/opt/es/logs目錄
創(chuàng)建/opt/es/plugins目錄
創(chuàng)建/opt/es/conf目錄
mkdir -p /opt/es/{data,logs,plugins,conf}
授權(quán)相關(guān)權(quán)限
chmod -R 777 /opt/es/data
chmod -R 777 /opt/es/logs
chmod -R 777 /opt/es/conf
chmod -R 777 /opt/es/plugins
創(chuàng)建elasticsearch.yml文件
vim /opt/es/conf/elasticsearch.yml
內(nèi)容
http.host: 0.0.0.0
拉取鏡像
docker pull elasticsearch:7.17.2
運(yùn)行容器
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms84m -Xmx512m" \
-v /opt/es/conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
-v /opt/es/data:/usr/share/elasticsearch/data \
-v /opt/es/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.17.2
查看運(yùn)行情況
運(yùn)行成功文章來源:http://www.zghlxwxcb.cn/news/detail-701907.html
測試
URL:IP:9200
出現(xiàn)以下畫面即可文章來源地址http://www.zghlxwxcb.cn/news/detail-701907.html
到了這里,關(guān)于Docker安裝部署ElasticSearch(ES)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!