真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

OpenStack實(shí)踐(十一):InstanceLiveMigrateandEvacuate

前言:

成都創(chuàng)新互聯(lián)公司長(zhǎng)期為1000+客戶提供的網(wǎng)站建設(shè)服務(wù),團(tuán)隊(duì)從業(yè)經(jīng)驗(yàn)10年,關(guān)注不同地域、不同群體,并針對(duì)不同對(duì)象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺(tái),與合作伙伴共同營(yíng)造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為林口企業(yè)提供專業(yè)的成都網(wǎng)站制作、做網(wǎng)站,林口網(wǎng)站改版等技術(shù)服務(wù)。擁有十載豐富建站經(jīng)驗(yàn)和眾多成功案例,為您定制開發(fā)。

??? Live Migrate(動(dòng)態(tài)遷移),是指在保證客戶機(jī)上應(yīng)用服務(wù)正常運(yùn)行的同時(shí),讓客戶機(jī)在不同的宿主機(jī)之間進(jìn)行遷移,分為無共享存儲(chǔ)的Block Migration(塊遷移)方式和有共享存儲(chǔ)兩種方式,本文為有共享存儲(chǔ)遷移方式。

??? Migrate前提是計(jì)算主機(jī)的nova-compute服務(wù)正常,當(dāng)某個(gè)計(jì)算主機(jī)宕機(jī)或其它異常導(dǎo)致服務(wù)不可用時(shí),這時(shí)可以進(jìn)行Evacuate操作,將實(shí)例遷移至其它主機(jī)。

環(huán)境

openstack版本pike
控制節(jié)點(diǎn)主機(jī)openstack-controller(ubuntu 16.04.5) 172.27.34.37
計(jì)算節(jié)點(diǎn)主機(jī)openstack-computer(ubuntu 16.04.5) 172.27.34.38
instance01
cirros0001(172.16.2.3)
instance02
cirros0002(172.16.2.6)

ubuntu安裝詳見:Ubuntu16.04.5以lvm方式安裝全記錄

openstack安裝詳見:OpenStack實(shí)踐(一):Ubuntu16.04下DevStack方式搭建p版OpenStack

Flat網(wǎng)絡(luò)搭建詳見:OpenStack實(shí)踐(三):Linux Bridge方式實(shí)現(xiàn)Flat Network

Live Migrate部分

修改nova.conf

修改配置文件nova.conf

stack@openstack-controller:~$?view?/etc/nova/nova.conf?
[vnc]
#vncserver_listen?=?127.0.0.1server_listen=0.0.0.0

重啟計(jì)算服務(wù)

root@openstack-controller:~#?systemctl?restart?devstack@n*

配置hosts文件

配置個(gè)計(jì)算節(jié)點(diǎn)hosts文件,使之能相互識(shí)別主機(jī)名

root@openstack-controller:/# more /etc/hosts

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

免密訪問

各計(jì)算節(jié)點(diǎn)的root用戶能免密訪問應(yīng)用用戶stack

root@openstack-controller:/#?ssh-keygen??-t?rsa

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

root@openstack-controller:~#?ssh-copy-id??-i?/root/.ssh/id_rsa.pub?stack@172.27.34.38

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

密碼測(cè)試

root@openstack-controller:~#?ssh?stack@172.27.34.38

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

libvirt配置

本次實(shí)驗(yàn)無需對(duì)/etc/default/libvirt-bin和/etc/libvirt/libvirtd.conf文件進(jìn)行額外配置,采用默認(rèn)qemu+ssh方式傳輸。

驗(yàn)證連通性

root@openstack-controller:~#?virsh?-c?qemu+ssh://stack@openstack-computer/system?list??--all

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

配置nfs服務(wù)

nfs服務(wù)器配置

[root@centos7?~]#?mkdir?-p?/opt/stack/data/nova/instances
[root@centos7?~]#?chmod?-R?777?/opt/stack/data/nova/instances
[root@centos7?~]#?view?/etc/exports
/opt/stack/data/nova/instances??*(rw,sync,fsid=0,no_root_squash)
[root@centos7?~]#?exportfs?-r
[root@centos7?~]#?exportfs?-v
/opt/stack/data/nova/instances
????????????????(sync,wdelay,hide,no_subtree_check,fsid=0,sec=sys,rw,secure,no_root_squash,no_all_squash)

客戶端掛載

各計(jì)算節(jié)點(diǎn)都執(zhí)行如下操作

安裝nfs軟件

root@openstack-controller:~#?apt-get?install?nfs-common?-y

測(cè)試共享目錄

root@openstack-controller:~#?showmount?-e?172.27.9.181
Export?list?for?172.27.9.181:
/opt/stack/data/nova/instances?*

掛載

root@openstack-controller:~#??mount?-t?nfs?172.27.9.181:/opt/stack/data/nova/instances?/opt/stack/data/nova/instances

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

開啟自動(dòng)掛載

root@openstack-controller:~#?view?/etc/rc.local
mount?-t?nfs?172.27.9.181:/opt/stack/data/nova/instances?/opt/stack/data/nova/instances

nfs搭建詳見:Centos7下NFS服務(wù)器搭建及客戶端連接配置

Live Migrate

查看準(zhǔn)備遷移的實(shí)例

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

該實(shí)例遷移前位于controller節(jié)點(diǎn),為驗(yàn)證是熱遷移,cirros01開啟ping服務(wù)

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

開始遷移

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

目標(biāo)節(jié)點(diǎn)選擇computer,由于是共享存儲(chǔ)方式實(shí)現(xiàn)本實(shí)驗(yàn),不勾選‘塊設(shè)備遷移’選項(xiàng)。

遷移

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate


遷移完成

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

實(shí)例由controller節(jié)點(diǎn)成功遷移至computer節(jié)點(diǎn)

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

ping服務(wù)在遷移過程中未中斷。

命令方式

root@openstack-controller:~#?nova?live-migration?d0d5bc75-da89-46a8-be79-1e2639f9eaf8??openstack-controller

d0d5bc75-da89-46a8-be79-1e2639f9eaf8為實(shí)例id,openstack-controller為目標(biāo)計(jì)算節(jié)點(diǎn)。

日志分析

查看實(shí)例id和req id

查看實(shí)例id和req id以便于日志定位

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate


源節(jié)點(diǎn)nova-api發(fā)送消息

root@openstack-controller:~#?journalctl?-f?--unit?devstack@n-api.service

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

目標(biāo)節(jié)點(diǎn)遷移準(zhǔn)備

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

源節(jié)點(diǎn)暫停實(shí)例啟動(dòng)遷移

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate


目標(biāo)節(jié)點(diǎn)恢復(fù)實(shí)例

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

源節(jié)點(diǎn)完成遷移并釋放資源

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

Evacuate部分

關(guān)閉計(jì)算節(jié)點(diǎn)openstack-computer

root@openstack-computer:~/.ssh#?init?0

查看計(jì)算節(jié)點(diǎn)狀態(tài)

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

查看實(shí)例名和所屬計(jì)算節(jié)點(diǎn)名

root@openstack-controller:~#?nova?list?--fields?id,name,status,instance_name,host

執(zhí)行evacuate?

root@openstack-controller:~#?nova?evacuate??80b8a5ff-5082-4864-b05e-5766c144d2b4??openstack-controller

將實(shí)例80b8a5ff-5082-4864-b05e-5766c144d2b4由計(jì)算節(jié)點(diǎn)openstack-computer遷移至openstack-controller

如果同主機(jī)做evacuate操作會(huì)報(bào)錯(cuò):The target host can't be the same one,如果結(jié)算節(jié)點(diǎn)未宕機(jī)就遷移,則報(bào)錯(cuò):Compute service of openstack-computer is still in use

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

Evacuate操作完成

登陸實(shí)例

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

實(shí)例恢復(fù)后密碼、ip、主機(jī)名都不變。


日志分析

nova-api

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

nova-scheduler

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate


nova-computer

OpenStack實(shí)踐(十一):Instance Live Migrate and Evacuate

本文參考

https://docs.openstack.org/nova/queens/admin/configuring-migrations.html#section-configuring-compute-migrations

https://docs.openstack.org/nova/queens/configuration/config.html

https://docs.openstack.org/nova/pike/admin/evacuate.html

https://blog.51cto.com/cloudman/1786423


網(wǎng)站標(biāo)題:OpenStack實(shí)踐(十一):InstanceLiveMigrateandEvacuate
文章起源:http://weahome.cn/article/gshies.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部