Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy wordpress through service in a swarm cluster

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to deploy wordpress through service in the swarm cluster, I believe most people do not know much about it, so share this article for your reference. I hope you will learn a lot after reading this article. Let's learn about it together.

Create an overlay-driven network docker network create-d overlay wordpress [vagrant@swarm-manager ~] $docker network lsNETWORK ID NAME DRIVER SCOPEq3rp3i79eud7 wordpress overlay swarm to create a mysql container docker service create-- name mysql--env MYSQL_ROOT_PASSWORD=root-- env MYSQL_DATABASE=wordpress-- network wordpress-- mount type=volume,source=mysql-data Destination=/var/lib/mysql mysql creates wordpressdocker service create-- name wordpress-p 80:80-- env WORDPRESS_DB_PASSWORD=root-- env WORDPRESS_DB_HOST=mysql-- network wordpress wordpress to view node distribution # Service list [vagrant@swarm-manager ~] $docker service lsID NAME MODE REPLICAS IMAGE PORTSvxz0bfmul9th mysql replicated 1 docker service lsID NAME MODE REPLICAS IMAGE PORTSvxz0bfmul9th mysql replicated 1 wordpress:latest *: 80-> Node distribution of 80/tcp# wordpress service [vagrant@swarm-manager ~] $docker service ps Node distribution of wordpressID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTStnh5f0ldyidl wordpress.1 wordpress:latest swarm-manager Running Running 4 minutes ago# mysql service [vagrant@swarm-manager ~] $docker service ps mysqlID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTSjns8bllzbz94 mysql.1 mysql:5.7.22 swarm-work1 Running Running 33 minutes ago

Although wordpress is only distributed on one node of swarm-manager (192.168.205.10), we find that using the following link to visit, the effect is the same. For specific reasons, please see 7.6.

Http://192.168.205.10/http://192.168.205.11/http://192.168.205.12/ in swarm mode, do not need to install etcd,swarm will automatically help us maintain the distributed overlay network above is "how to deploy wordpress through service in swarm cluster" this article, 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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report