当前位置:网站首页>Deploying WordPress instance tutorial under coreos
Deploying WordPress instance tutorial under coreos
2022-07-03 11:49:00 【Brother Xing plays with the clouds】
CoreOS Is a special for large-scale The server Deploy custom Linux Streamline systems , It completely separates the operating system from the application , Thus reducing the coupling between the operating system and the application , At the same time, it solves the existing Linux The server In container resources 、 Problems in permission management . For now ,CoreOS It will be the development trend of the future operating system .
Have you been there in person CoreOS Deploy an application ? I believe most people have never had such experience , stay CoreOS It can be said to be very hard and frustrating to build an application on . Because before you start to build a program, you must first understand all the different technologies .
below , We will teach you hand in hand to create a simple WordPress Applications , use MySQL As The server , stay CoreOS Up operation .
The server operating system CoreOS First experience http://www.linuxidc.com/Linux/2014-07/104807.htm
1. install CLI To control CoreOS
If your computer is Mac, It can be installed locally fleetctl and etcdctl To control CoreOS colony :
$ brew install go etcdctl
$ git clone https://github.com/coreos/fleet.git
$ cd fleet
$ ./build
$ mv bin/fleetctl /usr/local/bin/2. Install local colony
Use deployment virtualization development environment Vagrant To install local colony be prone to :
$ git clone https://github.com/CenturyLinkLabs/coreos-vagrant
$ cd coreos-vagrant/cluster
$ vagrant up --provisionNow the cluster is installed , Easy ! Now let's check the local fleetctl:
$ fleetctl list-machines
MACHINE IP METADATA
09fd0a88... 10.0.2.15 -
77763947... 10.0.2.15 -
f31c383c... 10.0.2.15 -That's great , It works !
3. Use fleet Deploy an application
fleetctl The command can deploy the application to CoreOS In the nodes of the cluster , But for fleet Writing service files is really terrible . Fortunately, , You don't have to write it yourself , You can use yaml format To generate service files :
$ sudo gem install bundler fig2coreos
$ cat fig.yml
web:
image: ctlc/wordpress
ports:
- 80:80
environment:
DB_USER: root
DB_PASSWORD: qa1N76pWAri9
links:
- db
db:
image: ctlc/mysql
ports:
- 3306:3306
environment:
MYSQL_DATABASE: wordpress
MYSQL_ROOT_PASSWORD: qa1N76pWAri9
$ fig2coreos myapp fig.yml coreos-files
$ cd coreos-files
$ ls
db-discovery.1.service
db.1.service
web-discovery.1.service
web.1.servicefleetctl The client tool uses etcd Systematic Key/Value Storage form , To share configuration and service discovery . Here is how to deploy the program to the cluster :
$ fleetctl start db.1.service
$ fleetctl list-units
UNIT LOAD ACTIVE SUB DESC MACHINE
db.1.service loaded active running Run db_1 9c008961.../10.0.2.15
$ fleetctl start web.1.service
$ fleetctl list-units
UNIT LOAD ACTIVE SUB DESC MACHINE
db.1.service loaded active running Run db_1 9c008961.../10.0.2.15
web.1.service loaded active running Run web_1 9c008961.../10.0.2.15Now the program is running , But I haven't registered yet etcd Service for , Fortunately, fig2coreos The generated service discovery file can help us :
$ fleetctl start db-discovery.1.service
$ fleetctl start web-discovery.1.service
$ fleetctl list-units
UNIT LOAD ACTIVE SUB DESC MACHINE
db-discovery.1.service loaded active running Announce db_1 9c008961.../10.0.2.15
db.1.service loaded active running Run db_1 9c008961.../10.0.2.15
web-discovery.1.service loaded active running Announce web_1 9c008961.../10.0.2.15
web.1.service loaded active running Run web_1 9c008961.../10.0.2.15
$ etcdctl ls --recursive
/services
/services/web
/services/web/web_1
/services/db
/services/db/db_1
$ etcdctl get /services/web/web_1
{ "host": "core-03", "port": 80, "version": "52c7248a14" }
$ etcdctl get /services/db/db_1
{ "host": "core-03", "port": 3306, "version": "52c7248a14" }That's it ! If you're using Vagrant 1.5 And Vagrant Cloud, Then you can achieve WordPress Program and see that it can be implemented :
$ cd ~/coreos-vagrant/cluster/
# find out which box is hosting your port 80
$ etcdctl get /services/web/web_1
{ "host": "core-03", "port": 80, "version": "52c7248a14" }
$ vagrant share core-03 --http 80
==> core-03: Detecting network information for machine...
core-03: Local machine address: 192.168.65.2
core-03: Local HTTP port: 80
core-03: Local HTTPS port: disabled
==> core-03: Checking authentication and authorization...
==> core-03: Creating Vagrant Share session...
core-03: Share will be at: quick-iguana-4689
==> core-03: Your Vagrant Share is running! Name: quick-iguana-4689
==> core-03: URL: http://quick-iguana-4689.vagrantshare.comThe following is the finished rendering :
In fact, we can be in CoreOS I can do many things , Today, this is just the foundation , You can have a try if you are interested .
边栏推荐
- .\vmware-vdiskmanager.exe -k “c:\\xxxxx.vmdk”
- Mysql根据时间搜索常用方法整理
- Phpcms prompt message page Jump to showmessage
- Repo ~ common commands
- Redis things
- Qt+VTK+OCCT读取IGES/STEP模型
- Numpy np. Max and np Maximum implements the relu function
- 并发编程-单例
- Understand go language context in one article
- Gut | Yu Jun group of the Chinese University of Hong Kong revealed that smoking changes intestinal flora and promotes colorectal cancer (do not smoke)
猜你喜欢
随机推荐
AOSP ~ NTP ( 网络时间协议 )
Qt+VTK+OCCT读取IGES/STEP模型
解决msvcp120d.dll和msvcr120d.dll缺失
Groovy测试类 和 Junit测试
Nestjs配置服务,配置Cookie和Session
PHP server interacts with redis with a large number of close_ Wait analysis
Excel快速跨表复制粘贴
DS90UB949
cgroup简介
phpcms 提示信息頁面跳轉showmessage
Redis things
How PHP solves the problem of high concurrency
The R language uses the hist function in the native package (basic import package, graphics) to visualize the histogram plot
并发编程-单例
剑指offer专项32-96题做题笔记
Program process management tool -go Supervisor
Asyncio warning deprecationwarning: there is no current event loop
《剑指offer 04》二维数组查找
vulnhub之cereal
Key switch: press FN when pressing F1-F12




![抓包整理外篇fiddler———— 会话栏与过滤器[二]](/img/04/e9cc027d753e7049f273d866eefdce.png)



