首页 > 其他 > 详细

记一次ConVirt安装错误、希望以后这样的小错误不会再犯。

时间:2014-04-19 08:50:43      阅读:1015      评论:0      收藏:0      [点我收藏+]

安装ConVirt的时候到执行下面命令的时候报错了,在网上找了半天都没有找到解决办法.....也许是用汉化版本的少吧!不过好在总算解决了,汉化版本的问题。没有用英文版,不知道英文版是不是有同样的错误!顺便记录下,留给有同样错误的朋友。。

[root@CMS ~]# ./convirt-install/install/cms/scripts/setup_convirt

Setting up ConVirt with : /usr/local/convirt/tg2env
/usr/local/convirt/tg2env/lib/python2.6/site-packages/PEAK_Rules-0.5a1.dev_r2582-py2.6.egg/peak/rules/indexing.py:220: DeprecationWarning: object.__new__() takes no parameters
/usr/local/convirt/tg2env/lib/python2.6/site-packages/ToscaWidgets-0.9.4-py2.6.egg/tw/core/view.py:202: DeprecationWarning: object.__new__() takes no parameters
  obj = object.__new__(cls, *args, **kw)
Traceback (most recent call last):
  File "/usr/local/convirt/tg2env/bin/paster", line 9, in <module>
    load_entry_point(‘PasteScript==1.7.3‘, ‘console_scripts‘, ‘paster‘)()
  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 84, in run
    invoke(command, command_name, options, args[1:])
  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 123, in invoke
    exit_code = runner.run(args)
  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 68, in run
    return super(AbstractInstallCommand, self).run(new_args)
  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/command.py", line 218, in run
    result = self.command()
  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 456, in command
    self, config_file, section, self.sysconfig_install_vars(installer))
  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/PasteScript-1.7.3-py2.6.egg/paste/script/appinstall.py", line 591, in setup_config
    mod = import_string.try_import_module(mod_name)
  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/Paste-1.7.2-py2.6.egg/paste/util/import_string.py", line 81, in try_import_module
    return import_module(module_name)
  File "/usr/local/convirt/tg2env/lib/python2.6/site-packages/Paste-1.7.2-py2.6.egg/paste/util/import_string.py", line 67, in import_module
    mod = __import__(s)
  File "/usr/local/convirt/src/convirt/web/convirt/convirt/websetup.py", line 124
SyntaxError: Non-ASCII character ‘\xe6‘ in file /usr/local/convirt/src/convirt/web/convirt/convirt/websetup.py on line 124, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
Error setting up ConVirt. 
ERROR: running convirt-ctl setup.
ERROR: Failed setting up convirt package.

——解决办法:

1)编辑convirt的解压目录的websetup.py文件,我的convirt的解压目录是在/usr/local目录下

将# -*- coding: utf-8 -*-这一行放到第一行,保存/退出。如下:

[root@CMS ~]# vi /usr/local/convirt/src/convirt/web/convirt/convirt/websetup.py

# -*- coding: utf-8 -*-
#   ConVirt   -  Copyright (c) 2009 Convirture Corp.
#   ======
#
# ConVirt is a Virtualization management tool with a graphical user
# interface that allows for performing the standard set of VM operations
# (start, stop, pause, kill, shutdown, reboot, snapshot, etc...). It
# also attempts to simplify various aspects of VM lifecycle management.
#
#
# This software is subject to the GNU General Public License, Version 2 (GPLv2)
# and for details, please consult it at
#
#    http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
#
#
# author : ConVirt Team
#
"""Setup the convirt application"""

2)重新执行命令 [不知道跳过此命令,直接执行下面个命令的话是否会成功,没有测试。]

[root@CMS ~]# ./convirt-install/install/cms/scripts/setup_tg2

install common functions sourced.
DISTRO RedHat
VER 6.5
CODENAME Final
KERNEL 2.6.32-431.el6.x86_64
ARCH x86_64
Info: Sourcing /root/convirt-install/install/cms/scripts/../../../common/scripts/RedHat_functions
Info: Sourcing /root/convirt-install/install/cms/scripts/../common/RedHat_functions
New python executable in /usr/local/convirt/tg2env/bin/python
Installing setuptools, pip...done.
Searching for extremes
Best match: Extremes 1.1.1
Processing Extremes-1.1.1-py2.6.egg
Extremes 1.1.1 is already the active version in easy-install.pth

Using /usr/local/convirt/tg2env/lib/python2.6/site-packages/Extremes-1.1.1-py2.6.egg
Processing dependencies for extremes
Finished processing dependencies for extremes
Searching for mysql-python
Best match: MySQL-python 1.2.5
Processing MySQL_python-1.2.5-py2.6-linux-x86_64.egg
MySQL-python 1.2.5 is already the active version in easy-install.pth

Using /usr/local/convirt/tg2env/lib/python2.6/site-packages/MySQL_python-1.2.5-py2.6-linux-x86_64.egg
Processing dependencies for mysql-python
Finished processing dependencies for mysql-python
Searching for tg.devtools
Best match: tg.devtools 2.0.2
Processing tg.devtools-2.0.2-py2.6.egg
tg.devtools 2.0.2 is already the active version in easy-install.pth

Using /usr/local/convirt/tg2env/lib/python2.6/site-packages/tg.devtools-2.0.2-py2.6.egg
Processing dependencies for tg.devtools
Finished processing dependencies for tg.devtools
No need to fix xen in tg2env.
Searching for Beaker>=1.4
Best match: Beaker 1.6.4
Processing Beaker-1.6.4-py2.6.egg
Beaker 1.6.4 is already the active version in easy-install.pth

Using /usr/local/convirt/tg2env/lib/python2.6/site-packages/Beaker-1.6.4-py2.6.egg
Processing dependencies for Beaker>=1.4
Finished processing dependencies for Beaker>=1.4
Fixing /usr/local/convirt/tg2env/lib/python2.4/site-packages/Beaker-*py2.4.egg/beaker/ext/google.py for __future__ import problem.
TurboGears environmnet setup successfully.

显示成功。可以执行下一步了......

[root@CMS ~]# ./convirt-install/install/cms/scripts/setup_convirt 
install common functions sourced.
DISTRO RedHat
VER 6.5
CODENAME Final
KERNEL 2.6.32-431.el6.x86_64
ARCH x86_64
Info: Sourcing /root/convirt-install/install/cms/scripts/../../../common/scripts/RedHat_functions
Info: Sourcing /root/convirt-install/install/cms/scripts/../common/RedHat_functions
running develop
Not found: tg.devtools
running egg_info

......

......

......

......

ConVirt Setup Done...
Generting ssh identity for CMS.
Generating public/private rsa key pair.
Created directory ‘/root/.ssh‘.
Enter passphrase (empty for no passphrase):  [ssh密码可以为空]
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/cms_id_rsa.
Your public key has been saved in /root/.ssh/cms_id_rsa.pub.
The key fingerprint is:
30:70:e1:f0:8c:08:71:0b:68:03:f5:b9:cd:8a:86:02 root@CMS
The key‘s randomart image is:
+--[ RSA 2048]----+
|Boo o o.         |
|.* + X           |
|. + + *          |
|     + o         |
|E   . o S        |
|.. . .           |
|o o .            |
|..               |
|                 |
+-----------------+

     ConVirt Management Server (CMS) setup complete.

     To start CMS, give the following commands.

       cd /usr/local/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://CMS:8081/

——这里又碰到一个挺郁闷的小问题,如果要启动convirt-ctl的必须进入安装目录才能启动,不然会报错、不知道是不是人品问题......

两个情况启动,如下:

 1)直接使用路径启动

[root@CMS ~]# /usr/local/convirt/convirt-ctl start
Trying to source /usr/local/convirt/tg2env/bin/activate
virtualenv set to /usr/local/convirt/tg2env


Using  /root/.ssh/cms_id_rsa
Agent pid 3689
Identity added: /root/.ssh/cms_id_rsa (/root/.ssh/cms_id_rsa)
ssh key added to agent.
Starting ConVirt using virtualenv : /usr/local/convirt/tg2env
Default character encoding is utf-8
Entering daemon mode
Failed to start ConVirt. Please see paster.log for details.

2)进入安装目录启动

[root@CMS ~]# cd /usr/local/convirt/
[root@CMS convirt]# ./convirt-ctl start
Trying to source ./tg2env/bin/activate
virtualenv set to /usr/local/convirt/tg2env


Using  /root/.ssh/cms_id_rsa
Agent pid 3720
Identity added: /root/.ssh/cms_id_rsa (/root/.ssh/cms_id_rsa)
ssh key added to agent.
Starting ConVirt using virtualenv : /usr/local/convirt/tg2env
Default character encoding is utf-8
Entering daemon mode
Server running in PID 3730
ConVirt Started.

本文出自 “ˉ、穎濤┃﹎” 博客,请务必保留此出处http://hypocritical.blog.51cto.com/3388028/1398056

记一次ConVirt安装错误、希望以后这样的小错误不会再犯。,布布扣,bubuko.com

记一次ConVirt安装错误、希望以后这样的小错误不会再犯。

原文:http://hypocritical.blog.51cto.com/3388028/1398056

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!