總網頁瀏覽量

搜尋此網誌

2011年4月27日 星期三

Script Nova 安裝

cloud controller--------------------------------------------------------------------------------------------------------------------------
1.前置動作  
A.查看cpu有無支援權虛擬化
egrep -c '(vmx|svm)' /proc/cpuinfo 檢查cpu是否支援虛擬化
如果算出來的數字大於 0 的話,就表示有支援了,不過還是記得要去 BIOS 裡確認是否有 Enable CPU Virtualization 
 鳥哥 http://linux.vbird.org/linux_enterprise/xen.php--說明
 B.如果設定網路IP等...確認./etc/init.d/networking restart 執行會不會fall"
C.sudo apt-get update

設定 固定ip
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 192.168.104.30
        netmask 255.255.255.0
        broadcast 192.168.104.255
        gateway 192.168.104.1
        dns-nameservers 61.64.172.2

2. 下載 Script  
wget --no-check-certificate https://github.com/elasticdog/
OpenStack-NOVA-Installer-Script/raw/master/nova-install
3.變更權限  sudo chmod 755 nova-install
4. 執行

sudo bash nova-install -t cloud
提問
################################################################
 Nova Services Configuration
################################################################

This section includes setting the host IP addresses for the Nova Cloud
Controller, S3, RabbitMQ, and MySQL services...these are typically hosted on
the same machine.

Cloud Controller host IP address [192.168.104.15]:"enter"
S3 host IP address [192.168.104.15]:"enter"
RabbitMQ host IP address [192.168.104.15]:"enter"
MySQL host IP address [192.168.104.15]:"enter"

Database credentials
####################

Desired MySQL root password:"輸入mysql密碼"
Verify MySQL root password:"輸入mysql密碼"
 :###############################################################
################################################################
 Local Network Settings
################################################################

In order to set up the network bridge, we'll need some information on your
local network interface configuration. The settings will default to the first
known device as listed by 'ifconfig'.

Enter this machine's IP address [192.168.104.15]: 192.168.104.15
Enter this machine's broadcast address [192.168.104.255]:
Enter this machine's netmask [255.255.255.0]:
Enter this machine's gateway [192.168.104.1]: 192.168.104.254
Enter this machine's DNS nameserver address [61.64.172.2]
  Local Network Settings
################################################################

In order to set up the network bridge, we'll need some information on your
local network interface configuration. The settings will default to the first
known device as listed by 'ifconfig'.

Enter this machine's IP address [192.168.104.15]: "enter"
Enter this machine's broadcast address [192.168.104.255]:"enter"
Enter this machine's netmask [255.255.255.0]:"enter"
Enter this machine's gateway [192.168.104.1]: 192.168.104.254
Enter this machine's DNS nameserver address [61.64.172.2]:"enter"

################################################################
 Project Network Configuration
################################################################

Here you will set the network range that ALL of your projects will reside in,
and the number of IP addresses in that block that should be available for use.
After that, you'll create a project administrator and a new project.

Network range for ALL projects (normally x.x.x.x/12): 10.0.0.0/12
Total amount of usable IPs for ALL projects: 8

New project creation
####################

User name for the project administrator: dub
Name for the project: dubproject

Desired network range for the 'dubproject' project (normally x.x.x.x/24): 192.168.0.0/24
How many networks for the 'dubproject' project: 1
How many available IPs per 'dubproject' project network: 255

########
########

One last thing...there is currently no way to background/preeseed the
RabbitMQ package's installation splash screen, so we'll need you to
manually go through it.

Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  erlang-base erlang-crypto erlang-inets erlang-mnesia erlang-os-mon erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools
  libsctp1 lksctp-tools
Suggested packages:
  erlang-tools erlang erlang-manpages erlang-doc-html
The following NEW packages will be installed:
  erlang-base erlang-crypto erlang-inets erlang-mnesia erlang-os-mon erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssl erlang-syntax-tools
  libsctp1 lksctp-tools rabbitmq-server
0 upgraded, 13 newly installed, 0 to remove and 30 not upgraded.
Need to get 4,337 kB/7,198 kB of archives.
After this operation, 14.2 MB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ natty/main erlang-base amd64 1:13.b.3-dfsg-2ubuntu3 [4,337 kB]
Fetched 4,337 kB in 18s (235 kB/s)
Selecting previously deselected package erlang-base.
(Reading database ... 47590 files and directories currently installed.)
Unpacking erlang-base (from .../erlang-base_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-crypto.
Unpacking erlang-crypto (from .../erlang-crypto_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-mnesia.
Unpacking erlang-mnesia (from .../erlang-mnesia_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-runtime-tools.
Unpacking erlang-runtime-tools (from .../erlang-runtime-tools_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-public-key.
Unpacking erlang-public-key (from .../erlang-public-key_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-ssl.
Unpacking erlang-ssl (from .../erlang-ssl_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-inets.
Unpacking erlang-inets (from .../erlang-inets_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-snmp.
Unpacking erlang-snmp (from .../erlang-snmp_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-os-mon.
Unpacking erlang-os-mon (from .../erlang-os-mon_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package erlang-syntax-tools.
Unpacking erlang-syntax-tools (from .../erlang-syntax-tools_1%3a13.b.3-dfsg-2ubuntu3_amd64.deb) ...
Selecting previously deselected package libsctp1.
Unpacking libsctp1 (from .../libsctp1_1.0.11+dfsg-1_amd64.deb) ...
Selecting previously deselected package lksctp-tools.
Unpacking lksctp-tools (from .../lksctp-tools_1.0.11+dfsg-1_amd64.deb) ...
Selecting previously deselected package rabbitmq-server.
Unpacking rabbitmq-server (from .../rabbitmq-server_2.3.1-1ubuntu1_all.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up erlang-base (1:13.b.3-dfsg-2ubuntu3) ...
Searching for services which depend on erlang and should be started...none found.
Setting up erlang-crypto (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-mnesia (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-runtime-tools (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-public-key (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-ssl (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-inets (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-snmp (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-os-mon (1:13.b.3-dfsg-2ubuntu3) ...
Setting up erlang-syntax-tools (1:13.b.3-dfsg-2ubuntu3) ...
Setting up libsctp1 (1.0.11+dfsg-1) ...
Setting up lksctp-tools (1.0.11+dfsg-1) ...
Setting up rabbitmq-server (2.3.1-1ubuntu1) ...
Adding group `rabbitmq' (GID 112) ...
Done.
Adding system user `rabbitmq' (UID 104) ...
Adding new user `rabbitmq' (UID 104) with group `rabbitmq' ...
Not creating home directory `/var/lib/rabbitmq'.
Starting rabbitmq-server: SUCCESS
rabbitmq-server.
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place

################################################################
 ENTERING AUTO-PILOT MODE
################################################################

At this point, you've entered all the information needed to finish the
installation of this Nova component. Feel free to get some coffee, you have
earned it!

Installing packages
###################

Installing package 'python-software-properties' ... done
Adding 'ppa:nova-core/release' repository ... done
Installing package 'euca2ools' ... done
Installing package 'mysql-server' ... done
Installing package 'nova-api' ... done
Installing package 'nova-compute' ... done
Installing package 'nova-network' ... done
Installing package 'nova-objectstore' ... done
Installing package 'nova-scheduler' ... done
Installing package 'unzip' ... done

Setting up the Nova configuration file
######################################

Generating nova.conf ... done
Setting proper permissions for nova.conf ... done

Finalizing MySQL setup
######################

Adjusting MySQL network configuration ... done
Creating database ... done
Initializing database ... done

Generate Nova user credentials
##############################

Generating and extracting novacreds.zip ... done
Appending novarc environment settings to your ~/.bashrc ... done

Updating network interfaces
###########################

Adding bridge device ... done
Restarting networking service ... done

Bringing your Nova node online
##############################

Restarting Nova services ... done
Ensure all five Nova services are running:

UID        PID  PPID  C STIME TTY      STAT   TIME CMD
nova      6671  6667 19 15:55 ?        S      0:00 nova-api
nova      6660  6657 37 15:55 ?        S      0:01 nova-compute
nova      6647  6645 18 15:55 ?        S      0:00 nova-network
root      6683  6675  5 15:55 ?        S      0:00 nova-objectstor
nova      6692  6690 16 15:55 ?        S      0:00 nova-scheduler

Allowing ICMP and SSH access to all VMs ... done


########################################################################
# You /MUST/ re-source your 'novarc' to use the API commands since the #
# script cannot pass the source information out of its own process...  #
# the variables have been appended to your ~/.bashrc file for sourcing #
########################################################################

For reference, the generated credentials can be found in /root/creds/


The next thing you are going to want to do it get a VM to test with.
You can find a test VM how-to and read about custom image creation here:

  http://nova.openstack.org/adminguide/multi.node.install.html
  http://wiki.openstack.org/GettingImages

Enjoy your new private cloud!
reboot
source /root/creds/novarc
5.檢查
執行 euca-describe-instances  測試api server 是否運作正常
情況
A.正常 不會出現 訊息
B.EC2_ACCESS_KEY environment variable must be set. #EC2_ACCESS_KEY沒設好
重設

/usr/bin/python /usr/bin/nova-manage project zipfile nova nova /root/creds/novacreds.zip
unzip /root/creds/novacreds.zip -d /root/creds/
cat /root/creds/novarc >> ~/.bashrc
source ~/.bashrc
source /root/creds/novarc


euca-describe-instances 測試確定
--------------------------------------------------------------------------------------------------------------------------
cloud node---------------------------------------------------------------------------------------------------------

wget --no-check-certificate https://github.com/elasticdog
/OpenStack-NOVA-Installer-Script/raw/master/nova-install
1.變更權限  sudo chmod 755 nova-install


nova-install -t compute
 .....省略

2.What is the IP address of your NOVA CONTROLLER? 輸入相關資訊

-------------------------------------------------------------------------------------------------------------------------------

controller--------------------------------------------------------------------------------------------------------------------------
1.mysql -uroot -pnova nova -e 'select * from services;'
可以看到node 加入
+---------------------+---------------------+------------+---------+----+---------+----------------+----------                                                -+--------------+----------+-------------------+
| created_at          | updated_at          | deleted_at | deleted | id | host    | binary         | topic                                                     | report_count | disabled | availability_zone |
+---------------------+---------------------+------------+---------+----+---------+----------------+----------                                                -+--------------+----------+-------------------+
| 2011-05-05 13:37:50 | 2011-05-05 15:49:56 | NULL       |       0 |  1 | nova-cc | nova-network   | network                                                   |          786 |        0 | nova              |
| 2011-05-05 13:37:55 | 2011-05-05 15:49:59 | NULL       |       0 |  2 | nova-cc | nova-compute   | compute                                                   |          787 |        0 | nova              |
| 2011-05-05 13:38:00 | 2011-05-05 15:50:01 | NULL       |       0 |  3 | nova-cc | nova-scheduler | scheduler                                                 |          785 |        0 | nova              |
| 2011-05-05 15:47:50 | 2011-05-05 15:50:00 | NULL       |       0 |  4 | 64node1 | nova-compute   | compute                                                   |           13 |        0 | nova              |
+---------------------+---------------------+------------+---------+----+---------+----------------+---------- 
2.image="ubuntu1010-UEC-localuser-image.tar.gz"
3.wget http://c0179148.cdn1.cloudfiles.rackspacecloud.com/ubuntu1010-UEC-localuser-image.tar.gz
4.uec-publish-tarball ubuntu1010-UEC-localuser-image.tar.gz dub-bucket x86_64

euca-describe-images
euca-add-keypair test > test.pem
chmod 600 test.pem

euca-run-instances -k test -t m1.tiny "ami-key" 
5.test images  
查 image ipaddress
euca-describe-instances 
ssh ubuntu@$ipaddress
sudo -i

沒有留言:

張貼留言