I just came to the company and tested the server of the environment project with the company. The environment is linux Centos7.2. All tomcats are mounted under the docker container, so I also learned some simple docker commands (please understand what docker is before learning, and know what docker is). common linux commands).
List some commonly used ones:
docker pull mysql 5.7 in one step
$ docker run -d -e MYSQL_ROOT_PASSWORD=admin --name mysql -v /data/mysql/data:/var/lib/mysql -p 3306:3306 mysql
The default password admin can be changed if you want to modify it. --name is the instance name mysql -v will reflect the /data/mysql/data host (that is, the path of centos) to port 3306 under /var/lib/mysql
Docker install zookeeper in two steps
docker run -d --name zookeeper --publish 2181:2181 jplock/zookeeper:3.4.6
Similar to MySQL
docker install tomcat in one step
The port is defined by itself, xxx is the running path of the project under the linux host, that is, the project path of the webapps under tomcat, reflected to ROOT
docker install rabbitmq in one step
Note: If the port is opened, the firewall under the server must open the custom port, and the security group is also
docker install redis
docker run redis --name redis -p 6379:6379 -d redis-server
docker install nginx
docker ps -a to view all containers
docker exec -it instance name /bin/bash enter the instance, such as entering tomcat under docker exec -it tomcat /bin/bash
If tomcat runs slowly, you need to change the session random of jdk. After entering the instance, cd $JAVA_HOME Enter the Path of JAVA, cd /lib/security vim java.security
Change this to /dev/./urandom So far, the reason why tomcat is running slowly is solved
docker inspect instance name to get all the data of the instance