4.1 centos环境准备
目标:修改answer-file,将controller+network放在一个节点,compute-storage放在另一个节点,使用packstack部署双节点环境
hostname |
IP |
Floating ip |
Function |
|
lxp-node1 |
192.168.11.8 |
10.33.41.135 |
Controller+network |
|
lxp-node2 |
192.168.11.9 |
10.33.41.136 |
Compute+storage |
|
在/etc/hosts中增加:
192.168.11.8 lxp-node1
192.168.11.9 lxp-node2
10.1.14.235 mirrors.hikvision.com.cn
yum install openstack-packstack -y
生成answer-file:
packstack --gen-answer-file=hcloud.txt
# packstack --gen-answer-file=hcloud.txt
修改hcloud.txt:
(1) 将CONFIG_PROVISION_DEMO=y改为n
(2) 修改如下IP设置:
CONFIG_CONTROLLER_HOST=192.168.11.8
CONFIG_COMPUTE_HOSTS=192.168.11.8 -> 192.168.11.9
CONFIG_NETWORK_HOSTS=192.168.11.8
CONFIG_STORAGE_HOST=192.168.11.8 -> 192.168.11.9
CONFIG_SAHARA_HOST=192.168.11.8 忽略,因为:CONFIG_SAHARA_INSTALL=n
CONFIG_AMQP_HOST=192.168.11.8
CONFIG_MARIADB_HOST=192.168.11.8
CONFIG_KEYSTONE_LDAP_URL=ldap://192.168.11.8
CONFIG_NOVA_NETWORK_FIXEDRANGE=192.168.32.0/22
CONFIG_MONGODB_HOST=192.168.11.8
CONFIG_REDIS_MASTER_HOST=192.168.11.8
其他都不用改
开始部署:
# yum install screen
# screen packstack--answer-file=hcloud.txt
这里只需要在控制节点执行
Welcome to the Packstack setup utility
The installation log file is available at:/var/tmp/packstack/20160508-231645-ZxTeV9/openstack-setup.log
Installing:
Clean Up [DONE ]
Discovering ip protocol version [ DONE ]
这里需要手动输入密码,这是和all-in-one、init-host和单点部署不同之处
[email protected]'s password:
[email protected]'s password:
Setting up ssh keys [ DONE ]
Preparing servers [ DONE ]
安装完毕后出现如下打印:
****Installation completed successfully ******
Additional information:
*Time synchronization installation was skipped. Please note that unsynchronizedtime on server instances might be problem for some OpenStack components.
*Warning: NetworkManager is active on 192.168.11.9, 192.168.11.8. OpenStacknetworking currently does not work on systems that have the Network Managerservice enabled.
*File /root/keystonerc_admin has been created on OpenStack client host192.168.11.8. To use the command line tools you need to source the file.
* Toaccess the OpenStack Dashboard browse to http://192.168.11.8/dashboard .
Please, find your login credentials storedin the keystonerc_admin in your home directory.
* Touse Nagios, browse to http://192.168.11.8/nagios username: nagiosadmin,password: 37c9294b360f417b
*The installation log file is available at:/var/tmp/packstack/20160508-231645-ZxTeV9/openstack-setup.log
*The generated manifests are available at:/var/tmp/packstack/20160508-231645-ZxTeV9/manifests安装日志:
可以使用命令测试一下:
[root@host-192-168-11-8~(keystone_admin)]# cinder service-list
+------------------+---------------+------+---------+-------+----------------------------+-----------------+
| Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+------------------+---------------+------+---------+-------+----------------------------+-----------------+
| cinder-backup | lxp-node1 | nova | enabled| up | 2016-05-09T03:43:36.000000 | - |
| cinder-scheduler| lxp-node1 | nova | enabled | up |2016-05-09T03:43:42.000000 | - |
| cinder-volume | lxp-node1@lvm| nova | enabled | up | 2016-05-09T03:43:42.000000 | - |
+------------------+---------------+------+---------+-------+----------------------------+-----------------+
[root@host-192-168-11-8~(keystone_admin)]# nova service-list
+----+------------------+-----------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary | Host | Zone | Status | State | Updated_at | Disabled Reason |
+----+------------------+-----------+----------+---------+-------+----------------------------+-----------------+
| 1 | nova-consoleauth | lxp-node1 | internal |enabled | up |2016-05-09T03:43:41.000000 | - |
| 2 | nova-scheduler | lxp-node1 | internal | enabled | up | 2016-05-09T03:43:43.000000 | - |
| 3 | nova-conductor | lxp-node1 | internal | enabled | up | 2016-05-09T03:43:45.000000 | - |
| 4 | nova-cert | lxp-node1 | internal | enabled |up | 2016-05-09T03:43:41.000000 |- |
| 5 | nova-compute | lxp-node2| nova | enabled | up | 2016-05-09T03:43:44.000000 | - |
+----+------------------+-----------+----------+---------+-------+----------------------------+-----------------+
这里nova-compute是安装到了lxp-node2,但是cinder-volume还是在lxp-node1,看来配置还有些问题
[root@host-192-168-11-8~(keystone_admin)]# grep HOST ./hcloud.txt
CONFIG_CONTROLLER_HOST=192.168.11.8
CONFIG_COMPUTE_HOSTS=192.168.11.9
CONFIG_NETWORK_HOSTS=192.168.11.8
CONFIG_VCENTER_HOST=
CONFIG_STORAGE_HOST=192.168.11.8
CONFIG_SAHARA_HOST=192.168.11.8
CONFIG_AMQP_HOST=192.168.11.8
CONFIG_MARIADB_HOST=192.168.11.8
CONFIG_CINDER_NETAPP_HOSTNAME=
CONFIG_CINDER_NETAPP_ESERIES_HOST_TYPE=linux_dm_mp
#CONFIG_CINDER_NETAPP_TRANSPORT_TYPE, CONFIG_CINDER_NETAPP_HOSTNAME,
# andCONFIG_CINDER_NETAPP_HOSTNAME options to create the URL used by
CONFIG_MANILA_NETAPP_SERVER_HOSTNAME=
CONFIG_MONGODB_HOST=192.168.11.8
CONFIG_REDIS_MASTER_HOST=192.168.11.8
CONFIG_REDIS_SLAVE_HOSTS=
CONFIG_REDIS_SENTINEL_HOSTS=
CONFIG_REDIS_SENTINEL_CONTACT_HOST=
原因是这里没有改,没有关系,后面再安装三节点的环境时注意一下