總網頁瀏覽量

搜尋此網誌

2011年4月4日 星期一

Open Stack Nova Single Machine Installation

System :Ubuntu 10.04 64Bit Desktop   IP:192.168.104.3

Step 1:安裝所需的先決條件 & Nova packages available in Maverick Meerkat
Nova需要RabbitMQ的消息傳遞因此我們將先安裝。確保您的主機名指向你的IP地址在/etc/ hosts中,否則 RabbitMQ的服務器將無法啟動沒有任何錯誤信息。

sudo apt-get install rabbitmq-serve  

你會看到消息開始用“Reading package lists... Done”,你必須鍵入 y確認要繼續。

sudo apt-get install python-software-properties sudo add-apt-repository ppa:nova-core/trunk 
注意:如果sudo add-apt-repository ppa:nova-core/trunk不行,更換sudo add-apt-repository ppa:nova-core/release
sudo apt-get update
然後安裝 Nova和相關依賴關係包

sudo apt-get install python-nova
sudo apt-get install nova-common nova-doc nova-api nova-network nova-objectstore nova-scheduler nova-compute euca2ools unzip
你會看到消息開始用“Reading package lists... Done”,你必須鍵入 y確認要繼續。此操作可能需要一段時間因為許多相關的軟件包將被安裝。

Step 2: Set up configuration file (installed in /etc/nova)
sudo gedit  /etc/nova/nova.conf
内容如下:
------------------------------
--daemonize=1
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--loggdir=/var/log/nova
--state_path=/var/lib/nova
--verbose
--sql_connection=mysql://root:nova@192.168.104.3/nova
###SQL數據庫的位置
--s3_host=192.168.104.3 ###這是Nova承載 objectstore服務,其中將包含VM images and buckets
--rabbit_host=192.168.104.3 ###這是rabbit AMQP messaging service
--ec2_host=192.168.104.3    ###這是nova-api service lives
--verbose                              ###Optional but very helpful during initial setup
--ec2_url=http://192.168.104.3:8773/services/Cloud ###nova-api 主機URL位址
--network_manager=nova.network.manager.VlanManager ### 控制型態分類如下
This is how your controller will communicate with additional Nova nodes and VMs: nova.network.manager.FlatManager # Simple, no-vlan networking type nova.network.manager. FlatDHCPManager # Flat networking with DHCP nova.network.manager.VlanManager # Vlan networking with DHCP –/DEFAULT/ if no network manager is defined in nova.conf
--fixed_range=192.168.104.0/24 ###這將是IPrange項目,未來將駐留在虛擬機的guest IP範圍。
--network_size=128 ### IP Addres 總數量使用虛擬機guests
-------------------------------
注意請依照自己環境設定
創造一個 “nova” group, 並set 權限:
sudo addgroup nova
sudo chown -R root:nova /etc/nova
sudo chmod 644 /etc/nova/nova.conf

Step 3 - 安裝 SQL DB (MySQL for this setup)

1-繞過all setup提示加快速度
sudo bash
MYSQL_PASS=nova
cat <
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
2-安装mysql

sudo apt-get install -y mysql-server
3- 編輯/etc/mysql/my.cnf,bind-address
sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf ###sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf表示全面用127.0.0.1取代0.0.0.0
service mysql restart
4-mysql配置

mysql -uroot -p$MYSQL_PASS -e 'CREATE DATABASE nova;'
mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;"
设置root用户密码
mysql -uroot -p$MYSQL_PASS -e "SET PASSWORD FOR 'root'@'%' = PASSWORD('$MYSQL_PASS');"
###mysql的root用户初始password是空的設置時,最好設定一組Password給$MYSQL_PASS
----Compute Node Installation---
重複Step 1和Step2,然後配置你的網絡計算實例的計算節點,複製 nova.conf文件從雲控制器節點到該節點中。 
----Compute Node Installation---

Step 4 Network Configuration

如果您使用FlatManager作為網絡管理器(而不是VlanManager即顯示在nova.conf上面的例子),有一些額外的網絡改變你就得 做,以確保您的節點和虛擬機之間的連通性。如果您選擇 VlanManager或FlatDHCP,可以跳過這一節,因為它會自動為您設置。
< begin /etc/network/interfaces > ---VlanManager或FlatDHCP 設定
# The loopback network interface
auto lo
iface lo inet loopback

# Networking for NOVA
auto br100

iface br100 inet dhcp
       bridge_ports    eth0
       bridge_stp      off
       bridge_maxwait  0
       bridge_fd       0
< end /etc/network/interfaces >
sudo /etc/init.d/networking restart
< begin /etc/network/interfaces > 
auto lo
iface lo inet loopback

# Networking for NOVA
auto br100
iface br100 inet static
    address 192.168.104.3
    netmask 255.255.255.0
    network 192.168.104.0
    broadcast 0.0.0.255
    gateway 192.168.104.1
    bridge_ports eth0
    bridge_stp   off
    bridge_maxwait 0
    bridge_fd      0
    dns-nameservers "DNS IP"< end /etc/network/interfaces >
sudo /etc/init.d/networking restart
 

2 則留言:

  1. did you try to separate each components in to different box ?

    回覆刪除
  2. don't try separate each components in to different box
    you can try it
    http://www.youtube.com/watch?v=Ws_bscLz-RM&feature=player_embedded

    回覆刪除