这篇文章主要介绍“docker怎么安装es”,在日常操作中,相信很多人在docker怎么安装es问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”docker怎么安装es”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!
拷贝容器的配置文件到当前目录(以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 服务器的ip
docker 安装mysql
* docker update mysql --restart=always 虚拟机启动,镜像跟着启动
(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 虚拟机启动,镜像跟着启动
(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)启动redis docker exec -it redis redis-cli
(3)配置redis的配置文件 /mydata/redis/conf/redis.conf
appendonly yes #redis持久化
maven配置
<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 >
到此,关于“docker怎么安装es”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。