mysql> create database nova character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on nova.* to 'nova'@'%' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)
mysql> grant all on nova.* to 'nova'@'localhost' identified by 'nova';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec) 3)配置/etc/nova/nova.conf
[root@Node1 nova]# vi nova.conf
#rpc_backend=rabbit #找到并修改
rpc_backend=qpid
#qpid_hostname=localhost #找到并修改
qpid_hostname=192.168.10.1
#my_ip=10.0.0.1
my_ip=192.168.10.1
#vncserver_listen=127.0.0.1
vncserver_listen=192.168.10.1
# The address to which proxy clients (like nova-xvpvncproxy)
# should connect (string value)
#vncserver_proxyclient_address=127.0.0.1
vncserver_proxyclient_address=192.168.10.1 同步数据库:
[root@Node1 nova]# su -s /bin/sh -c "nova-manage db sync" nova #注意db sync没下划线
mysql> use nova
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+--------------------------------------------+
| Tables_in_nova |
+--------------------------------------------+
| agent_builds | 4)创建nova用户
[root@Node1 ~]# keystone user-create --name=nova --pass=nova
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| email | |
| enabled | True |
| id | b56531230b124b7ebbe1b9e72502a907 |
| name | nova |
| username | nova |
+----------+----------------------------------+
[root@Node1 ~]# keystone user-role-add --user=nova --role=admin --tenant=service
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning) 修改配置文件:
[root@Node1 nova]# vi nova.conf
[keystone_authtoken]
#
# Options defined in keystoneclient.middleware.auth_token
#
# Prefix to prepend at the beginning of the path (string
# value)
#auth_admin_prefix=
auth_protocol=http
auth_url=http://controller:5000
auth_host=controller
auth_port=35357
auth_user=nova
admin_tenant_name=service
admin_password=nova 5)在keystone中添加glance的service endpoint:
[root@Node1 nova]# keystone service-create --name=nova --type=compute \
> --description="OpenStack Compute"
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | e7acbab65f9647e7a3f691f990e43eb5 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
[root@Node1 nova]# keystone endpoint-create \
> --service-id=$(keystone service-list | awk '/ compute / {print $2}') \
> --publicurl=http://controller:8774/v2/%\(tenant_id\)s \
> --internalurl=http://controller:8774/v2/%\(tenant_id\)s \
> --adminurl=http://controller:8774/v2/%\(tenant_id\)s
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
+-------------+-----------------------------------------+
| Property | Value |
+-------------+-----------------------------------------+
| adminurl | http://controller:8774/v2/%(tenant_id)s |
| id | 990796a3ab404d0f816b6916005c57df |
| internalurl | http://controller:8774/v2/%(tenant_id)s |
| publicurl | http://controller:8774/v2/%(tenant_id)s |
| region | regionOne |
| service_id | e7acbab65f9647e7a3f691f990e43eb5 |
+-------------+-----------------------------------------+ 6)启动nova服务
[root@Node1 ~]# service openstack-nova-api start
Starting openstack-nova-api: [ OK ]
[root@Node1 ~]# service openstack-nova-cert start
Starting openstack-nova-cert: [ OK ]
[root@Node1 ~]# service openstack-nova-consoleauth start
Starting openstack-nova-consoleauth: [ OK ]
[root@Node1 ~]# service openstack-nova-scheduler start
Starting openstack-nova-scheduler: [ OK ]
[root@Node1 ~]# service openstack-nova-conductor start
Starting openstack-nova-conductor: [ OK ]
[root@Node1 ~]# service openstack-nova-novncproxy start
Starting openstack-nova-novncproxy: [ OK ]
[root@Node1 ~]# chkconfig openstack-nova-api on
[root@Node1 ~]# chkconfig openstack-nova-cert on
[root@Node1 ~]# chkconfig openstack-nova-consoleauth on
[root@Node1 ~]# chkconfig openstack-nova-scheduler on
[root@Node1 ~]# chkconfig openstack-nova-conductor on
[root@Node1 ~]# chkconfig openstack-nova-novncproxy on 验证是否配置成功:
[root@Node1 ~]# nova image-list
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
+--------------------------------------+------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+------------------+--------+--------+
| a3ae2a3d-832f-42bb-907f-f508c12de5d9 | cirros-0.3.4.img | ACTIVE | |
+--------------------------------------+------------------+--------+--------+
[keystone_authtoken]
#
# Options defined in keystoneclient.middleware.auth_token
#
# Prefix to prepend at the beginning of the path (string
# value)
#auth_admin_prefix=
auth_protocol=http
auth_url=http://controller:5000
auth_host=controller
auth_port=35357
auth_user=nova
admin_tenant_name=service
admin_password=nova 启动服务:
[root@Node2 nova]# service libvirtd start
Starting libvirtd daemon: [ OK ]
[root@Node2 nova]# service messagebus start
Starting system message bus:
[root@Node2 nova]# service openstack-nova-compute start
Starting openstack-nova-compute: [ OK ]
[root@Node2 nova]# service openstack-nova-compute status
openstack-nova-compute (pid 5247) is running...
[root@Node2 nova]# chkconfig libvirtd on
[root@Node2 nova]# chkconfig messagebus on
[root@Node2 nova]# chkconfig openstack-nova-compute on 验证是否配置成功:
在Controller节点上验证
[root@Node1 ~]# nova hypervisor-list
+----+---------------------+
| ID | Hypervisor hostname |
+----+---------------------+
| 1 | Node2 |
+----+---------------------+
附、可能遇到的报错 1、烦人的警告信息
[root@Node1 ~]# nova image-list
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)需要5以上的版本的gmp:
解决方法:下载gmp 5以上的版本,编译安装
# ./configure
# make
# make check
# make install