在OpenVZ虛擬環(huán)境下安裝管理軟件HyperVM,切割VPS服務(wù)
![]()
![]()
?
【引用】
OpenVZ是開(kāi)源軟件,是基于Linux平臺(tái)的操作系統(tǒng)級(jí)服務(wù)器虛擬化解決方案。OpenVZ采用SWsoft的Virutozzo虛擬化服務(wù)器軟件產(chǎn)品的內(nèi)核,Virutozzo是SWsoft公司提供的商業(yè)虛擬化解決方案。
OpenVZ可以在單個(gè)物理服務(wù)器上創(chuàng)建多個(gè)隔離的虛擬專用服務(wù)器(VPS)并以最大效率共享硬件和管理資源。每個(gè)VPS的運(yùn)行和獨(dú)立服務(wù)器完全一致,因其自身的用戶、應(yīng)用程序都可以獨(dú)立重起,它擁有根訪問(wèn)權(quán)限、用戶、IP地址、內(nèi)存、處理器、文件、應(yīng)用服務(wù)、系統(tǒng)庫(kù)文件和配置文件等。擁有輕量級(jí)處理?yè)p耗和高效設(shè)計(jì)的OpenVZ是運(yùn)行應(yīng)用服務(wù)和實(shí)時(shí)數(shù)據(jù)生產(chǎn)型服務(wù)器虛擬化的最佳選擇。
OpenVZ軟件同時(shí)為用戶提供工具,協(xié)助自動(dòng)化管理虛擬服務(wù)器。基于模板的應(yīng)用程序部署可以在幾分鐘內(nèi)用簡(jiǎn)單的方法創(chuàng)建新的虛擬服務(wù)器并投入使用,而且與其他的虛擬化技術(shù)相比,OpenVZ可以在每CPU上運(yùn)行幾倍于其他虛擬化服務(wù)器技術(shù)的虛擬化服務(wù)器。
從應(yīng)用程序和VPS用戶的角度來(lái)看,每個(gè)VPS是完全獨(dú)立的系統(tǒng),這種獨(dú)立性由位于系統(tǒng)內(nèi)核之上的虛擬化層來(lái)提供。注意僅有極小的CPU資源消耗在虛擬化過(guò)程中(大約1-2%)。OpenVZ虛擬化層實(shí)現(xiàn)的主要特性包括:
◆VPS看起來(lái)像一套普通的Linux系統(tǒng)。它具有標(biāo)準(zhǔn)的啟動(dòng)腳本、軟件廠商提供的科可以運(yùn)行在VPS內(nèi)部的軟件而無(wú)需為OpenVZ做特別的修改或調(diào)整;
◆用戶可以修改任何配置文件和安裝其他軟件;
◆VPS相互之間完全隔離(包括文件系統(tǒng),進(jìn)程,內(nèi)部進(jìn)程通訊(IPC),sysct1變量);
◆VPS不會(huì)綁定在一個(gè)CPU上,可以使用所有的CPU資源。屬于某個(gè)VPS的進(jìn)程可以運(yùn)行在所有可獲得的CPU之上。
【自述】
HyperVM可以提供方便易用的管理,是管理更多的VPS或者虛擬機(jī)客戶變得輕松,具體選項(xiàng)–virtualization-type供選擇的參數(shù)有三個(gè):xen/openvz/NONE,分別對(duì)應(yīng)部署xen環(huán)境、部署openvz環(huán)境和不用部署虛擬機(jī)環(huán)境,若在已經(jīng)部署好虛擬機(jī)環(huán)境的服務(wù)器上安裝,則應(yīng)使用NONE模式。
【準(zhǔn)備工作】
需要一臺(tái)差不多的服務(wù)器,不然速度很慢,我使用的是國(guó)外的
Dual Xeon 2.8GHZ Dedicated Server
速度還算可以,尤其是下載HyperVM安裝包里面的東西很快,國(guó)內(nèi)的可能很慢,因?yàn)樵丛趪?guó)外。
其次先安裝好OpenVZ環(huán)境,如果不知道怎么安裝可以搜索下,
下來(lái)說(shuō)說(shuō),HyperVM安裝:
——————————————————————————————————
先關(guān)閉掉 SELinux. Open /etc/sysconfig/selinux…
vi /etc/sysconfig/selinux
SELINUX to disabled
如果你的一樣就不要修改了
————————————
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing – SELinux security policy is enforced.
# permissive – SELinux prints warnings instead of enforcing.
# disabled – SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted – Only targeted network daemons are protected.
# strict – Full SELinux protection.
SELINUXTYPE=targeted
——————————————————————
接下來(lái)運(yùn)行:
_____
setenforce 0
______________
再下來(lái)檢查下
vi /etc/sysctl.conf是不是基本一樣:
引用
net.ipv4.ip_forward = 1
net.ipv4.conf.default.proxy_arp = 0
net.ipv4.conf.all.rp_filter = 1
kernel.sysrq = 1
net.ipv4.conf.default.send_redirects = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.default.forwarding=1
不一樣的話修改后運(yùn)行
sysctl -p (使sysctl.conf生效)
————————————————————————————————
然后,修改/boot/grub/menu.lst,設(shè)置為從OpenVZ的核心啟動(dòng)。
具體可能跟這個(gè)不一樣,自行修改
[root@bogon ~]# cat /boot/grub/menu.lst
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS OpenVZ (2.6.18-92.1.13.el5.028stab059.6)
root (hd0,0)
kernel /vmlinuz-2.6.18-92.1.13.el5.028stab059.6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-92.1.13.el5.028stab059.6.img
title CentOS (2.6.18-53.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-53.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-53.el5.img
重啟服務(wù)器后,查看vz服務(wù)是否正常即可。
——————————————————
接下來(lái)HyperVM安裝:
【注意引用內(nèi)容】
1、mysql的問(wèn)題
HyperVM在安裝時(shí),需要在mysql中創(chuàng)建庫(kù)和導(dǎo)入數(shù)據(jù),所以,mysql應(yīng)為默認(rèn)安裝,不要設(shè)置任何密碼,否則請(qǐng)先刪除后重裝mysql:
# rm -rf /var/lib/mysql
# rpm -e mysql-server
# rm /var/log/mysqld.log.rpmsave
# yum install mysql-server
※ 注意,若您的服務(wù)器上已有mysql的數(shù)據(jù),請(qǐng)注意備份。或參考網(wǎng)上的資料,清空mysql的管理員密碼。
本次例子未執(zhí)行這部,一般情況下服務(wù)器已經(jīng)安裝。
————————————————————————————————
2.開(kāi)始安裝:
在系統(tǒng)下執(zhí)行
# wget http://download.lxlabs.com/download/hypervm/production/hypervm-install-master.sh
# sh ./hypervm-install-master.sh –virtualization-type=openvz(可選項(xiàng))
安裝完成后會(huì)顯示:
FINISHED –21:25:15–
Downloaded: 6 files, 601M in 1m 13s (8.29 MB/s)
Executing Update Cleanup… Will take a long time to finish….
Congratuations. hyperVM has been installed succesfully on your server as master
You can connect to the server at https://:8887 or http://:8888
Please note that first is secure ssl connection, while the second is normal one.
The login and password are ‘a(chǎn)dmin’ ‘a(chǎn)dmin’. After Logging in, you will have to change your password to something more secure
Thanks for choosing hyperVM to manage your Server, and allowing us to be of service
***There is one more step you have to do to make this complete. Open /etc/grub.conf, and change the ‘default=1′ line to ‘default=0′, and reboot this machine. You will be rebooted into the openvz kernel and will able to manage vpses from the hyperVM interface
接下來(lái)啟動(dòng)hypervm服務(wù),不然不能打開(kāi)后臺(tái)!
[root@po ~]# service hypervm start
/usr/local/lxlabs/hypervm/httpdocs
Starting hypervm: cat: /usr/local/lxlabs/hypervm//pid/wrapper.pid: No such file or directory
mysqld (pid 6582) is running…
Started hypervm
這樣hypervm就完成安裝,可以用
https://ip地址:8887
http://ip地址:8888
登陸管理了。
————————————————————————————————
?
hypervm示例教程引用參考的源:
B.百度百科
本文來(lái)自: 教程:在OpenVZ虛擬環(huán)境下安裝管理軟件HyperVM,切割VPS服務(wù)
>>轉(zhuǎn)載請(qǐng)注明出處:VPS偵探 本文鏈接地址:http://www.0794baidu.com/vps-cp/openvz-hypervm-vps.html









