centos6快速安装opennebula 3.8.1 4.2.0

原创
2016-06-07 15:38:13 934浏览

方式一 centos 版本 6.4,在centos库中已经提供了一个打包好的opennebula,目前版本是3.8.1 1.安装 CentOS-testing repository # cd /etc/yum.repos.d# curl -O http://dev.centos.org/centos/6/opennebula/opennebula-testing.repo # yum repolist 2.安装ope

方式一

centos 版本 6.4,在centos库中已经提供了一个打包好的opennebula,目前版本是3.8.1

1.安装 CentOS-testing repository

# cd /etc/yum.repos.d
# curl -O http://dev.centos.org/centos/6/opennebula/opennebula-testing.repo
# yum repolist

2.安装opennebula包

前置机安装:opennebula-server opennebula-sunstone

节点安装:opennebula-node-kvm

我这里用了一台机器,既当前置机又做工作节点

yum install opennebula-server opennebula-sunstone opennebula-node-kvm

3.设置网络

$brctl show

bridge name bridge id STPenabled interfaces

br0 8000.000000000000 no eth0

参考:http://opennebula.org/documentation:rel4.2:plan#networking

网桥设置参考:http://wiki.dzsc.com/info/8659.html http://hi.baidu.com/renchunyun/item/cc0dbb1d8799e9797b5f25c6

centos 6.4网桥设置失败报错如下:
原网卡eth0: Connection activation failed: Master connection not found or invalid
bridge网卡br0:Conncetion activation failed: Failed to determine connection’s virtual interface name

原因是NetworkManager接管网络造成的, 解决办法:

chkconfig NetworkManager off
chkconfig –levels 35 network on
/etc/init.d/NetworkManager stop
/etc/init.d/network restart

参考:http://amutu.com/blog/2013/03/centos_bridge_devic/

4.配置NFS

如果你只用一个机器当前置机和节点,则可以省去此步骤


5.配置ssh免密码登录

su - oneadmin
 ssh-keygen –t dsa  
 cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys

chmod600 ~/.ssh/authorized_keys

添加以下内容到 ~/.ssh/config

    Host *
        StrictHostKeyChecking no
        UserKnownHostsFile /dev/null

复制 ~/.ssh 到所有工作节点:(只有一台机器就省略此部)

    scp -r ~/.ssh node1:
    scp -r ~/.ssh node2:
...

用oneadmin测试ssh localhost是否成功

发现登录失败,我自己建了个用户,然后如此设置是可以登录localhost的,经过查证,原因是selinux开着的导致的,因为oneadmin的home在/var/lib/one下,没有在/home/下,因此被selinux拦截了,关闭selinux即可。这个官方文档没有说清楚,害我查了两天才弄清楚原因。

6.启动服务

    $ service opennebula start
    $service opennebula-sunstone start
    $service opennebula-occi start

7.登录系统

http://10.1.81.224:9869/
cat /var/lib/one/.one/one_auth 看下登录名和密码


添加主机

 $ onehost create localhost -i im_kvm -v vmm_kvm -n dummy


如果失败,则查看日志/var/log/one/oned.log


如果从其他IP登录此地址,需要修改sunstone的远程登录,修改etc/one/sunstone-server.conf为

:host: 0.0.0.0

即可。

方式二

可以从官网下载rpm包来安装,这个可以装比较新的版本

1.安装epel源

# yum install wget
# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
# yum update

2.下载并安装

下载页面为:http://downloads.opennebula.org/


选择下载4.2.0 CentOS 6 tarball


tar xvf CentOS-6-opennebula-4.2.0-1.tar.gz 
cd opennebula-4.2.0-1/
  yum localinstall opennebula-common-4.2.0-1.x86_64.rpm 
  yum localinstall opennebula-ruby-4.2.0-1.x86_64.rpm 
  yum localinstall opennebula-4.2.0-1.x86_64.rpm 
  yum localinstall opennebula-sunstone-4.2.0-1.x86_64.rpm 
  yum localinstall opennebula-server-4.2.0-1.x86_64.rpm 
在计算节点上安装 kvm 和 opennebula-node-kvm:

yum install qemu-kvm qemu-kvm-tools libvirt
yum localinstall opennebula-node-kvm-4.2.0-1.x86_64.rpm 

开启服务:

/etc/init.d/libvirtd start
  206  service opennebula start
  207  chkconfig opennebula on
  208  service opennebula-sunstone start
  209  chkconfig opennebula-sunstone on
打开浏览器,访问 http://10.1.81.224:9869 登陆界面,那登陆的用户名和密码是啥呢?用户名和密码在安装的时候已经随机生成,oneadmin 是用户名,后面的一串是密码

# cat /var/lib/one/.one/one_auth
页面效果:




其中一些细节设置,请参考方式1


参考:http://www.aikaiyuan.com/4891.html

http://www.vpsee.com/2013/05/install-opennebula-4-0-on-centos-6-4/

http://blog.chinaunix.net/uid-20940095-id-3561376.html

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。