新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
CentOS7系統(tǒng)遷移具體方案
本篇文章重點(diǎn)為大家講解一下CentOS7系統(tǒng)遷移具體方法,有需要的小伙伴可以參考一下。

實(shí)驗(yàn)環(huán)境:
系統(tǒng):centos7 ip:172.16.1.101 server1部署nginx,再裝一臺新的server2 和server1一樣的環(huán)境但是不部署軟件,實(shí)驗(yàn)要求遷移之前訪問server1的nginx可以訪問,訪問server2的nginx可以訪問。
server1部署nginx
[root@localhost ~]# tar xf nginx-1.11.2.tar.gz
[root@localhost ~]# ./configure
[root@localhost ~]# make
[root@localhost ~]# make install
編輯index.html
[root@localhost html]# cat index.html aaaaaaaaa this is a test!
測試nginx
[root@localhost html]# curl 172.16.1.101
aaaaaaaaa
this is a test!
將重要目錄打包
–exclude 指定的目錄不打包 –warning 略過報(bào)錯(cuò)
[root@localhost ~]# cd /
[root@localhost /]# tar cvpzf backup.tgz / --warning=no-file-changed --exclude=/proc --exclude=/mnt --exclude=/sys --exclude=/dev --exclude=/tmp --exclude=/backup.tgz
登錄server2進(jìn)行遷移
可以用拷貝的方式,我這里先在server配置成172.16.1.102 通過scp傳過來 cd /
[root@localhost html]# scp [email protected]:/backup.tgz .
[root@localhost /]# cd /
[root@localhost /]#
[root@localhost /]# tar xvpfz backup.tgz -C /
[root@localhost /]# restorecon -Rv /
測試
關(guān)閉server1 重啟server2訪問172.16.1.101 的nginx
[root@localhost /]# curl 172.16.1.101
aaaaaaaaa
this is a test!
實(shí)驗(yàn)環(huán)境不同,可能會(huì)有差異可以考慮uuid或者掛載方面的問題。
總結(jié)
這就是一種簡單的遷移方式,還有其他的方法后面再跟大家介紹
分享題目:CentOS7系統(tǒng)遷移具體方案
分享鏈接:http://www.fisionsoft.com.cn/article/dhgghci.html


咨詢
建站咨詢
