總網頁瀏覽量

搜尋此網誌

2011年5月25日 星期三

NovaInstall for Single Machine Installation Record

Step 1: Install required prerequisites
sudo apt-get install -y rabbitmq-server
##Starting rabbitmq-server: SUCCESS
Step 2: Install Nova packages
sudo apt-get install -y python-software-properties
##Setting up python-software-properties (0.80.9) ...
sudo add-apt-repository ppa:nova-core/trunk
 ###
gpg: requesting key 2A2356C9 from hkp server keyserver.ubuntu.com
gpg: key 2A2356C9: public key "Launchpad Nova Packages" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1) 
sudo apt-get update
 ###Reading package lists... Done
sudo apt-get install -y python-nova
###Processing triggers for python-support ...
sudo apt-get install -y nova-common nova-doc nova-api nova-network 
 ####
nova-network is already the newest version.
nova-doc is already the newest version.
nova-common is already the newest version.
nova-api is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded
sudo apt-get install -y nova-objectstore nova-scheduler nova-compute
 ###
nova-scheduler is already the newest version.
nova-objectstore is already the newest version.
nova-compute is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
sudo apt-get install -y euca2ools
###euca2ools is already the newest version.
sudo apt-get install -y unzip
###unzip is already the newest version.


Step 3:setting up the SQL Database (MySQL) on the Cloud Controller
bash
MYSQL_PASS=nova
NOVA_PASS=notnova
bash
MYSQL_PASS=nova
NOVA_PASS=notnova
cat >> MYSQL_PRESEED | debconf-set-selections
mysql-server-5.1 mysql-server/root_password password $MYSQL_PASS
mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS
mysql-server-5.1 mysql-server/start_on_boot boolean true
MYSQL_PRESEED
mysql_preseed $mysql_pass="" boolean="" debconf-set-selections="" mysql-server-5.1="" mysql-server="" mysql_preseed<="" password="" pre="" root_password="" root_password_again="" start_on_boot="" true="" |="">









/usr/bin/nova-manage db sync
/usr/bin/nova-manage user admin dub
###export EC2_ACCESS_KEY=afe710a5-bbc8-45ad-ba69-38db885d3542
###export EC2_SECRET_KEY=54eeb1b8-2b00-4bb8-9092-5e32022be640
/usr/bin/nova-manage project create dubproject dub
/usr/bin/nova-manage network create 192.168.0.0/24 1 256 

sudo apt-get install -y mysql-server
---設mysql root 密碼
sudo sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
sudo service mysql restart
### 
mysql start/running, process 1819
sudo mysql -uroot -p$MYSQL_PASS -e 'CREATE DATABASE nova;'
sudo mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO 'nova'@'%' WITH GRANT OPTION;"
sudo mysql -uroot -p$MYSQL_PASS -e "SET PASSWORD FOR 'nova'@'%' = PASSWORD('$NOVA_PASS');"

Step 4:Installing the Compute Node
nano /etc/network/interfaces

auto lo
iface lo inet loopback
auto br100
iface br100 inet static
bridge_ports eth0
bridge_stp off
bridge_maxwait 0
bridge_fd 0
address 192.168.104.11
netmask 255.255.255.0
network 192.168.104.0
gateway 192.168.104.254
broadcast 192.168.104.255
dns-nameservers 8.8.4.4

sudo /etc/init.d/networking restart
restart libvirt-bin; restart nova-network; restart nova-compute;

libvirt-bin start/running, process 1994
nova-network start/running, process 2012
nova-compute start/running, process 2025
restart nova-api; restart nova-objectstore; restart nova-scheduler

nova-api start/running, process 2113
nova-objectstore start/running, process 2121
nova-scheduler start/running, process 2135
 Step6 Creating Certifications
mkdir –p /root/creds
/usr/bin/python /usr/bin/nova-manage project zipfile $NOVA_PROJECT $NOVA_PROJECT_USER /root/creds/novacreds.zip
unzip /root/creds/novacreds.zip -d /root/creds/
Archive:  /root/creds/novacreds.zip
 extracting: /root/creds/novarc
 extracting: /root/creds/pk.pem
 extracting: /root/creds/cert.pem
 extracting: /root/creds/cacert.pem
cat /root/creds/novarc >> ~/.bashrc
source ~/.bashrc
source /root/creds/novarc
sudo reboot

Enabling Access to VMs on the Compute Node

euca-authorize -P icmp -t -1:-1 default----錯誤[Errno 111] Connection refused
-rw-r----- 1 root nova 461 2011-05-25 22:03 nova.conf (nova.conf 為root所有) ---改
-rw-r----- 1 nova nova 461 2011-05-25 22:03 nova.conf (nova.conf 為nova所有)
正確
euca-authorize -P icmp -t -1:-1 default
default None None icmp -1 -1 0.0.0.0/0
GROUP   default
PERMISSION      default ALLOWS  icmp    -1      -1      FROM    CIDR    0.0.0.0/0
euca-authorize -P tcp -p 22 default
default None None tcp 22 22 0.0.0.0/0
GROUP   default
PERMISSION      default ALLOWS  tcp     22      22      FROM    CIDR    0.0.0.0/0
Configuring Multiple Compute Nodes

restart libvirt-bin; service nova-compute restart

libvirt-bin start/running, process 1703
nova-compute start/running, process 1725

chgrp kvm /dev/kvm
chmod g+rwx /dev/kvm
iptables -t nat -A PREROUTING -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j DNAT --to-destination 192.168.104.13:8773
mysql -uroot -pnova nova -e 'select * from services;'

沒有留言:

張貼留言