convirt官网安装方法http://www.convirture.com/wiki/index.php?title=Convirt2_Installation#Firewall_setup_for_VNC

         convirt工作原理:

OSS Deployment.jpg


Server端:

     1.yum源更新  

 cd /etc/yum.repos.d
wget --no-cache http://www.convirture.com/repos/definitions/rhel/6.x/convirt.repo

     2.socat安装

    yum install socat

     3.软件下载

 wget --no-cache http://www.convirture.com/downloads/convirt/2.5/convirt-install-2.5.tar.gz 
wget --no-cache http://www.convirture.com/downloads/convirt/2.5/convirt-2.5.tar.gz
wget --no-cache http://www.convirture.com/downloads/convirture-tools/2.5/convirture-tools-2.5.tar.gz
 4.软件安装
 (1)tar -xzf convirt-install-2.5.tar.gz
 cd convirt-install/install/cms/scripts/
 (2)sudo ./install_dependencies
 此时会检测mysql等相关依赖的东西,不要在安装有mysql的机器上安装server。同时,会提示输入
 mysql的密码。
 (3)主要安装配置convirt-install/install/cms/scripts/install_config,修改安装
  路径,和软件包的版本号。
    CONVIRT_BASE=/usr/local(默认安装是~,最后不需要重复加 /)
    CONVIRT_DIR=$CONVIRT_BASE/convirt
    VIRTUAL_ENV_NAME=tg2env
    VIRTUAL_ENV_DIR=$CONVIRT_DIR/$VIRTUAL_ENV_NAME

    if [ "$SERVER" == "" ]; then
      SERVER=www.convirture.com
    fi
    # convirt urls
    CONVIRT_TARBALL=convirt-2.5.tar.gz(按照版本修改,否则可能会报错)
    CONVIRT_DOWNLOAD_URL=
http://${SERVER}/downloads/convirt/2.5/$CONVIRT_TARBALL
  (4)source  install_config
  (5)解压convirt包到安装目录:tar -xzf ./convirt-2.5.tar.gz -C $CONVIRT_BASE
  (6)安装 TurboGears./convirt-install/install/cms/scripts/setup_tg2
      在此阶段会报错,没有安装成功。因为需要在网络下载相应的包,可能会报错,因此多次执行此脚本
      即可解决这个问题。
  (7)修改src/convirt/web/convirt/development.ini 其中的mysql配置选项。
   sqlalchemy.url=mysql://root:PASSWORD@localhost:3306/convirt?charset=utf8
     密码为第二步的时候输入密码。
  (8)./convirt-install/install/cms/scripts/setup_convirt(提示输入密码/密码为SSH服务器身份的CMS。
  在setup_convirt过程中,会配置SSH密钥。正常配置即可,输入的密码在启动服务时需要输入。)
  (9)启动server端:
      前面创建的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.
     cd ~/convirt  
                ./convirt-ctl start
               
此时,server安装完成,localhost:8081访问即可,用户密码:admin,admin

添加server的时候提示HostKeys object has no attribute has_key  解决方法

vim /data/convirt/src/convirt/core/utils/phelper.py  #修改两个地方然后重启
@classmethod
   def validate_host_key(cls, transport, hostname):
       """
       get the remote hosts key and validate against known host keys
       throws exception with errno, reason
       errno - reason
       1  - Host not found
       2. - Host found but key not found
       3  - Authentication failed (wrong password?)
       4  - Host found, key found, but keys do not match
            (server changed/spoofed)
       """
       # check server's host key -- this is important.
       key = transport.get_remote_server_key()
       if not PHelper.host_keys.get(hostname):
           print "Warning : Host not found ! ", hostname
           #raise HostValidationException(1, "Host not found")
       elif not PHelper.host_keys[hostname].get(key.get_name()):
           print "Warning: Key not found ! ", hostname
           #raise HostValidationException(2, "Key not found.")
       elif PHelper.host_keys[hostname][key.get_name()] != key:
           raise HostValidationException(3, "Keys mismatch for " + hostname)
       return True

同时,连接client端必须要有server-client直接可以免密码登录