In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you the "sample analysis of common operations of docker mysql tomcat in centos7", which is easy to understand and well-organized. I hope it can help you solve your doubts. Let me lead you to study and learn "sample analysis of common operations of docker mysql tomcat in centos7".
Docker part
View installed docker:yum list installed | grep docker
Reinstall after uninstall: yum-y remove docker.x86_64
Installation: yum-y install docker-io
Launch: service docker start
Restart: systemctl restart docker
Configure accelerated cloud: modify file contents: vi / etc/docker/daemon.json-- > > {"registry-mirrors": ["http://hub-mirror.c.163.com"]}"
Mysql part
Install the mysql image: docker pull mysql:5.7
Run mysql container: docker run-p 3306 MYSQL_ROOT_PASSWORD=123456 3306-- name MySQL-e MYSQL_ROOT_PASSWORD=123456-d mysql:5.7
View mysql Container id:docker ps
Then enter the command: docker exec-it MySQL / bin/bash mysql-uroot-p
Modify the mysql password: set password for root@'%' = password ('123456'); flush privileges
Set up to run remote connection: GRANT ALL ON *. * TO 'root'@'%'
Set max_allowed_packet: query my.cnf file: mysql-- help | grep my.cnf. Modify max_allowed_packet = 20m.
Tomcat part
Install tomcat8:docker pull tomcat:8
Start tomcat (- d means to start in the background): docker run-- name Tomcat-d-p 1515purl 8080 tomcat:8
Enter the tomcat container directory (must be started first. The Tomcat location can be container id/name): docker exec-it Tomcat / bin/bash
Redis part
Install redis:docker pull redis:3.2
Start the redis server: docker run-p 6379 home/redis-data:/data 6379-v / home/redis-data:/data-d-name redis redis:3.2 redis-server-- appendonly yes
Enter the redis client: docker exec-it [redis id] redis-cli
Activemq part
Installation: docker pull docker.io/webcenter/activemq
Start: docker run-p 61616 name activemq docker.io/webcenter/activemq 61616-p 8161-d-restart=always-- name activemq docker.io/webcenter/activemq
Jdk part
Host installs jdk:docker pull java:8u111
Start the jar application: see jenkins
Es part
Download: https://www.elastic.co/cn/downloads/past-releases/elasticsearch-6-3-2
Jenkins part
Installation: docker pull jenkins/jenkins
Start: docker run-d-restart=always-p 1516 jenkins:/var/jenkins_home-p 50000-v jenkins:/var/jenkins_home-v / etc/localtime:/etc/localtime-- name jenkins docker.io/jenkins/jenkins
Configure jdk and git: enter the container [docker exec-it jenkins / bin/bash] and execute [whereis git/java]
Generate the public key: ssh-keygen-t rsa-C "763854696@qq.com"
Check the public key: cat / var/jenkins_home/.ssh/id_rsa.pub
Check the private key: cat / var/jenkins_home/.ssh/id_rsa
Add credentials: select SSH Username with private key,username, enter root,private key, enter the private key.
When configuring the project git warehouse, select the credential
Install the SSH plug-in, maven integration plug-in, and configure SSH remote hosts: https://www.cnblogs.com/sxdcgaq8080/p/10489369.html
For other jenkins content, please see this article: https://www.jianshu.com/p/0391e225e4a6
Final configuration project: clean install-Pprod-Dmaven.test.skip=true
Remote shell command:
# pre step# stop container docker stop hcbook | | true# delete container docker rm hcbook | | true# post stepJAR_PATH=/hcxs-web/target/hcxs-web-1.0-SNAPSHOT.jarPNAME=hcbook# move jar to the destination address docker cp jenkins:$WORKSPACE$JAR_PATH / home/$PNAME.jar# launch container docker run-d-p 1515docker rm hcbook 1515-v / home/logs:/export/Logs-v / home/$PNAME.jar:/usr/$PNAME.jar-- name $PNAME java:8u111 java- Jar / usr/$PNAME.jar install rz/sz command
Execute: yum install-y lrzsz
Common operation
View the running container: docker ps
View all containers: docker ps-a
Launch container: docker start [cotaillntainer id]
Stop Container: docker stop [container id]
Delete container: docker rm [container id]
Modify container name: docker rename [original container name] [new container name]
Query container standalone ip:docker inspect-- format=' {{.NetworkSettings.IPAddress}'[Container name | Container id]
Launch all containers: docker start $(docker ps-a | awk'{print $1}'| tail-n + 2)
Stop all containers: docker stop $(docker ps-a | awk'{print $1}'| tail-n + 2)
Vim/vi command
You need to install vim:apt-get install vim in each container, and if it is not successful, execute apt-get update and then execute the previous installation command.
The above is all the contents of the article "sample Analysis of Common docker mysql tomcat Operations in centos7". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.