centos7下安装openstack juno

cryboy2001  2014-12-18
一、整体效果,有两台实例aa与bb可以看到ip与浮动ip(用的是192.168.10/24网段)

image002.gif
二、看看实例aa中的ip情況
image003.jpg

三、从外网登录到虚拟机bb中

image004.jpg

四、实例的网络拓扑

D4D1E228C83E4147B87301C474A54D93.jpg

一、环境
我用的是三台电脑,电脑名就是安这上面的controller,compute1,network ip地址与上面的一样。

image001.png

这次安装,先是实线框中的三台。

在安装过程中有非常多的密码,为了简单所有密码都是安这上面的,操作时就可以直接copy了。

image003.png

开始了!(由于是后来整理的,如有错误再修改)
最小化安装X64  centos 7,再是设设网络如下
电脑名在/etc/hostname中修改,网络ip在/etc/sysconfig/network-scripts/ifcfg-*
各电脑的ip地址与网卡名称:
controller       enp3s0     10.0.0.11
compute1      ens34        10.0.0.31       enp3s2     10.0.1.31
network         enp4s0      10.0.0.21       enp5s0f0  10.0.1.21     enp5s0f1  这个网卡是不设ip的,等后来做ext-net

网关都是10.0.0.1(内网中的路由器),可以使上面的三台电脑上网。
网卡都按上面的ip设好
network的第三块网卡比较特别,设置如下:
编辑 /etc/sysconfig/network-scripts/ifcfg-enp5s0f1  ,不要改变原来的 HWADDR 与 UUID。
HWADDR=00:11:0A:53:C9:6B
TYPE=Ethernet
UUID=afb38209-e504-4658-899b-33db3bcb7627
DEVICE=enp5s0f1
ONBOOT="yes"
BOOTPROTO="none"

设置/etc/hosts三台都要设,每台的电脑名也要改成相应的
# compute1
10.0.0.31       compute1
# controller
10.0.0.11       controller
# network
10.0.0.21       network

好了后检查一下效果
用ping compute1、network与其它电脑,还有外网台,要全通。
ping -c 4 openstack.org

安装相关的包,注意每一个都要完成安装,因为服务器都在国外,容易出错,可以多执行几次。
yum -y install ntp wget net-tools
yum install -y yum-plugin-priorities

yum install -y http://dl.fedoraproject.org/pub/ ... ease-7-2.noarch.rpm

# yum install -y http://rdo.fedorapeople.org/openstack-juno/rdo-release-juno.rpm

yum -y upgrade

yum install -y openstack-selinux

openstack对于时间的同步很严格,在controller上设置ntp服务器,其它的上设置成ntp客户端
同步internet上的时间
echo "01 01 * * * /usr/sbin/ntpdate ntp.api.bz    >> /dev/null 2>&1" >>/etc/crontab
在/etc/ntp.conf中加了以下
restrict 10.0.0.0 mask 255.255.255.0
server ntp.api.bz
其它节点加
server 10.0.0.11
加入开机启动与启动服务
# systemctl enable ntpd.service
# systemctl start ntpd.service
以上所有节点都要做,以后填加节点也要做
所以,我把以上步骤拼成了一个shell,执行一下环境就好了,方便:

  1. #!/bin/bash


  2. Hostname="compute1"  #改成节点名


  3. echo "$Hostname" >/etc/hostname


  4. echo "10.0.0.21       network" >>/etc/hosts


  5. echo "10.0.0.11       controller"  >>/etc/hosts


  6. echo "10.0.0.31       compute1"  >>/etc/hosts



  7. #下面是加的一些环境

  8. echo "export HISTSIZE=1000000" >>/etc/bashrc


  9. echo 'export PROMPT_COMMAND="history -a"' >>/etc/bashrc


  10. echo 'export HISTTIMEFORMAT="%Y-%m-%d_%H:%M:%S "' >>/etc/bashrc



  11. yum -y install ntp wget net-tools


  12. ntpdate ntp.api.bz


  13. echo "01 01 * * * /usr/sbin/ntpdate ntp.api.bz    >> /dev/null 2>&1" >>/etc/crontab  #controller节点上要,其它的不要




  14. yum install -y yum-plugin-priorities


  15. yum install -y http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm


  16. # yum install -y http://rdo.fedorapeople.org/openstack-juno/rdo-release-juno.rpm


  17. yum -y upgrade


  18. yum install -y openstack-selinux

  19. systemctl enable ntpd.service

复制代码

节点环境就好了。

我发现在juno的doc上都没有加防火墙的部分,有的要自己加上,要不然会出错的。
firewall-cmd --permanent --add-service=ntp 
firewall-cmd --reload

安装controller
下面的图中是每台节点上要安装的模块明细,有的模块是三台节点上都要安装如neutron。

installguidearch-neutron-services.png

一、安装数据库
yum install mariadb mariadb-server MySQL-python 
编辑数据库配置文件,修改与填加下面内容
vi /etc/my.cnf 
[mysqld] 
bind-address = 10.0.0.11 
default-storage-engine = innodb
innodb_file_per_table
collation-server = utf8_general_ci
init-connect = 'SET NAMES utf8'
character-set-server = utf8

改好了后,加入到开机启动,与启动数据库

systemctl enable mariadb.service 
systemctl start mariadb.service 
更改数据库的安全与加root密码,这个密码在以后操做数据库时要用到,要记住,不过不会出现在配置文件中
mysql_secure_installation 

对于数据库的应用,与其它的应用是一样的,在其它模块中加入链接,就行了。
如下,
connection = mysql://keystone:KEYSTONE_DBPASS@controller/keystone

填加Messaging server
yum install rabbitmq-server 

同样要加入启动与开启
systemctl enable rabbitmq-server.service 

systemctl start rabbitmq-server.service 

设置guest的密码:RABBIT_PASS,这个要记住,以后很多配置文件中要用到。
rabbitmqctl change_password guest RABBIT_PASS 

出现以下,就是成功了。
# rabbitmqctl change_password guest RABBIT_PASS
Changing password for user "guest" ...
...done.
检查一下以上,就是用root登录到mysql中试试
还有在防火墙中要加入打开端口
firewall-cmd --premanent --add-port=5672/tcp
firewall-cmd --reload

如果没加,安装其它模块可能就会出现如下的日志:
2014-12-16 10:15:25.022 2748 ERROR oslo.messaging._drivers.impl_rabbit [req-078ec9df-db8a-441f-859c-b368791624a0 ] AMQP server on controller:5672 is unreachable: [Errno 111] ECONNREFUSED. Trying again in 3 seconds.
就是连不到rabbit了,下面是成功的日志
2014-12-17 15:15:24.746 2683 INFO oslo.messaging._drivers.impl_rabbit [-] Connecting to AMQP server on controller:5672

如果在以后的安装中,出现了不正常的现象,第一时间是看日志,再核对操作过程,是不是有错。


填加身份认证服务

下图中是openstack身份认证的流程工作方式
clipboard.png

先安装Identity service
1、操作数据库,这里要用到刚刚数据库安装时用到的密码
#mysql -u root -p 
建立数据库,与授权用户,还有加密码KEYSTONE_DBPASS
CREATE DATABASE keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' \
  IDENTIFIED BY 'KEYSTONE_DBPASS';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' \
  IDENTIFIED BY 'KEYSTONE_DBPASS';
2、生成一个随机値,做为管理令牌,为后面的配置要用
# openssl rand -hex 10

3、安装包
# yum install openstack-keystone python-keystoneclient
配置这个文件 /etc/keystone/keystone.conf

[DEFAULT]
admin_token = d9cc00b3a9afaced6a36   #这是刚刚产生的随机值
verbose = True

[database]
connection = mysql://keystone:KEYSTONE_DBPASS@controller/keystone
[token]
provider = keystone.token.providers.uuid.Provider
driver = keystone.token.persistence.backends.sql.Token

4、创建管理证书与密钥,设置相关文件权限
# keystone-manage pki_setup --keystone-user keystone --keystone-group keystone
# chown -R keystone:keystone /var/log/keystone
# chown -R keystone:keystone /etc/keystone/ssl
# chmod -R o-rwx /etc/keystone/ssl
5、填充数据库数据
# su -s /bin/sh -c "keystone-manage db_sync" keystone

6、填加到启动与启动程序
# systemctl enable openstack-keystone.service
# systemctl start openstack-keystone.service

7、默认情况下,认证身份令牌到期后不会删除,会一直存在数据库中,所以加一下自动删除
# (crontab -l -u keystone 2>&1 | grep -q token_flush) || \
  echo '@hourly /usr/bin/keystone-manage token_flush >/var/log/keystone/keystone-tokenflush.log 2>&1' \
  >> /var/spool/cron/keystone

二、填加项目、用户与角色
也就是下图中的一些东西,看看到图上的就好理解多了。后面的操作就是与图上的对应。
35DCB3C44A034E7FA4515E67D19A7AF9.jpg

7AA738AD5C6843BD9F8F40A49C3B501E.jpg

1、配置管理令牌与端点
#export OS_SERVICE_TOKEN=d9cc00b3a9afaced6a36
#export OS_SERVICE_ENDPOINT=http://controller:35357/v2.0

2、填加项目、用户与角色。下面操作过程是直接从我的电脑上copy过来的有点乱,可以直接看doc。

[root@controller log]# keystone tenant-create --name admin --description "Admin Tenant" 

+-------------+----------------------------------+ 
| Property | Value | 
+-------------+----------------------------------+ 
| description   | Admin Tenant                            | 
| enabled        | True                                          | 
| id                 | 89109628fdf840249f2b9fd716404527 | 
| name            | admin                                       | 
+-------------+----------------------------------+ 
[root@controller log]# 
[root@controller log]# keystone user-create --name admin --pass ADMIN_PASS --email root@localhost 
+----------+----------------------------------+ 
| Property   | Value                                       | 
+----------+----------------------------------+ 
| email        | root@localhost                        | 
| enabled    | True                                        | 
| id              | 7f78bf6957154df998638833f061f196 | 
| name        | admin                                      | 
| username  | admin                                      | 
+----------+----------------------------------+ 
[root@controller log]# keystone role-create --name admin 
+----------+----------------------------------+ 
| Property   | Value                                       | 
+----------+----------------------------------+ 
| id              | 59e125307ef447bbb11e6bb015b8c6e4 | 
| name        | admin                                      | 
+----------+----------------------------------+ 
[root@controller log]# keystone user-role-add --tenant admin --user admin --role admin
[root@controller log]# keystone role-create --name _member_ 
+----------+----------------------------------+ 
| Property   | Value                                       | 
+----------+----------------------------------+ 
| id             | 2910a8344595471995e02b23fc93124f | 
| name        | _member_                               | 
+----------+----------------------------------+ 
[root@controller log]# keystone user-role-add --tenant admin --user admin --role _member_ 
这个是没输出的
上面是加admin,下面是加demo
[root@controller log]# keystone tenant-create --name demo --description "Demo Tenant" 
+-------------+----------------------------------+ 
| Property       | Value                                       | 
+-------------+----------------------------------+ 
| description   | Demo Tenant                           | 
| enabled        | True                                         | 
| id                  | 98aeedd6814142e68bc9ee88846d654c | 
| name             | demo                                     | 
+-------------+----------------------------------+ 
[root@controller log]# keystone user-create --name demo --pass DEMO_PASS --email EMAIL_ADDRESS 
+----------+----------------------------------+ 
| Property | Value | 
+----------+----------------------------------+ 
| email        | EMAIL_ADDRESS                      | 
| enabled    | True                                        | 
| id              | c7172284f56e44baaae83d9351e28c31 | 
| name         | demo                                     | 
| username   | demo                                     | 
+----------+----------------------------------+ 
[root@controller log]# keystone user-role-add --tenant demo --user demo --role _member_ 
[root@controller log]# keystone tenant-create --name service --description "Service Tenant" 
+-------------+----------------------------------+ 
| Property       | Value                                       | 
+-------------+----------------------------------+ 
| description | Service Tenant                            | 
| enabled      | True                                          | 
| id                | 9870c4478e0448ba87a38e1e3c80448c | 
| name          | service                                       | 
+-------------+----------------------------------+ 
[root@controller log]#
[root@controller log]# keystone service-create --name keystone --type identity \ 
> --description "OpenStack Identity" 
+-------------+----------------------------------+ 
| Property | Value | 
+-------------+----------------------------------+ 
| description   | OpenStack Identity                   | 
| enabled        | True                                         | 
| id                 | b2f1cfca40c64a6583b19e4475312e85 | 
| name           | keystone                                     | 
| type             | identity                                     | 
+-------------+----------------------------------+ 
[root@controller log]# keystone endpoint-create \ 
> --service-id $(keystone service-list | awk '/ identity / {print $2}') \ 
> --publicurl http://controller:5000/v2.0 \ 
> --internalurl http://controller:5000/v2.0 \ 
> --adminurl http://controller:35357/v2.0 \ 
> --region regionOne 
+-------------+----------------------------------+ 
| Property       | Value                                       | 
+-------------+----------------------------------+ 
| adminurl      | http://controller:35357/v2.0      | 
| id                 | 5fbc07aa73ef4891859d01eac5ac9253 | 
| internalurl     | http://controller:5000/v2.0       | 
| publicurl       | http://controller:5000/v2.0        | 
| region           | regionOne                                | 
| service_id        | b2f1cfca40c64a6583b19e4475312e85 | 
+-------------+----------------------------------+ 

上面的操作完了,下面验证一下看看有没有出错
先退出刚刚的操作环境
unset OS_SERVICE_TOKEN OS_SERVICE_ENDPOINT

[root@controller ~]# keystone --os-tenant-name admin --os-username admin --os-password ADMIN_PASS \
> --os-auth-url http://controller:35357/v2.0 token-get 
+-----------+----------------------------------+ 
| Property    | Value                                       | 
+-----------+----------------------------------+ 
| expires       | 2014-12-18T07:27:22Z               | 
| id               | f571c6b396904e4b93220d82a38605e2 | 
| tenant_id    | 89109628fdf840249f2b9fd716404527 | 
| user_id       | 7f78bf6957154df998638833f061f196 | 
+-----------+----------------------------------+ 
[root@controller ~]# keystone --os-tenant-name admin --os-username admin --os-password ADMIN_PASS \
> --os-auth-url http://controller:35357/v2.0 tenant-list 
+----------------------------------+---------+---------+ 
| id | name | enabled | 
+----------------------------------------+---------+---------+ 
| 89109628fdf840249f2b9fd716404527  | admin    | True      | 
| 98aeedd6814142e68bc9ee88846d654c | demo    | True      | 
| 9870c4478e0448ba87a38e1e3c80448c | service   | True      | 
+-----------------------------------------+---------+---------+
以上不出错后
以上操作完成后,建两下用户环境,以后在cli下操作只要source admin-openrc.sh就进入的操作权限。
[root@controller log]# vi admin-openrc.sh 
export OS_TENANT_NAME=admin 
export OS_USERNAME=admin 
export OS_PASSWORD=ADMIN_PASS 
export OS_AUTH_URL=http://controller:35357/v2.0 

[root@controller log]# vi demo-openrc.sh 
export OS_TENANT_NAME=demo 
export OS_USERNAME=demo 
export OS_PASSWORD=DEMO_PASS 
export OS_AUTH_URL=http://controller:5000/v2.0



加入OpenStack Image Service

也就是下图中的东西。
B50D89F0CB00406BB2E0AA6580D8741A.jpg

照样先加数据库,下面的与是电脑屏幕直接输入的
[root@controller log]# mysql -uroot -p 
Enter password: 
Welcome to the MariaDB monitor. Commands end with ; or \g. 
Your MariaDB connection id is 16 
Server version: 5.5.40-MariaDB MariaDB Server 

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others. 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 

MariaDB [(none)]> CREATE DATABASE glance; 
Query OK, 1 row affected (0.00 sec) 

MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \ 
-> IDENTIFIED BY 'GLANCE_DBPASS'; 
Query OK, 0 rows affected (0.00 sec) 
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \ 
-> IDENTIFIED BY 'GLANCE_DBPASS'; 
Query OK, 0 rows affected (0.00 sec) 

MariaDB [(none)]> exit 
Bye 

填加用户glance 与密码
[root@controller log]# keystone user-create --name glance --pass GLANCE_PASS 
+----------+----------------------------------+ 
| Property   | Value                                       | 
+----------+----------------------------------+ 
| email       |                                                 | 
| enabled   | True                                         | 
| id            | d51571512faf4c148cca450d75396893 | 
| name      | glance                                       | 
| username | glance                                      | 
+----------+----------------------------------+ 
[root@controller log]# keystone user-role-add --user glance --tenant service --role admin 
[root@controller log]# keystone service-create --name glance --type image \ 
> --description "OpenStack Image Service" 
+-------------+----------------------------------+ 
| Property       | Value                                       | 
+-------------+----------------------------------+ 
| description   | OpenStack Image Service         | 
| enabled        | True                                         | 
| id                 | 990d6863283141ff9dbaa7a4e3a06795 | 
| name            | glance                                      | 
| type              | image                                       | 
+-------------+----------------------------------+ 
[root@controller log]# keystone endpoint-create \ 
> --service-id $(keystone service-list | awk '/ image / {print $2}') \ 
> --publicurl http://controller:9292 \ 
> --internalurl http://controller:9292 \ 
> --adminurl http://controller:9292 \ 
> --region regionOne 
+-------------+----------------------------------+ 
| Property       | Value                                       | 
+-------------+----------------------------------+ 
| adminurl      | http://controller:9292                | 
| id                 | 37172288d36f4c1b8dc3fa7935174aa7 | 
| internalurl    | http://controller:9292                 | 
| publicurl       | http://controller:9292                 | 
| region           | regionOne                                 | 
| service_id      | 990d6863283141ff9dbaa7a4e3a06795 | 
+-------------+----------------------------------+ 

安装相关包
[root@controller log]#yum install openstack-glance python-glanceclient

编辑相关文件
# vi /etc/glance/glance-api.conf
[DEFAULT] 
verbose=True 
[database] 
connection = mysql://glance:GLANCE_DBPASS@controller/glance 
[keystone_authtoken] 
auth_uri = http://controller:5000/v2.0 
identity_uri = http://controller:35357 
admin_tenant_name = service 
admin_user = glance 
admin_password = GLANCE_PASS 
[paste_deploy] 
flavor = keystone 
[store_type_location_strategy] 
[profiler] 
[task] 
[glance_store] 
default_store = file 
filesystem_store_datadir = /var/lib/glance/images/

# vi /etc/glance/glance-registry.conf
[DEFAULT] 
verbose=True 
[database] 
connection = mysql://glance:GLANCE_DBPASS@controller/glance 
[keystone_authtoken] 
auth_uri = http://controller:5000/v2.0 
identity_uri = http://controller:35357 
admin_tenant_name = service 
admin_user = glance 
admin_password = GLANCE_PASS 
[paste_deploy] 
flavor = keystone 
[profiler]

同步数据库
# su -s /bin/sh -c "glance-manage db_sync" glance
填加到开机自启动与启动程序。
#systemctl enable openstack-glance-api.service openstack-glance-registry.service
#systemctl start openstack-glance-api.service openstack-glance-registry.service

试一下,先下载一上img,再加入到epenstack中

[root@controller log]# mkdir /tmp/images 
[root@controller log]# cd /tmp/images 
[root@controller images]# wget http://cdn.download.cirros-cloud ... 3.3-x86_64-disk.img 
[root@controller images]# ll 
total 12892 
-rw-r--r--. 1 root root 13200896 Dec 11 10:49 cirros-0.3.3-x86_64-disk.img 

加入到img
[root@controller images]# source /root/admin-openrc.sh 
[root@controller images]# glance image-create --name "cirros-0.3.3-x86_64" --file cirros-0.3.3-x86_64-disk.img \ 
> --disk-format qcow2 --container-format bare --is-public True --progress 
[=============================>] 100% 
+------------------+--------------------------------------+ 
| Property              | Value | 
+------------------+--------------------------------------+ 
| checksum            | 133eae9fb1c98f45894a4e60d8736619 | 
| container_format | bare | 
| created_at            | 2014-12-11T02:51:58 | 
| deleted                | False | 
| deleted_at            | None | 
| disk_format          | qcow2 | 
| id                         | 71ebf3fa-4da5-49e2-b1f3-88498e9c1643 | 
| is_public               | True | 
| min_disk               | 0 | 
| min_ram               | 0 | 
| name                    | cirros-0.3.3-x86_64 | 
| owner                   | 89109628fdf840249f2b9fd716404527 | 
| protected              | False | 
| size                       | 13200896 | 
| status                    | active | 
| updated_at            | 2014-12-11T02:51:59 | 
| virtual_size             | None | 
+------------------+--------------------------------------+ 

看一下
[root@controller images]# glance image-list 
+--------------------------------------+---------------------+-------------+------------------+----------+--------+ 
| ID                                               | Name                  | Disk Format | Container Format | Size    | Status | 
+--------------------------------------+---------------------+-------------+------------------+----------+--------+ 
| 71ebf3fa-4da5-49e2-b1f3-88498e9c1643 | cirros-0.3.3-x86_64 | qcow2 | bare | 13200896 | active | 
+--------------------------------------+---------------------+-------------+------------------+----------+--------+ 
[root@controller images]# cd /root/


增加一台compute,产生虚拟机的主机,就是下面的了。

clipboard.png

这个要在controller与compute1,两台电脑中操作。

先在controller中
1、. 先在数据库中操作,进入、增加、与加用户权限,秘密为NOVA_DBPASS
$ mysql -u root -p

CREATE DATABASE nova; 
Grant proper access to the nova database: 
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
  IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
  IDENTIFIED BY 'NOVA_DBPASS';

2. 填加 Identity 身份认证,建nova用户与密码并加入role组
$ source admin-openrc.sh
$ keystone user-create --name nova --pass NOVA_PASS
+----------+----------------------------------+
| Property  | Value                                        |
+----------+----------------------------------+
| email       |                                                 |
| enabled   | True                                         |
| id            | 387dd4f7e46d4f72965ee99c76ae748c |
| name      | nova                                          |
| username | nova                                        |
+----------+----------------------------------+

# keystone user-role-add --user nova --tenant service --role admin

创建nova service:
#keystone service-create --name nova --type compute \
  --description "OpenStack Compute"
+-------------+----------------------------------+
| Property       | Value                                       |
+-------------+----------------------------------+
| description   | OpenStack Compute                |
| enabled        | True                                         |
| id                 | 6c7854f52ce84db795557ebc0373f6b9 |
| name           | nova                                         |
| type             | compute                                  |
+-------------+----------------------------------+

$ 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 \
  --region regionOne
+-------------+-----------------------------------------+
| Property       | Value                                                 |
+-------------+-----------------------------------------+
| adminurl       | http://controller:8774/v2/%(tenant_id)s |
| id                  | c397438bd82c41198ec1a9d85cb7cc74 |
| internalurl     | http://controller:8774/v2/%(tenant_id)s |
| publicurl        | http://controller:8774/v2/%(tenant_id)s |
| region           | regionOne                                            |
| service_id       | 6c7854f52ce84db795557ebc0373f6b9 |
+-------------+-----------------------------------------+

安装包
# yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor \ openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler \ python-novaclient

编辑配置文件,在配置文件时,每行的前面不能有空格,要不然会出错的
vi /etc/nova/nova.conf
[database]
connection = mysql://nova:NOVA_DBPASS@controller/nova  #连数据库

rpc_backend = rabbit                      #连 rabbit
rabbit_host = controller
rabbit_password = RABBIT_PASS

auth_strategy = keystone    #使用keystone做身份认证
my_ip = 10.0.0.11
vncserver_listen = 10.0.0.11 
vncserver_proxyclient_address = 10.0.0.11
verbose = True

[keystone_authtoken]                                           #连到keystone
auth_uri = http://controller:5000/v2.0 
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = nova
admin_password = NOVA_PASS

[glance]    #glance  主机位置
host = controller 
  同步数据库
# su -s /bin/sh -c "nova-manage db sync" nova
增加自启动与启动进程
# systemctl enable openstack-nova-api.service openstack-nova-cert.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \ openstack-nova-conductor.service openstack-nova-novncproxy.service 
# systemctl start openstack-nova-api.service openstack-nova-cert.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \ openstack-nova-conductor.service openstack-nova-novncproxy.service
以上在controller中的操作就完成了

下面是在compute1中的操作

安装文件包
# yum install openstack-nova-compute sysfsutils

编辑配置文件

[DEFAULT]
rpc_backend = rabbit                 #连数据库
rabbit_host = controller
rabbit_password = RABBIT_PASS

auth_strategy = keystone 

my_ip =10.0.0.31    #本机的管理ip

vnc_enabled = True              #novnc使用
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = 10.0.0.31
novncproxy_base_url = http://controller:6080/vnc_auto.html 

verbose = True 

[keystone_authtoken]

auth_uri = http://controller:5000/v2.0
identity_uri = http://controller:35357
admin_tenant_name = service
admin_user = nova
admin_password = NOVA_PASS
[glance]

host = controller

增加自启动与启动进程
# systemctl enable libvirtd.service openstack-nova-compute.service
# systemctl start libvirtd.service
# systemctl start openstack-nova-compute.service


上面就操作完成,就填加好了nova service

测试一下,看到以下的就成功了。

要在controller节点上操作

# source admin-openrc.sh
# nova service-list
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host       | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-conductor   | controller | internal | enabled | up    | 2014-09-16T23:54:02.000000 | -               |
| 2  | nova-consoleauth | controller | internal | enabled | up    | 2014-09-16T23:54:04.000000 | -               |
| 3  | nova-scheduler   | controller | internal | enabled | up    | 2014-09-16T23:54:07.000000 | -               |
| 4  | nova-cert        | controller | internal | enabled | up    | 2014-09-16T23:54:00.000000 | -               |
| 5  | nova-compute     | compute1   | nova     | enabled | up    | 2014-09-16T23:54:06.000000 | -               |
+----+------------------+------------+----------+---------+-------+----------------------------+-----------------+

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值