In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
The self-startup of docker is managed by sysv-rc-conf and other management startup scripts # docker.servicestarting cards, binanthanthshsudo systemctl enable dockersudo systemctl start docker.
Place the script in the / etc/init.d/ directory, change it to root execute permissions, and then type
Sysv-rc-conf
Set startup permissions on the interface.
If docker is installed by apt, the startup script has been automatically placed in the / etc/init.d/ directory.
Self-startup of docker container
We have set docker to manage various containers since docker starts, and we can also set a restart policy for containers.
After the container is exited or powered on, docker can specify the restart policy by using the-restart parameter when the container is created.
Selecting no for multiple parameter values does not automatically restart the container. (default) on-failure container exits after error (container exit status is not 0) and restarts the container. You can specify the maximum number of restarts. For example, on-failure:10unless-stopped restarts the container only when the container has dropped stop or Docker stoped/restarted. Always restarts the container only when the container has stop or Docker stoped/restarted. Manual stop does not count # set startup policy docker run-- restart always-- name mynginx-d nginx if the container has been created, we want to modify the container restart policy docker update-- restart no mynginx
Note:
The restart policy will not take effect until the container is started successfully. In this case, "successful startup" means that the container has been in up for at least 10 seconds and has been under docker supervision. This is to prevent containers that do not start successfully from falling into the dead loop of restart.
If you manually stop a container, the restart policy set by the container will be ignored unless the Docker daemon is restarted or the container is manually restarted. This avoids that if the restart policy is set to always, the container cannot be stopped manually if policy is not ignored.
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.