In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, the editor will share with you the relevant knowledge points about how to install and configure OpenNebula under CentOS. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
OpenNebula is an open source toolkit for cloud computing. It allows you to build and manage private clouds with Xen, KVM or VMware or ESX. It also provides Deltacloud adapters and Amazon EC2 to manage hybrid clouds.
The following installation process is completed on VPSee's two servers with CentOS 5.5. one server is used as an OpenNubula front end (node00) and the other is used as a node (node01) to build a minimum "cloud". If you want to expand this cloud, you only need to gradually increase the number of nodes (node02, node03,... (it will be fine.
Add CentOS Karan feeds:
# cd / etc/yum.repos.d# wget http://centos.karan.org/kbsingh-CentOS-Extras.repo# yum update
Install the software packages required by OpenNebula and the tools required to compile the OpenNebula source code:
# yum install gcc gcc-c++ make openssl-devel flex bison# yum install ruby ruby-devel ruby-docs ruby-ri ruby-irb ruby-rdoc# yum install rubygems# gem install nokogiri rake xmlparser# yum install scons# yum install xmlrpc-c xmlrpc-c-devel
The version of sqlite that comes with CentOS is not good. You need to download and compile version 3.6.17 of sqlite:
# wget http://www.sqlite.org/sqlite-amalgamation-3.6.17.tar.gz# tar xvzf sqlite-amalgamation-3.6.17.tar.gz# cd sqlite-3.6.17/#. / configure; make; make install
After downloading and compiling the opennebula 2.0.1 source package, extract, compile and install:
# tar zxvf opennebula-2.0.1.tar.gz# cd opennebula-2.0.1# scons#. / install.sh-d / srv/cloud/one# ls / srv/cloud/one/bin etc include lib share var
Before starting OpenNebula, you need to configure the ONE_AUTH environment variable, which is read from the $HOME/.one/one_auth file, so create the one_auth file before starting one (OpenNebula service program):
# cd / root/# mkdir .one # cd .one / # echo "oneadmin:password" > one_auth# one start
OpenNebula supports three virtual technologies: KVM, Xen and VMware. We also need to tell OpenNebula which one we want to use, and restart one for the configuration to take effect:
# vi / etc/one/oned.conf...IM_MAD = [name = "im_xen", executable = "one_im_ssh", arguments = "xen"] VM_MAD = [name = "vmm_xen", executable = "one_vmm_ssh", arguments = "xen", default = "vmm_ssh/vmm_ssh_xen.conf", type = "xen"]. # one stop# one start
Install and configure nodes (Compute Node)
A virtual environment for Xen or KVM needs to be installed on each node. For more information, please refer to: install and configure Xen on CentOS and install and configure KVM on CentOS, as well as the ruby runtime environment:
# yum install ruby Exchange ssh Key because the communication between OpenNebula Front and Nodes is through SSH, so the setting between front and nodes should be set to SSH login without password to avoid entering password when front runs scripts on node or clone images. First configure sshd:# vi / etc/ssh/sshd_configRSAAuthentication yesPubkeyAuthentication yes# / etc/init.d/sshd restart on front and nodes to create key on front (node00) and copy it to node (node01): # ssh-keygen-t rsa# ssh-copy-id-I ~ / .ssh/id_rsa.pub node01 create key on 1 node (node01) and copy to front (node00): # ssh-keygen-t rsa# ssh-copy-id-I ~ / .ssh/ After id_rsa.pub node00onehostfront communicates with every node without a password, ssh You can use the onehost create command on front to join node one by one, and use onehost list to see if it has been created successfully: # onehost create node01 im_xen vmm_xen tm_ssh# onehost listID NAME CLUSTER RVM TCPU FCPU ACPU TMEM FMEM stat1 node01 default 0400 400 3.8G 383M on
If you execute onehost create, check the oned.log log and find the words sudo: sorry, you must have a tty to run sudo. The reason is that OpenNebula requires remote ssh/sudo to execute commands, while CentOS's sudo option requiretty is turned on by default, and ssh requires a tty to execute, so remote sudo will make an error:
# onehost create node01 im_xen vmm_xen tm_ssh# tail / var/log/one/oned.logTue Feb 22 11:08:58 2011 [InM] [I]: command execution fail:'if [- x "/ var/tmp/one/im/run_probes"]; then / var/tmp/one/im/run_probes xen 172.16.39.111; else exit 42 Fi'Tue Feb 22 11:08:58 2011 [InM] [I]: STDERR follows.Tue Feb 22 11:08:58 2011 [InM] [I]: sudo: sorry, you must have a tty to run sudoTue Feb 22 11:08:58 2011 [InM] [I]: Error executing xen.rb...
The solution is to close (comment out) the line requiretty:
# chmod 600 / etc/sudoers# vi / etc/sudoers#Defaults requiretty
Because the two servers of VPSee use HTTP proxy to access the Internet, OpenNebula reads the http_proxy environment variables of the system and finds a HTTP response error in the sched.log log, so you need to turn off http_proxy:
# cat / var/log/one/sched.logTue Feb 22 14:27:39 2011 [host] [E]: Exception raised: Unable to transport XML to server and get XML response back. HTTP response: 504Tue Feb 22 14:27:39 2011 [POOL] [E]: Could not retrieve pool info from ONE# unset http_proxyonevnet create and edit virtual network profile Then create an OpenNebula virtual network: # vi small_network.netNAME = "Small network" TYPE = FIXEDBRIDGE = br0LEASES = [ip= "192.168.0.5"] LEASES = [IP= "192.168.0.6"] LEASES = [IP= "192.168.0.7"] # onevnet create small_network.net# onevnet listID USER NAME TYPE BRIDGE P # LEASES0 oneadmin Small network Fixed br0 N 0onevm
Create and edit the startup configuration file of the virtual machine, where the centos.5.5.x86.img can be downloaded from http://stacklet.com/ (for a fee) or created by yourself using the Xen tool:
# wget http://stacklet.com/sites/default/files/centos/centos.5.5.x86.img.tar.bz2# tar jxvf centos.5.5.x86.img.tar.bz2# mv centos.5.5.x86.img / srv/cloud/one/var/images/# vi centos.oneNAME = centosCPU = 1MEMORY = 256DISK = [source = "/ srv/cloud/one/var/images/centos.5.5.x86.img", target = "sda1", clone = "yes" Readonly = "no"] NIC = [MAC = "00:16:3E:00:02:64", bridge = xenbr0] OS = [bootloader = "/ usr/bin/pygrub"] start the above VM configuration file with the onevm create command A virtual machine will be created on the node01. If you view it with onevm list, you will see the prol status, indicating that it is in the process of creation. After creation, the status will change to runn:# onevm create centos.one# onevm listID USER NAME STAT CPU MEM hostname time1 oneadmin centos prol 00K node01 00 0000 node01 09purl 09v onevm listID USER NAME STAT CPU MEM HOSTNAME TIME1 oneadmin centos runn 00K node01 00 00:22:17
In this way, we deployed a smallest cloud on two servers, node00 (front) and node01 (node), and ran a Xen-based virtual machine instance on node01.
These are all the contents of the article "how to install and configure OpenNebula under CentOS". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.