In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Among them, oracle and redis no longer need major changes after the first deployment, engineering containers need to be upgraded frequently, and nginx containers need to be restarted frequently.
Note:
The-v option in docker run mounts the host directory to the specified directory in the container, which is an override operation.
The mounted log directory must be placed on the partition with more space on the host, so as not to cause the service to run because the log is full. It is considered in this document that / opt is a partition with large space.
The docker service will take over the firewall of the host, and the port mapping between the container and the host is done by docker through iptables, so do not shut down or empty the firewall.
1. Oracle container operation starts container $docker run-d-- privileged-- restart=always\-- shm-size 2147483648\-p 1521 privileged 1521\-v / opt/oracle:/opt/oracle\ reg01.sky-mobi.com/huoshu/oracle-final:1.0.3
Use docker-enter to enter the container, execute the initialization script, and start the data instance
# # execute initialization script to make sysctl configuration effective bash / root/init.sh # # switch user su-oracle## launch oracle listener lsnrctl start## enter sqlplus command line sqlplus "/ as sysdba" SQL > startupORACLE instance started.Total System Global Area 3206836224 bytesFixed Size 2217632 bytesVariable Size 369101152 bytesDatabase Buffers 2818572288 bytesRedo Buffers 16945152 bytesDatabase mounted.Database opened.SQL >
Exit the container and return to the host command line.
If the oracle container is on a separate server, you do not need to specify IP, you only need to map port 1521 of the container to port 1521 of the host itself.
Note:
Due to the existence of the-- restart=always startup parameter, the container will restart automatically when it crashes abnormally. Other containers set the rules for automatically running the services at startup, but the oracle container does not have this configuration, so you still need to manually enter the container and perform the above operation again after the oracle container is hung up.
The data storage directory needs to be packaged separately. This directory should also be mounted at startup to prevent data loss when the container crashes.
2. Nginx Container Operation 2.1 launch container docker run-d-- restart=always\-- net huoshu-- ip=172.21.0.2-p 80:80-p 81:81\-v / opt/apps/front:/opt/apps\-v / opt/apps/front/nginx.conf.d:/etc/nginx/conf.d\-v / var/log/nginx:/var/log/nginx\ reg01.sky-mobi.com/huoshu/nginx:1.0.0
About upgrad
The target structure of the / opt/apps/front mounted in the above startup command is as follows.
$tree-L 2. ├── bi_FE ├── hdc_FE └── nginx.conf.d ├── bi.conf └── hdc.conf
Nginx.conf.d is mounted to the / etc/nginx/conf.d directory of the nginx container, so you can edit this file directly on the host machine and restart the nginx in the container.
In addition, since the / opt/apps/front directory is mounted into the container, it cannot be deleted while the nginx container is running. To upgrade the front-end project, you need to put the new project package in this / opt/apps/front directory, replace the original project directory, and then restart nginx.
For reasons that cannot be deleted, the nginx container holds a handle to the / opt/apps/front directory. Deleting this directory only deletes its index, and the actual storage block is still there. The newly created directory will not be remounted to the container.
2.2 nginx restart command
You can execute the command without entering the container, using the docker exec container id target command, as follows
$docker exec c98790552123 nginx-tnginx: the configuration file / etc/nginx/nginx.conf syntax is oknginx: configuration file / etc/nginx/nginx.conf test is successful$ docker exec c98790552123 nginx-s reload
Of course, it is the same for docker-enter to enter the container and then operate.
3. Redis container operation
Startup command: map port, mount storage and log directory (all in / var/log directory).
$docker run-d-- restart=always\-- net huoshu-- ip=172.21.0.3-p 6379 net huoshu 6379\-v / var/log/redis:/var/log/redis\ reg01.sky-mobi.com/huoshu/redis:1.0.04. Engineering container
Note:
-- net,-- ip and the value specified by the-p option correspond to the configuration file of nginx and should not be easily modified.
ORACLE_ADDR variable, the oracle addresses of different hospitals should be specified at startup and modified according to the actual situation.
Etlloader
$docker run-d-- restart=always-- name etlloader\-- net huoshu-- ip 172.21.1.4-p 8380 name etlloader 8080\-e ORACLE_ADDR=172.16.4.101\-v / var/log/etlloader:/opt/etlloader/consolelog\ reg01.sky-mobi.com/huoshu/etlloader:1.0.0
Skydata-se
$docker run-d-- restart=always-- name skydata-se\-- net huoshu-- ip=172.21.1.3-p 8280 name skydata-se 8080\-v / var/log/skydata-se:/usr/local/apache-tomcat-8.5.4/logs\-e ORACLE_ADDR=172.16.4.101\ reg01.sky-mobi.com/huoshu/skydata-se:1.0.0
Hdc-manager
$docker run-d-- restart=always-- name hdc-manager\-- net huoshu-- ip=172.21.1.2-p 8180 name hdc-manager 8080\-v / var/log/hdc-manager:/usr/local/apache-tomcat-8.5.4/logs\-e ORACLE_ADDR=172.16.4.101\ reg01.sky-mobi.com/huoshu/hdc-manager:1.0.0
Drgs
$docker run-d-restart=always\-net huoshu-ip 172.21.1.5-p 9998 ORACLE_ADDR=172.16.4.101 9998\-e ORACLE_ADDR=172.16.4.101\-v / var/log/drgs:/opt/drgs/log\ reg01.sky-mobi.com/huoshu/drgs:1.0.0
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.