Install and configure OpenNebula3.4 on Ubuntu12.04

Source: Internet
Author: User
1. Framework of the experiment environment: (1) Management node (opennebula node) OS: Ubuntu12.04-amd64IP

1. Framework of the experiment environment:
(1) Management node (opennebula node)
OS: Ubuntu 12.04-amd64 IP: 192.168.0.11
(2) computing nodes (VM deployment nodes)
OS: ubuntu 12.04-amd64 IP: 192.168.0.12
(3) This document also describes how to use the current node as a management node and a computing node!

2. ssh login without a password

Reference: openssh password-less access configuration between management nodes and computing nodes ssh mutual password-less login http://www.linuxidc.com/Linux/2012-06/62932.htm

3. Configure and install computing nodes (if you use the local machine, install these software on the local machine)
 
(1) Installation of virtualization-related software

  1. Sudo apt-Get install qemu-Kvm libvirt-Bin ubuntu-Vm-Builder bridge-Utils ruby
Modify/etc/libvirt/lib1_d. conf, find unix_sock_group, and change its value:

  1. Unix_sock_group= "Oneadmin"
Modify/etc/libvirt/qemu. conf and cancel the comment of the following line:
  1. Vnc_listen= "0.0.0.0"
Restart the libmongod Process
  1. Sudo service libvirt-Bin restart
Modify /Var/Run/Libvirt/Libvirt-Group of sock files
  1. Sudo chown:Oneadmin/Var/Run/Libvirt/Libvirt-Sock


    4. opennebula-3.4 installation on Management Nodes
    (1) Bridge installation and configuration
  1. Sudo apt-Get install bridge-Utils
Modify the interface file as follows:
  1. # The loopback network interface
  2. Auto lo
  3. Iface lo inet loopback
  4. # The primary network interface
  5. Auto eth0
  6. Iface eth0 inet manual
  7. Auto br0
  8. Iface br0 inet static
  9. Address 192.168.0.11
  10. Netmask 255.255.255.0
  11. Broadcast 192.168.0.254
  12. Gateway 192.168.0.1
  13. Bridge_ports eth0
  14. Bridge_fd 9
  15. Bridge_hello 2
  16. Bridge_maxage 12
  17. Bridge_stp off
Restart NIC:
  1. Sudo/Etc/Init.D/Networking restart
(2) opennebula installation and configuration

  1. Sudo mkdir-P/Var/Lib// * Create the opennebula installation directory */
  1. Sudo groupadd-G 10000 oneadmin/* Create oneadmin Group */
Create a oneadmin user.-d: Specifies the Home Directory of the user.-s: Specifies the shell used by the user after logon.-g: Specifies the group of the user.
  1. Sudo useradd-U 10000-M oneadmin-D/Var/Lib/One-S/Bin/Bash-G oneadmin
Set password for oneadmin user
  1. Sudo passwd oneadmin
Set the owner and user of the oneadmin user's home directory
  1. Sudo chown-R oneadmin:Oneadmin/Var/Lib/One
Test whether the oneadmin user can log on correctly.
  1. Su-L oneadmin
If yes, enter the exit command to exit!

The NFS server can be installed to specify the imgfile transmission mode through nfs.
  1. Sudo apt-Get install nfs-Kernel-Server
Modify the/etc/ioports file and add the following content (meaning: 192 .168 .0 .0 /Hosts within 24 can access the/var/lib/one directory according to the requirements in brackets, or *, indicating all ip addresses in this network segment ):
  1. /Var/Lib/One192.168.0.0/24(Rw,Sync,No_subtree_check,No_root_squash,Anonuid=10000,Anongid=10000)
Restart the NFS service
  1. Sudo/Etc/Init.D/Nfs-Kernel-Server start
Switch to the oneadmin user and install required software
  1. Su-L oneadmin
  2. Sudo apt-Get install libsqlite3-Dev libxmlrpc-C3-Dev g++Ruby libopenssl-Ruby libssl-Dev ruby-Dev
  3. Sudo apt-Get install libxml2-Dev libmysqlclient-Dev libmysql++-Dev libsqlite3-Ruby libexpat1-Dev
  4. Sudo apt-Get install rake rubygems libxml-Parser-Ruby1.8 lib1_t1-Dev genisoimage scons
  5. Sudo gem install nokogiri rake xmlparser
  6. Sudo apt-Get install mysql-Server
Configure the mysql database and run the following command:
  1. Mysql-U root-P
  2. CREATE USER'Oneadmin'@'Localhost'IDENTIFIED'Oneadmin';
  3. Create database opennebula;
  4. Grant all privileges on opennebula.*TO'Oneadmin'IDENTIFIED'Oneadmin';
  5. Quit;
Decompress opennebula and compile it:
  1. Cd~/Opennebula-3.1.4
  2. Scons sqlite=No mysql=Yes
Install opennebula:
  1. ./Install.Sh-U oneadmin-G oneadmin-D/Var/Lib/One
Set environment variables related to opennebula:
  1. Vim~/.Bash_profile
  2. Export ONE_LOCATION=/Var/Lib/One
  3. Export ONE_AUTH=$ONE_LOCATION/.One/One_auth
  4. Export ONE_XMLRPC=Http://192.168.0.12:2633/RPC2
  5. Export PATH=$ONE_LOCATION/Bin:/Usr/Local/Bin:/Var/Lib/Gems/1.8/Bin/:/Var/Lib/Gems/1.8/:$PATH
NOTE: If your environment is a local machine, that is, a management node and a computing node, change 192.168.0.12 to localhost.
  1. Source~/.Bash_profile
Create an opennebula user authorization file:
  1. Mkdir~/.One
  2. Echo"Oneadmin: " > ~/.One/One_auth
Modify the opennebula configuration file:
  1. /* Comment 58 rows */
  2. # DB= [Backend= "Sqlite" ]
  3. /* Modify lines 61-66 as follows */
  4. DB= [Backend= "Mysql",
  5. Server= "192.168.0.12",/* If the local computer is used as the computing node and the management node, change it to: localhost */
  6. Port=0,
  7. User= "Oneadmin",
  8. Passwd= "Oneadmin",
  9. Db_name= "Opennebula" ]
Start opennebula and test whether the installation is successful:
  1. One start
  2. Onevm list
If the following content is displayed, the installation is successful:

  1. ID USER GROUP NAMESTAT CPU MEM HOSTNAME TIME

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.