In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "how to use docker". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
First, use Baidu CVM to configure a linux environment with more than centos7 version, and then download shell on your own computer according to the docker official website to install docker environment and configuration. The official website has a version for students to use. Select the appropriate version in the figure to download and install and connect to the CVM.
Docker: after the official website address is installed, remember to change the image download address and use the docker command to install mysql,redis,tomcat,rabbitmq and other related applications. The following example installation of redis and mysql,rabbitmq docker is nothing more than six steps.
1. Search for image (docker search image name) 2. Pull your own version image (if the docker pull image name is not followed by: version number, pull the latest image) 3. View image (docker images) 4. Start the image (docker run-d background run /-it foreground run-p designated port-P random port-name container name image name, etc.) 5. Stop the container (docker stop image ID or name) 6. Remove the container (docker rmi image ID or name)
Install the image of mysql. If you need external access, you need to issue the following command
1.docker search mysql2. Docker pull mysql:*.*3.docker images4.docker run-p 3306 xie/mysql/conf:/etc/mysql/conf.d 3306-- name mysql-v / xie/mysql/conf:/etc/mysql/conf.d-v / xie/mysql/logs:/logs-v / xie/mysql/data:/var/lib/mysql-e MYSQL_ROOT_PASSWORD=123456-d mysql5. After running, enter docker exec-it mysql bash mysql-u root-p select host,user,plugin,authentication_string from mysql.user; in the container (host is% means no restriction on ip localhost means that the password needs to be changed if the machine uses plugin other than mysql_native_password). Enter the following command: mysql > ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY' 123456 alternate MySQL > flush privileges Query select host,user,plugin,authentication_string from mysql.user; again and you can connect externally as shown below
When installing redis, use container data volumes to create redis.conf on the CVM.
1.docker pull redis2.docker run-p 6379root/test/redis.conf:/usr/local/etc/redis/redis.conf 6379-v / root/test/data:/data-v / root/test/redis.conf:/usr/local/etc/redis/redis.conf-d redis:3.2 redis-server / usr/local/etc/redis/redis.conf-- appendonly yes3. Then create a redis.conf file under the redis.conf folder for editing, comment out bind 127.0.0.1 and set the protection mode in the figure to no. When you are responsible for the connection, you will not be able to connect 4. Finally, use redi-desktop to test the connection
Install rabbitmq
1.docker search rabbitmq2. Docker pull rabbitmq:*.*3.docker images4.docker run-d-- hostname localhost-- name rabbit-management-- restart=always-p 15672 rabbitmq:3.6-management-alpine 15672-p 5672 rabbitmq:3.6-management-alpine "how to use docker" is introduced here. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.