分享

建立高可用OpenStack云系列-- 建立HA Openstack云(六):安装Nova

xioaxu790 发表于 2014-5-30 09:56:49 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 0 17375

其实,本论坛上已经有了关于Nova的单独帖子内容
在这里也贴出来,目的是为了与之前的帖子《建立HA Openstack云系列6篇》连贯起来。






                                               建立HA Openstack云(六):安装Nova


在MySQL, RabbitMQ, Keystone和Glance之后,我们要来安装要用Pacemaker管理的Nova服务,并让它们高度可用。
和其他教程一样,当编辑/etc/nova/api-paste.ini,还要改动服务主机:
  1. service_protocol=http
  2. service_host = clusterkeystone
  3. service_port = 5000
  4. auth_host = clusterkeystone
  5. auth_port = 35357
  6. auth_protocol = http
  7. auth_uri = http://clusterkeystone:5000/
  8. admin_tenant_name = service
  9. admin_user = nova
  10. admin_password = nova
复制代码



还有,在做nova-manage db sync之前,一定要设置SQL主机为“clustermysql”,我这里这样设置/etc/nova/nova.conf:
  1. [DEFAULT]
  2. dhcpbridge_flagfile=/etc/nova/nova.conf
  3. dhcpbridge=/usr/bin/nova-dhcpbridge
  4. logdir=/var/log/nova
  5. state_path=/var/lib/nova
  6. lock_path=/run/lock/nova
  7. allow_admin_api=true
  8. use_deprecated_auth=false
  9. auth_strategy=keystone
  10. scheduler_driver=nova.scheduler.simple.SimpleScheduler
  11. s3_host=clusterglance
  12. ec2_host=clusterec2
  13. ec2_dmz_host=clusterec2
  14. rabbit_host=clusterrabbit
  15. cc_host=clusterec2
  16. nova_url=http://clusternova:8774/v1.1/
  17. glance_api_servers=clusterglance:9292
  18. image_service=nova.image.glance.GlanceImageService
  19. iscsi_ip_prefix=192.168.4
  20. sql_connection=mysql://novadbadmin:password@clustermysql/nova
  21. ec2_url=http://clusterec2:8773/services/Cloud
  22. keystone_ec2_url=http://clusterkeystone:5000/v2.0/ec2tokens
  23. api_paste_config=/etc/nova/api-paste.ini
  24. libvirt_type=kvm
  25. libvirt_use_virtio_for_bridges=true
  26. start_guests_on_host_boot=true
  27. resume_guests_state_on_host_boot=true
  28. novnc_enabled=true
  29. novncproxy_base_url=http://5.9.x.x:6080/vnc_auto.html
  30. vncserver_proxyclient_address=10.8.0.1
  31. vncserver_listen=0.0.0.0
  32. network_manager=nova.network.manager.FlatDHCPManager
  33. public_interface=eth0
  34. flat_interface=eth2
  35. flat_network_bridge=br100
  36. flat_injected=False
  37. force_dhcp_release=true
  38. iscsi_helper=tgtadm
  39. connection_type=libvirt
  40. root_helper=sudo nova-rootwrap
  41. verbose=True
  42. debug=True
  43. multi_host=true
  44. enabled_apis=ec2,osapi_compute,osapi_volume,metadata
复制代码



再次检查你的/etc/hosts,确保你已经把“clustermysql”,“clusterglance”这样的虚拟IP声明成你在Keystone安装(在终端配置里)和MySQL认证时设定的那样。
现在你可以官方教程里的db_sync部分了。
我们必须停止服务并让它们由Pacemaker管理:
  1. service nova-api stop
  2. service nova-cert stop
  3. service nova-compute stop
  4. service nova-consoleauth stop
  5. service nova-network stop
  6. service nova-objectstore stop
  7. service nova-scheduler stop
  8. service nova-volume stop
  9. service novnc stop
  10. echo "manual" > /etc/init/nova-api.override
  11. echo "manual" > /etc/init/nova-cert.override
  12. echo "manual" > /etc/init/nova-compute.override
  13. echo "manual" > /etc/init/nova-consoleauth.override
  14. echo "manual" > /etc/init/nova-network.override
  15. echo "manual" > /etc/init/nova-objectstore.override
  16. echo "manual" > /etc/init/nova-scheduler.override
  17. echo "manual" > /etc/init/nova-volume.override
  18. echo "manual" > /etc/init/novnc.override
复制代码



为服务下载资源代理:
  1. cd /usr/lib/ocf/resource.d/openstack/
  2. wget https://raw.github.com/leseb/OpenStack-ra/master/nova-api-ra
  3. wget https://raw.github.com/leseb/OpenStack-ra/master/nova-cert-ra
  4. wget https://raw.github.com/leseb/OpenStack-ra/master/nova-consoleauth-ra
  5. wget https://raw.github.com/leseb/OpenStack-ra/master/nova-scheduler-ra
  6. wget https://raw.github.com/leseb/OpenStack-ra/master/nova-vnc-ra
  7. wget https://raw.github.com/alex88/nova-network-ra/master/nova-network-ra
  8. wget https://raw.github.com/alex88/nova-compute-ra/master/nova-compute-ra
  9. wget https://raw.github.com/alex88/nova-objectstore-ra/master/nova-objectstore-ra
  10. wget https://raw.github.com/alex88/nova-volume-ra/master/nova-volume-ra
  11. chmod +x *
复制代码


设置服务随Pacemaker启动:
  1. crm configure primitive novaApiService ocf:openstack:nova-api-ra \
  2. params config="/etc/nova/nova.conf" \
  3. op monitor interval="5s" timeout="5s"
  4. crm configure primitive novaCertService ocf:openstack:nova-cert-ra \
  5. params config="/etc/nova/nova.conf" \
  6. op monitor interval="30s" timeout="30s"
  7. crm configure primitive novaConsoleauthService ocf:openstack:nova-consoleauth-ra \
  8. params config="/etc/nova/nova.conf" \
  9. op monitor interval="30s" timeout="30s"
  10. crm configure primitive novaSchedulerService ocf:openstack:nova-scheduler-ra \
  11. params config="/etc/nova/nova.conf" \
  12. op monitor interval="30s" timeout="30s"
  13. crm configure primitive novaVncService ocf:openstack:nova-vnc-ra \
  14. params config="/etc/nova/nova.conf" \
  15. op monitor interval="30s" timeout="30s"
  16. crm configure primitive novaNetworkService ocf:openstack:nova-network-ra \
  17. params config="/etc/nova/nova.conf" \
  18. op monitor interval="30s" timeout="30s"
  19. crm configure primitive novaComputeService ocf:openstack:nova-compute-ra \
  20. params config="/etc/nova/nova.conf" \
  21. op monitor interval="30s" timeout="30s"
  22. crm configure primitive novaObjectstoreService ocf:openstack:nova-objectstore-ra \
  23. params config="/etc/nova/nova.conf" \
  24. op monitor interval="30s" timeout="30s"
  25. crm configure primitive novaVolumeService ocf:openstack:nova-volume-ra \
  26. params config="/etc/nova/nova.conf" \
  27. op monitor interval="30s" timeout="30s"
  28. crm configure clone novaVolume novaVolumeService \
  29. meta clone-max="2" clone-node-max="1"
  30. crm configure clone novaNetwork novaNetworkService \
  31. meta clone-max="2" clone-node-max="1"
  32. crm configure clone novaCompute novaComputeService \
  33. meta clone-max="2" clone-node-max="1"
  34. crm configure clone novaApi novaApiService \
  35. meta clone-max="2" clone-node-max="1"
  36. crm configure clone novaVnc novaVncService \
  37. meta clone-max="2" clone-node-max="1"
  38. crm configure group novaServices novaConsoleauthService novaCertService novaSchedulerService
  39. crm configure order novaServices_after_keystone inf: Keystone novaServices
复制代码



注意:一定根据你的需要的用处来使用clone指令,其实我在Api and Network上使用clone,因为我运行的是multi_host openstack。
我的nova.conf里面说s3_host是glance ip,一定要编辑group Glance来包括nova-objectstore服务,所以要进行crm configure edit并确保有这一行:
group Glance glanceIP novaObjectstoreService glanceApiService glanceRegistryService
现在你就能查看OpenStack集群的状态了:
  1. Binary Host Zone Status State Updated_At
  2. nova-compute server1 nova enabled :-) 2012-07-31 10:00:27
  3. nova-compute server2 nova enabled :-) 2012-07-31 10:00:19
  4. nova-network server2 nova enabled :-) 2012-07-31 10:00:26
  5. nova-network server1 nova enabled :-) 2012-07-31 10:00:26
  6. nova-scheduler server2 nova enabled :-) 2012-07-31 10:00:26
  7. nova-consoleauth server2 nova enabled :-) 2012-07-31 10:00:26
  8. nova-cert server2 nova enabled :-) 2012-07-31 10:00:26
  9. nova-volume server1 nova enabled :-) 2012-07-31 10:00:26
  10. nova-volume server2 nova enabled :-) 2012-07-31 10:00:26
复制代码



好了,现在你已经有了所有Corosync+Pacemaker管理的Openstack组件了。Openstack的虚拟机高可用性特性仍在开发,敬请期待这方面的更新。

上一篇:
建立高可用OpenStack云系列--建立HA Openstack云(五):安装Glance







没找到任何评论,期待你打破沉寂

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条