# vim /etc/mysql/my.cnf and delete below line to accept req from all network adapters
bind-address = 127.0.0.1
#/etc/init.d/mysql restart
##Verify it by##
# mysql -u root -popenstack
Install RabbitMQ
# apt-get install rabbitmq-server
##create a new file "/etc/rabbitmq/enabled_plugins" and copy below line: ##
[rabbitmq_management].
#chkconfig rabbitmq-server on
#service rabbitmq-server restart
Access " http://20.0.0.58:55672" to verify Rabbit server status with guest/guest
Install Keystone
#apt-get install keystone
# mysql -u root -popenstack
CREATE DATABASE keystone;
GRANT ALL ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';
GRANT ALL ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
##create service token for keystone##
export SERVICE_TOKEN=$(openssl rand -hex 10)
echo $SERVICE_TOKEN >/root/ks_admin_token
# echo $SERVICE_TOKEN
ff4a8fd60e1824bfd08a
##配置"/etc/keystone/keystone.conf" 如下(admin_token 与上面的一致)
admin_token = ff4a8fd60e1824bfd08a
connection = mysql://keystone:keystone@20.0.0.58/keystone
##Sync data to mysql database "keystone"
keystone-manage db_sync
##修改文件属性##
chown -R keystone:keystone /etc/keystone
chown -R keystone:keystone /var/log/keystone
##Restart keystone##
# /etc/init.d/keystone restart
# service keystone status
##Config keystone service in database##
# export SERVICE_TOKEN=`cat /root/ks_admin_token`
# export SERVICE_ENDPOINT=http://20.0.0.58:35357/v2.0
# keystone service-create --name=keystone --type=identity --description="Keystone Identity Service"
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | Keystone Identity Service |
| id | 96934a7c8e31458aa2919e3f6a1ce974 |
| name | keystone |
| type | identity |
+-------------+----------------------------------+
##change id and IP@ here##
# keystone endpoint-create --service_id 96934a7c8e31458aa2919e3f6a1ce974 --publicurl 'http://20.0.0.58:5000/v2.0' --adminurl 'http://20.0.0.58:35357/v2.0' --internalurl 'http://20.0.0.58:5000/v2.0' --region shanghai
mysql -u root -popenstack
mysql> CREATE DATABASE glance;
mysql> GRANT ALL ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glance';
mysql> GRANT ALL ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'glance';
mysql> exit
##Verify it by below command##
mysql -u glance -pglance
Create Glance service in keystone
# source /root/keystone_admin
# keystone service-create --name glance --type image --description "Glance Image Service"
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | Glance Image Service |
| id | eb80d944a8fa4c24b3c26e3b792b488a |
| name | glance |
| type | image |
+-------------+----------------------------------+
##Change Id and IP@ here##
# keystone endpoint-create --service-id eb80d944a8fa4c24b3c26e3b792b488a --publicurl "http://20.0.0.58:9292" --adminurl "http://20.0.0.58:9292" --internalurl "http://20.0.0.58:9292" --region shanghai
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| adminurl | http://20.0.0.58:9292 |
| id | 6f6e4f782304433fb7af154271ca216f |
| internalurl | http://20.0.0.58:9292 |
| publicurl | http://20.0.0.58:9292 |
| region | shanghai |
| service_id | eb80d944a8fa4c24b3c26e3b792b488a |
+-------------+----------------------------------+
##If you have set proxy, please get it as below##
# https_proxy=http://localhost:3128 wget -b https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
mysql -u root -popenstack
CREATE DATABASE nova;
GRANT ALL ON nova.* TO 'nova'@'%' IDENTIFIED BY 'nova';
GRANT ALL ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';
Create nova service in keystone
# source /root/keystone_admin
# keystone service-create --name compute --type compute --description "OpenStack Compute Service"
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | OpenStack Compute Service |
| id | b21f848587614ec99de917beef768b0a |
| name | compute |
| type | compute |
+-------------+----------------------------------+
##Change id and IP@ here##
# keystone endpoint-create --service-id b21f848587614ec99de917beef768b0a --publicurl "http://20.0.0.58:8774/v2/%(tenant_id)s" --adminurl "http://20.0.0.58:8774/v2/%(tenant_id)s" --internalurl "http://20.0.0.58:8774/v2/%(tenant_id)s" --region shanghai
+-------------+----------------------------------------+
| Property | Value |
+-------------+----------------------------------------+
| adminurl | http://20.0.0.58:8774/v2/%(tenant_id)s |
| id | 956df959361d453d9f9e99f55c68652c |
| internalurl | http://20.0.0.58:8774/v2/%(tenant_id)s |
| publicurl | http://20.0.0.58:8774/v2/%(tenant_id)s |
| region | shanghai |
| service_id | b21f848587614ec99de917beef768b0a |
+-------------+----------------------------------------+
Edit /etc/nova/nova.conf (vnc server, mysql server and rabbit server are installed on 20.0.0.58 here, please change it as your need)
nova-manage db sync
mysql -u nova -pnova
mysql > use nova;
mysql> show tables;
Restart nova services
service nova-api restart
service nova-cert restart
service nova-consoleauth restart
service nova-scheduler restart
service nova-conductor restart
service nova-novncproxy restart
Verify nova controll services
# apt-get install python-novaclient
# glance index
ID Name Disk Format Container Format Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------
f3aea503-3ffe-48a0-8fb9-a18c68ca7d7e cirros-0.3.0-x86_64 qcow2 bare 9761280
# nova image-list
+--------------------------------------+---------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| f3aea503-3ffe-48a0-8fb9-a18c68ca7d7e | cirros-0.3.0-x86_64 | ACTIVE | |
+--------------------------------------+---------------------+--------+--------+
Restart all services on this node(controller and compute components)
service nova-api restart
service nova-cert restart
service nova-consoleauth restart
service nova-compute restart
service nova-network restart
service nova-scheduler restart
service nova-conductor restart
service nova-novncproxy restart
service libvirt-bin restart
service rabbitmq-server restart
Verify Nova services(control and compute) on this node
# nova-manage service list
Binary Host Zone Status State Updated_At
nova-cert ubuntu58 internal enabled :-) 2013-10-31 19:29:42
nova-scheduler ubuntu58 internal enabled :-) 2013-10-31 19:29:42
nova-conductor ubuntu58 internal enabled :-) 2013-10-31 19:29:42
nova-consoleauth ubuntu58 internal enabled :-) 2013-10-31 19:29:42
nova-compute ubuntu58 nova enabled :-) 2013-10-31 19:29:41
nova-network ubuntu58 internal enabled :-) 2013-10-31 19:29:46
#nova list
Create a private network for VMs corresponding to above network configuration in "/etc/nova/nova.conf"
# nova-manage network list
##Create a new private network##
# nova-manage network create private --multi_host=T --fixed_range_v4=192.168.22.0/24 --bridge_interface=br100 --num_networks=1 --network_size=256
# nova-manage network list
id IPv4 IPv6 start address DNS1 DNS2 VlanID project uuid
2 192.168.22.0/24 None 192.168.22.2 8.8.4.4 None None None ee7c97fe-39f8-483a-a799-419e91f90d8a
计算节点(二)Ubuntu59环境配置
检查hostname
# cat /etc/hosts
127.0.0.1 localhost ubuntu59
edit interfaces as
# cat /etc/network/interfaces
# The loopback network interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 20.0.0.59
netmask 255.255.255.0
network 20.0.0.0
broadcast 20.0.0.255
gateway 20.0.0.1
auto eth1
iface eth1 inet manual
up ifconfig eth1 up
# /etc/init.d/networking restart
Edit file "/etc/nova/nova.conf" and add below lines (vnc server, glance,keystone, rabbit server, mysql are all on 20.0.0.58, please change it as your condition)