溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

docker怎么安裝es

發(fā)布時(shí)間:2021-08-16 20:20:15 來(lái)源:億速云 閱讀:234 作者:chen 欄目:大數(shù)據(jù)

這篇文章主要介紹“docker怎么安裝es”,在日常操作中,相信很多人在docker怎么安裝es問題上存在疑惑,小編查閱了各式資料,整理出簡(jiǎn)單好用的操作方法,希望對(duì)大家解答”docker怎么安裝es”的疑惑有所幫助!接下來(lái),請(qǐng)跟著小編一起來(lái)學(xué)習(xí)吧!

  • 拷貝容器的配置文件到當(dāng)前目錄(以nginx為例):

docker container cp nginx:/etc/nginx .

0.安裝nginx

docker run -p 80:80 --name nginx -v /mydata/nginx/html:/usr/share/nginx/html -v /mydata/nginx/logs:/var/log/nginx -v/mydata/nginx/conf:/etc/nginx -d nginx:1.10

查看日志-- docker container logs -f elasticsearch

1.  安裝 elasticsearch

(1)docker pull elasticsearch:7.4.2

(2)docker pull kibana:7.4.2

(3) mkdir -p /mydata/elasticsearch/config

(4)mkdir -p /mydata/elasticsearch/data

(5)echo "http.host: 0.0.0.0">>/mydata/elasticsearch/config/elasticsearch.yml

(6)

docker run --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx128m" -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

****chmod  -R 777  /mydata/elasticsearch

2.安裝  kibana

docker run --name kibana -e ELASTICSEARCH_HOSTS=http://192.168.56.10:9200/ -p 5601:5601 -d kibana:7.4.2

*** docker run --name kibana -e ELASTICSEARCH_HOSTS=121.89.193.237:9200  -p 5601:5601 -d kibana:7.4.2   --restart=always

ELASTICSEARCH_HOSTS=121.89.193.237:9200              服務(wù)器的ip

docker 安裝mysql

* docker update mysql --restart=always  虛擬機(jī)啟動(dòng),鏡像跟著啟動(dòng)

(1) 

docker run -p 3306:3306 --name mysql -v /mydata/mysql/log:/var/log/mysql -v /mydata/mysql/log:/var/log/mysql -v /mydata/mysql/data:/var/lib/mysql -v /mydata/mysql/conf:/etc/mysql -e MYSQL_ROOT_PASSWORD=mysql -d mysql:5.7

(2)配置mysql文件  /mydata/mysql/conf/my.conf

[client]
default-character-set=utf8

[mysql]
default-character-set=utf8

[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
skip-name-resolve

docker安裝redis

* docker update redis--restart=always  虛擬機(jī)啟動(dòng),鏡像跟著啟動(dòng)

(1)

docker run -p 6379:6379 --name redis -v /mydata/redis/data:/data -v /mydata/redis/conf/redis.conf:/etc/redis/redis.conf -d redis redis-server /etc/redis/redis.conf

(2)啟動(dòng)redis  docker exec -it redis redis-cli

(3)配置redis的配置文件  /mydata/redis/conf/redis.conf
appendonly yes  #redis持久化

maven配置

docker怎么安裝es

<mirrors>

<mirror>

<id>nexus-aliyun</id>

<mirrorOf>central</mirrorOf>

<name>Nexus aliyun</name>

<url>http://maven.aliyun.com/nexus/conect/groups/public</url>

</mirror>

</mirrors>

< profiles >

< profile >

< id > jdk‐1.8 </ id >

< activation >

< activeByDefault > true </ activeByDefault >

< jdk > 1.8 </ jdk >

</ activation >

< properties >

< maven.compiler.source > 1.8 </ maven.compiler.source >

< maven.compiler.target > 1.8 </ maven.compiler.target >

< maven.compiler.compilerVersion > 1.8 </ maven.compiler.compilerVersion >

</ properties >

</ profile >

</ profiles >

到此,關(guān)于“docker怎么安裝es”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識(shí),請(qǐng)繼續(xù)關(guān)注億速云網(wǎng)站,小編會(huì)繼續(xù)努力為大家?guī)?lái)更多實(shí)用的文章!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI