In general, OpenStack requires at least two physical machines, or two nodes, the control nodes and compute nodes mentioned earlier. In general, the control node does not require excessive hardware resources, compute nodes need a relatively high hardware resources, but often the user's two nodes of the hardware information is the same, so we will also install Nova on the control node, to use the Control node hardware resource information.
Second, install the Computing service on the Control node 1. Convention: Nova uses the MySQL database to store related data, with the following parameters:
Library Name: Nova
Account: Novadbadmin
Password: nova4smtest
2. Install the COMPUTE service
sudo apt-get install nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy Nova-scheduler Python-novaclient
3. Edit the/etc/nova/nova.conf file, set the database, message service and IP related parameters,
[Sudo vi/etc/nova/nova.conf]
The update settings are as follows:
#-----------Nova Config1---------------------------------------
[Database]
Connection = Mysql://novadbadmin:nova4smtest@192.168.3.180/nova
[DEFAULT]
Rpc_backend = Rabbit
Rabbit_host = 192.168.3.180
Rabbit_userid = Guest
Rabbit_password = Mq4smtest
Rabbit_port = 5672
#控制节点的IP
MY_IP = 192.168.3.180
Vncserver_listen = 192.168.3.180
Vncserver_proxyclient_address = 192.168.3.180
4. Delete SQLite database
sudo rm/var/lib/nova/nova.sqlite
5. Create a database, account, and configure permissions
sudo mysql-uroot-p#db4smtest#-e ' CREATE DATABASE nova; '
sudo mysql-uroot-p#db4smtest#-e ' CREATE USER novadbadmin; '
sudo mysql-uroot-p#db4smtest#-E "GRANT all privileges on nova.* to ' novadbadmin ' @ ' localhost ' identified by ' nova4smtest ';"
sudo mysql-uroot-p#db4smtest#-E "GRANT all privileges on nova.* to ' novadbadmin ' @ '% ' identified by ' nova4smtest ';"
sudo mysql-uroot-p#db4smtest#-e "SET PASSWORD for ' novadbadmin ' @ '% ' = PASSWORD (' nova4smtest ');"
6. Create a COMPUTE service table
sudo nova-manage db sync
sm@controller:~$ sudo nova-manage db sync 2015-04-11 14:14:37.517 7018 INFO migrate.versioning.api [-] 215-216 ... 2015-04-11 14:14:41.130 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.130 7018 INFO Migrate.versioning.ap
I [-] 216-217 ... 2015-04-11 14:14:41.133 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.134 7018 INFO Migrate.versioning.ap
I [-] 217-218 ... 2015-04-11 14:14:41.137 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.137 7018 INFO Migrate.versioning.ap
I [-] 218-219 ... 2015-04-11 14:14:41.142 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.142 7018 INFO Migrate.versioning.ap
I [-] 219-220 ... 2015-04-11 14:14:41.146 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.146 7018 INFO Migrate.versioning.ap
I [-] 221 ... 2015-04-11 14:14:41.150 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.150 7018 INFO Migrate.versioning.ap
I [-] 221-222 ... 2015-04-11 on 14:14:41.153 7018 Info Migrate.versioning.api [-] done 2015-04-11 14:14:41.153 7018 INFO migrate.versioning.api [-] 222 223 2015-04-11 14:14:41.156 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.156 7018 INFO migrate.version
ING.API [-] 223--224 ... 2015-04-11 14:14:41.158 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.159 7018 INFO Migrate.versioning.ap
I [-] 224-225 ... 2015-04-11 14:14:41.162 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.162 7018 INFO Migrate.versioning.ap
I [-] 225-226 ... 2015-04-11 14:14:41.166 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.166 7018 INFO Migrate.versioning.ap
I [-] 226-227 ... 2015-04-11 14:14:41.172 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.172 7018 INFO Migrate.versioning.ap
I [-] 227-228 ... 2015-04-11 14:14:41.205 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.205 7018 INFO Migrate.versioning.ap
I [-] 228-229 ... 2015-04-11 14:14:41.232 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.232 7018 INFO Migrate.versioning.api [-] 22
9-230 ... 2015-04-11 14:14:41.279 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.280 7018 INFO Migrate.versioning.ap
I [-] 231 ... 2015-04-11 14:14:41.324 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.324 7018 INFO Migrate.versioning.ap
I [-] 231-232 ... 2015-04-11 14:14:41.480 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.481 7018 INFO Migrate.versioning.ap
I [-] 232-233 ... 2015-04-11 14:14:41.521 7018 Info migrate.versioning.api [-] done 2015-04-11 14:14:41.522 7018 INFO Migrate.versioning.ap
I [-] 233-234 ...
2015-04-11 14:14:41.541 7018 INFO migrate.versioning.api [-] Done
7. Create a compute Service account and set up roles
Keystone User-create--name=nova--pass=nova4smtest--email=sm@163.com
sm@controller:~$ Keystone User-create--name=nova--pass=nova4smtest--email=sm@163.com
+----------+----------- -----------------------+
| Property | Value |
+----------+----------------------------------+
| Email | sm@163.com |
| enabled | True |
| ID | 375634b4a4194df6ba136a36bc2a6e68 |
| Name | Nova |
| username | Nova |
+----------+----------------------------------+
Keystone User-role-add--user=nova--tenant=service--role=admin
8. Edit the/etc/nova/nova.conf file, set the relevant parameters,
[Sudo vi/etc/nova/nova.conf]
The update settings are as follows:
[DEFAULT]
Auth_strategy = Keystone
[Keystone_authtoken]
Auth_uri = http://192.168.3.180:5000
Auth_host = 192.168.3.180
Auth_port = 35357
Auth_protocol = http
Admin_tenant_name = Service
Admin_user = Nova
Admin_password = Nova4smtest
Check the information about nova.conf.
sm@controller:~$ sudo more/etc/nova/nova.conf [DEFAULT] dhcpbridge_flagfile=/etc/nova/nova.conf Dhcpbridge=/usr/bin
/nova-dhcpbridge Logdir=/var/log/nova State_path=/var/lib/nova Lock_path=/var/lock/nova force_dhcp_release=True Iscsi_helper=tgtadm libvirt_use_virtio_for_bridges=true connection_type=libvirt Root_helper=sudo nova-rootwrap/etc /nova/rootwrap.conf verbose=true ec2_private_dns_show_ip=true Api_paste_config=/etc/nova/api-paste.ini Volumes_
Path=/var/lib/nova/volumes enabled_apis=ec2,osapi_compute,metadata rpc_backend = Rabbit Rabbit_host = 192.168.3.180 Rabbit_userid = Guest Rabbit_password = mq4smtest Rabbit_port = 5672 My_ip = 192.168.3.180 Vncserver_listen = 192.168.3.1 vncserver_proxyclient_address = 192.168.3.180 Auth_strategy = Keystone [Keystone_authtoken] Auth_uri = http://192.168
.3.180:5000 Auth_host = 192.168.3.180 Auth_port = 35357 Auth_protocol = http Admin_tenant_name = Service Admin_user = Nova Admin_password = nova4smtest [Database] connection = MySQL:Novadbadmin:nova4smtest@192.168.3.180/nova
9. Create a service
Keystone Service-create--name=nova--type=compute--description= "OpenStack Compute Service"
sm@controller:~$ Keystone Service-create--name=nova--type=compute --description= "OpenStack Compute Service"
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | OpenStack Compute Service |
| Enabled | True |
| ID | af57e640e51f4a55b2afab9f3b734c2a |
| Name | Nova |
| Type | Compute |
+-------------+----------------------------------+
10. Create an Access Endpoint
keystone endpoint-create--service-id=$ (Keystone Service-list | awk '/COMPUTE/{print $} ')--publi Curl=http://192.168.3.180:8774/v2/%\ (tenant_id\) s--internalurl=http://192.168.3.180:8774/v2/%\ (tenant_id\) S-- Adminurl=http://192.168.3.180:8774/v2/%\ (tenant_id\) s
sm@controller:~$ Keystone Endpoint-create--service-id=$ (Keystone Service-list | awk '/COMPUTE/{print $} ')--publ Icurl=http://192.168.3.180:8774/v2/%\ (tenant_id\) s--internalurl=http://192.168.3.180:8774/v2/%\ (tenant_id\) S-- Adminurl=http://192.168.3.180:8774/v2/%\ (tenant_id\) s
+-------------+------------------------------------- -------+
| Property | Value |
+-------------+--------------------------------------------+
| Adminurl | http://192.168.3.180:8774/v2/% (tenant_id) s |
| ID | 0e5527a14148441bb9b02f43ad301c63 |
| internalurl | http://192.168.3.180:8774/v2/% (tenant_id) s |
| Publicurl | http://192.168.3.180:8774/v2/% (tenant_id) s |
| Region | Regionone |
| service_id | AF57E640E51F4A55B2AFAB9F3B734C2A |
+-------------+--------------------------------------------+
11. Restart the service
sudo service Nova-api restart
sudo service Nova-cert restart
sudo service Nova-consoleauth restart
sudo service Nova-scheduler restart
sudo service nova-conductor restart
sudo service nova-novncproxy restart
sm@controller:~$ sudo service nova-api restart
nova-api stop/waiting nova-api
start/running, Process 7122
sm@controller:~ $sudo Service Nova-cert restart
nova-cert stop/waiting
nova-cert start/running, Process 7140
sm@controller:~ $sudo Service nova-consoleauth restart
nova-consoleauth stop/waiting
Nova-consoleauth start/running, Process 7164
sm@controller:~ $sudo service nova-scheduler restart Nova-scheduler stop/waiting
Nova-scheduler start/running, process 7182
sm@controller:~ $sudo service nova-conductor Restart
Nova-conductor stop/waiting
nova-conductor start/running, process 7209
sm@controller:~ $sudo Service Nova-novncproxy Restart
nova-novncproxy stop/waiting
nova-novncproxy start/running, Process 7249
12. Test View COMPUTE Service Status
1) sudo nova-manage service list
sm@controller:~$ sudo nova-manage service list
Binary Host Zone Status State updated_at
Nova-cert Controller internal enabled :-) 2015-04-11 06:19:22
nova-scheduler Controller Internal enabled :-) 2015-04-11 06:19:23
nova-consoleauth Controller Internal enabled :-) 2015-04-11 06:19:23
nova-conductor Controller Internal Enabled :-) 2015-04-11 06:19:23
All components are smiles, indicating that Nova is properly installed.
2) Nova Image-list
sm@controller:~$ Nova image-list
+--------------------------------------+---------------------+--------+---- ----+
| ID | Name | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| 6dbf0884-e9bb-406e-9f77-32aef79dd9 76 | cirros-0.3.2-x86_64 | ACTIVE | |
+--------------------------------------+---------------------+--------+--------+<span style= "font-family: ' Microsoft Yahei '; Background-color:rgb (255, 255, 255); " > </span>
There are available mirrors that can provide normal service improvements.
13. log Files
Storage location:/var/log/nova/
The storage file is:
/var/log/nova/nova-api.log
/var/log/nova/nova-cert.log
/var/log/nova/nova-conductor.log
/var/log/nova/nova-consoleauth.log
/var/log/nova/nova-manage.log
/var/log/nova/nova-scheduler.log
Note: If a control node is required to also act as a compute function, you need to refer to the first part of deployment 5, deployment 8, and deployment 9 to repeat the operation over the control node.