安裝配置convirture

Author: Jin
Date: 20130627
Title: 安裝配置convirture
參考: http://www.convirture.com/wiki/index.php?title=C2_fedora_installation。php

1、準備工做
一、安裝系統
CentOS release 6.3 (Final)
2.6.32-279.22.1.el6.x86_64 #1 SMP Wed Feb 6 03:10:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linuxpython

二、安裝KVM虛擬化軟件和相關套件
yum -y install qemu-kvm qemu-kvm-tools
yum -y install libvirt libvirt-client libvirt-python virt-managermysql

三、安裝socat
#cd /etc/yum.repos.d && wget --no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo
# yum makecache
# yum -y install socatweb

四、安裝mysql
1)、配置mysql
#vim /etc/my.cnf
#under [mysqld] section. Please add the following two lines
innodb_buffer_pool_size=1G
innodb_additional_mem_pool_size=20Msql

2)、Restart mysqld
#/etc/init.d/mysqld restart數據庫

五、準備convirture安裝包
若是須要設置代理才能訪問外網
export http_proxy="http://company-proxy-server:80"
Download the packages from the Convirture websitevim

# mkdir -p convirture && cd convirture wget --no-cache http://www.convirture.com/downloads/convirt/2.1.1/convirt-install-2.1.1.tar.gz
wget --no-cache http://www.convirture.com/downloads/convirt/2.1.1/convirt-2.1.1.tar.gz
wget --no-cache http://www.convirture.com/downloads/convirture-tools/2.1.1/convirture-tools-2.1.1.tar.gz服務器

2、Installing and setting up ConVirt Management Server (CMS)
一、解包安裝環境
# tar -zxf convirt-install-2.1.1.tar.gz && convirt-install/install/cms/scripts/install_dependencies
安裝有報錯
You could try using --skip-broken to work around the problem
解決辦法
yum clean all
rpm --rebuilddb
yum update
或者換一個yum源
刪掉原來的須要的包,從新安裝app

說明:
會安裝不少包 #安裝後會啓動mysql作一些數據庫設置Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.dom

You already have a root password set, so you can safely answer 'n'.
Change the root password? [Y/n] n
#沒有修改root密碼

二、Untar the CMS tarball
source convirt-install/install/cms/scripts/install_config
tar -xzf ./convirt-2.1.1.tar.gz -C $CONVIRT_BASE
echo $CONVIRT_BASE

安裝到其餘位置
By default the CMS will get installed in the home directory like ~/convirt.
If you wish it to be at any other location, please update CONVIRT_BASE varialbe in install/cms/scripts/install_config file.
默認的狀況下CMS安裝在家目錄下~/convirt,若是想安裝到其餘位置,須要修改install/cms/scripts/install_config中的CONVIRT_BASE


三、Setup TurboGears
./convirt-install/install/cms/scripts/setup_tg2
安裝目錄/src/convirt/web/convirt/development.ini
# vim ~/convirt/src/convirt/web/convirt/development.ini
sqlalchemy.url=mysql://root:convirt@localhost:3306/convirt?charset=utf8
#sqlalchemy.url=mysql://帳號:密碼@localhost:3306/庫?charset=utf8
and then execute :
./convirt-install/install/cms/scripts/setup_convirt


NOTE You would be prompted for password/passphrase for SSH identity for CMS server. You will be required to enter the password/passphrase every time you start the ConVirt Management Server (CMS). You can choose to leave it blank.注意你會被提示輸入密碼/密碼爲SSH服務器身份的CMS。你會被要求輸入 密碼/密碼每次你啓動ConVirt管理服務器(CMS)。你能夠選擇讓它空白. . 在setup_convirt過程當中,會配置SSH密鑰。正常配置便可,輸入的密碼在啓動服務時須要輸入。
ConVirt Setup Done...
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /var/lib/convirt/identity/cms_id_rsa.
Your public key has been saved in /var/lib/convirt/identity/cms_id_rsa.pub.
The key fingerprint is:
d6:1d:4f:a2:01:5d:54:76:57:2d:b1:b2:fe:cc:2b:4d root@control.skylog.com
The key's randomart image is:
+--[ RSA 2048]----+
| .. oo.+.*|
| .. ..oo|
| . + o. |
| . + B |
| S o o . |
| . . E |
| .o |
| .+. |
| .=. |
+-----------------+

ConVirt Management Server (CMS) setup complete.

To start CMS, give the following commands.

cd /root/convirt
./convirt-ctl start

By default the CMS listens on 8081 port. So make sure that your firewall
allows TCP 8081 port
Typically this can be achieved by using the following command as root user

iptables -I INPUT -p tcp --dport 8081 -j ACCEPT

Once done, you should be able to access ConVirt application using
http://control.skylog.com:8081/

3、Validating the CMS Setup
一、key
前面建立的key拷貝過來,或者從新建立一個key
cp /var/lib/convirt/identity/cms_id_rsa* /root/.ssh/
chmod 600 /root/.ssh/cms_id_rsa
chmod 644 /root/.ssh/cms_id_rsa.pub
或ssh-keygen 從新建立
若是都沒則提示
/root/.ssh/cms_id_rsa does not exist. Setting it to /root/.ssh/id_rsa.
/root/.ssh/id_rsa not found, Key based Authentication will not be used.

二、Start ConVirt Management Server
cd ~/convirt
./convirt-ctl start
PID file is /var/run/convirt/paster.pid
Trying to source /root/convirt/tg2env/bin/activate
virtualenv set to /root/convirt/tg2env
Log file: /var/log/convirt/paster.log

Using /root/.ssh/cms_id_rsa
Agent pid 29425
Enter passphrase for /root/.ssh/cms_id_rsa: #輸入設置的2次密碼
Identity added: /root/.ssh/cms_id_rsa (/root/.ssh/cms_id_rsa)
ssh key added to agent.
Starting ConVirt using virtualenv : /root/convirt/tg2env
Default character encoding is utf-8
Entering daemon mode
Server running in PID 29435
ConVirt Started.


三、添加iptables規則
iptables -I INPUT -p tcp --dport 8081 -j ACCEPT

四、訪問測試
http://172.16.9.66:8081/
帳號密碼均爲admin

4、準備要被管理的服務器
Preparing_Managed_Servers
http://www.convirture.com/wiki/index.php?title=Convirt2_Installation#Preparing_Managed_Servers
首先,每臺被管理的服務器上,要安裝Xen (3.0.4及其以上版本) 或KVM (KVM-70及其以上版本)。
其次,每臺被管理的服務器上安裝convirt-tool。
第三,每臺被管理服務器與CMS機器之間必須可以以root用戶使用密鑰進行無密碼登錄。

一、安裝被管理機軟件
1)安裝KVM虛擬化軟件和相關套件
yum -y install qemu-kvm qemu-kvm-tools
yum -y install libvirt libvirt-client libvirt-python virt-manager
2)安裝convirt-tool
mkdir -p convirture && cd convirture && wget --no-cache http://www.convirture.com/downloads/convirture-tools/2.1.1/convirture-tools-2.1.1.tar.gz
tar -zxf convirture-tools-2.1.1.tar.gz && cd convirture-tools/install/managed_server/scripts/
./convirt-tool install_dependencies
./convirt-tool setup
這個腳本還有其餘功能,能夠# convirt-tool -h查看
setup過程
# brctl show
bridge name bridge id STP enabled interfaces
br1 8000.180373af9be4 no em1
br1p1 8000.00151719b950 no p1p1
br1p2 8000.00151719b951 no p1p2
將三張網卡都bridge
防火牆增長
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpts:8002:8012

For the KVM platform, the command creates appropriate public bridges, required scripts and writes a summary of its operations to the /var/cache/convirt/server_info file.

將信息寫入 /var/cache/convirt/server_info
# cat /var/cache/convirt/server_info
DISTRO="RedHat"
CODE_NAME="Final"
VER="6.4"
KERNEL="2.6.32-358.6.1.el6.x86_64"
ARCH="x86_64"
V_PLATFORM="KVM"
V_PLATFORM_VER="qemu-kvm-0.12.1.2"
DEFAULT_BRIDGE="br1p1"

二、CMS拷貝公鑰到要管理的機器
ssh-copy-id root@192.168.1.120
key不是的名字,須要-i指定
[root@control ~]# ssh-copy-id -i /root/.ssh/cms_id_rsa.pub root@192.168.1.120
The authenticity of host '192.168.1.120 (192.168.1.120)' can't be established.
RSA key fingerprint is 13:6b:f4:c0:9a:a7:42:6b:c4:79:1c:64:28:7e:88:c3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.120' (RSA) to the list of known hosts.
root@192.168.1.120's password:
Now try logging into the machine, with "ssh 'root@192.168.1.120'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

[root@control ~]# ssh -i /root/.ssh/cms_id_rsa root@192.168.1.120
Enter passphrase for key '/root/.ssh/cms_id_rsa':
Last login: Thu Jun 27 11:36:25 2013 from 172.16.9.251

5、管理一、Adding new Managed Serverhttp://www.convirture.com/wiki/index.php?title=C2_doc_add_server二、Creating Virtual Machinehttp://www.convirture.com/wiki/index.php?title=C2_doc_create_vm三、Storage Managementhttp://www.convirture.com/wiki/index.php?title=C2_doc_storage四、Network Managementhttp://www.convirture.com/wiki/index.php?title=C2_doc_network

相關文章
相關標籤/搜索