openstack ha
来源:互联网 发布:百度手机全家桶 知乎 编辑:程序博客网 时间:2024/06/09 16:59
引用:http://my.oschina.net/scalewing/blog/168693
Openstack Grizzly HA installation Guide on Ubuntu 13.04
0. What is it ?
This guide includes steps to create multi-node HA openstack cloud, with Ceph as Glance and Cinder backend, Swift as object store, openvswitch as quantum plugin.
1. Requirements
4 type of nodes: Controller, Network, Compute and Swift
Architecture:
IP addresses and disks allocation:
Host nameHW modelRoleem-1 (external)em-2 (mgmt)em-3 (vm traffic)em-4 (storage)R710-1R710Swift211.95.100.13410.10.10.1 R710-2R710Controller_bak211.95.100.13310.10.10.2 10.30.30.2R710-3R710Controller211.95.100.13210.10.10.3 10.30.30.3R610-4R610Network211.95.100.13110.10.10.410.20.20.410.30.30.4R610-5R610Network_bak211.95.100.13010.10.10.510.20.20.510.30.30.5R710L-6R710LCompute211.95.100.13510.10.10.610.20.20.610.30.30.6R710-7R710Compute211.95.100.13610.10.10.710.20.20.710.30.30.7R710-8R710Compute211.95.100.13710.10.10.810.20.20.810.30.30.8R710L-9R710LCompute211.95.100.13810.10.10.910.20.20.910.30.30.9 VIP-APIs211.95.100.14310.10.10.200 VIP-Mysql 10.10.10.100 VIP-Rabbitmq 10.10.10.1012. Network Node
2.1. Preparing the Node
- Install Ubuntu 13.04
- Add ceph hosts entries to /etc/hosts
- Update your system
- Setup ntp service
- Add controllers as ntp servers, then restart ntp service.
- Install other services
- Enable IP_Forwarding
2.2. Networking
- Edit /etc/network/interfaces, following example is for R610-5 node, change IPs accordingly for R610-4 node. Also R610-4 does not need em4 storage IP since it has no ceph component running
- Restart networking service
2.3. OpenVSwitch (Part1)
- Install the openVSwitch:
- Create the bridges:
2.4. Quantum
- Install the Quantum openvswitch agent, l3 agent, dhcp agent and metadata-agent
- Edit /etc/quantum/quantum.conf
- Edit /etc/quantum/api-paste.ini
- Edit the OVS plugin configuration file /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini with::
- Update /etc/quantum/metadata_agent.ini with:
- Edit /etc/sudoers to give quantum user full access like:
- Restart all the services:
2.5. OpenVSwitch (Part2)
- Edit the em1in /etc/network/interfaces to become like this:
- Add em1 to br-ex
- Add external IP to br-ex to get internet access back, add following to /etc/network/interfaces
- Restart networking and quantum services
2.6. HAProxy
- Install package on both network node
- Disable auto-start by editing /etc/default/haproxy
- Edit /etc/haproxy/haproxy.cfg, the content of the file is same on both network node
- Stop haproxy if it’s running, let pacemaker to manage it later
2.7. Corosync and Pacemaker
- Install packages
- Generate Corosync keys on one node (R610-5)
- Edit /etc/corosync/corosync.conf on both node, replace “bindnetaddr” with real node em2 and em4 IP address
- Enable autostart, then start Corosync service
- Check Corosync status
- Download HAproxy OCF script
- Configure cluster resources for mysql
2.8. Ceph (on R610-5 node only)
We use R610-5 node as 3rd Ceph monitor node
- Install Ceph repository and package
- Create ceph-c monitor directory
3. Controller Nodes
3.1. Preparing the nodes
- Install Ubuntu 13.04
During disk partitioning selection, leave around 200GB space in the volume group, we need some space for Mysql and Rabbitmq DRBD resources.
- Add ceph hosts entries to /etc/hosts
- Update your system
- Setup ntp service
- Add another controller as ntp server, then restart ntp service.
- Install other services
- Enable IP_Forwarding
3.2. Networking
- Edit /etc/network/interfaces, following example is for R710-3 node, change IPs accordingly for R710-2 node
- Restart networking service
3.3. MySQL
- Install MySQL
- Configure mysql to accept all incoming requests
- Disable mysql auto-start by editting /etc/init/mysql.conf
- Stop mysql to let pacemaker to manage
3.4. RabbitMQ
- Install RabbitMQ
- Disable RabbitMQ server auto-restart by editing
- Stop mysql to let pacemaker to manage
3.5. DRBD
- Install packages
- Disable DRBD auto-start
- Prepare partitions, create a 100G LV for mysql, 10G LV for rabbitmq
- Load DRBD module
- Create mysql DRBD resource file /etc/drbd.d/mysql.res
- Create rabbitmq DRBD resource file /etc/drbd.d/rabbitmq.res
- After did configuration above on both nodes, bring up DRBD resources
- Initial DRBD Synchronization
- Create filesystem
- Move/Copy mysql and rabbitmq files to DRBD resources
- Change resources back to secondary to let pacemaker to manage
3.6. Pacemaker and Corosync
- Install packages
- Generate Corosync keys on one node
- Edit /etc/corosync/corosync.conf on both node, replace “bindnetaddr” with real node em2 and em4 IP address
- Enable autostart, then start Corosync service
- Check Corosync status
- Configure cluster resources for mysql
- Configure cluster resources for mysql
- Configure rabbitmq guest password
3.7. Create Databases
- Create Databases
3.8. Ceph
2 controller nodes are Ceph monitor(MON) and storage(OSD) nodes
- Install Ceph repository and package on both controller nodes
- Setup password free ssh connection from R710-3 to other 2 ceph nodes
- Prepare directories and disks on both controller nodes
- Create /etc/ceph.conf on R710-3, then distribute it to other 2 nodes
- Initialize ceph cluster from R710-3 node
- Check if ceph health is OK
- Create pools for voluems and images
3.9. Keystone
- Install the keystone packages
- Configure admin_token and database connection in /etc/keystone/keystone.conf. (10.10.10.100 is the VIP of Mysql HA cluster)
- Restart the keystone service then synchronize the database:
- Configure keystone users, tenants, roles, services and endpoints by 2 scripts (manual creation is also ok, but it takes too much time)
Retrieve scripts:
Modify SERVICE_TOKEN variable to your own value
Modify USER_PROJECT variable to your operation user and project name
Modify the HOST_IP and EXT_HOST_IP variables to the HA Proxy O&M VIP and external VIP before executing the scripts. In this example, it’s 10.10.10.200 and 119.100.200.143.
Modify the SWIFT_PROXY_IP and EXT_SWIFT_PROXY_IP variables to the Swift proxy server O&M IP and external IP. In this example, it’s 10.10.10.1 and 119.100.200.134.
Modify the MYSQL_USER and MYSQL_PASSWORD variables according your setup
Run scripts:
- Create a simple credential file and load it so you won’t be bothered later.
- To test Keystone, we use a simple CLI command
3.10. Glance
- Install Glance packages
- Update /etc/glance/glance-api.conf with
- Update the /etc/glance/glance-registry.conf with
- Create ceph authentication and keyring for glance
- Restart glance-api and glance-registry services
- Synchronize the glance database:
- To test Glance, upload a cirros image from internet:
- Now list the image to see what you have just uploade
3.11. Quantum
- Install the Quantum server and the OpenVSwitch package collection
- Update the OVS plugin configuration file /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini with
- Edit /etc/quantum/quantum.conf
- Restart the quantum server
3.12. Nova
- Start by installing nova server related components
- Update the /etc/nova/api-paste.ini filelike this:
- Update the /etc/nova/nova.conf like this, replace 10.10.10.3 with the management IP of the controller node
- Due to bug 1158958, Nova API must be patched to support memcached instead of the in-process cache. For nova version 1:2013.1-0ubuntu2.1, edit /usr/share/pyshared/nova/api/openstack/compute/contrib/extended_availability_zone.py
- Due to a bug similar to bug 1158958, Nova API must be patched to support memcached instead of the in-process cache. Edit /usr/lib/python2.7/dist-packages/nova/api/ec2/ec2utils.py by adding the following line after key = “%s:%s” % (func.__name__, reqid), for nova version 1:2013.1-0ubuntu2.1, it’s at line 44:
- Synchronize your database
- Restart nova-* services::
- Check for the smiling faces on nova-* services to confirm your installation
3.13. Cinder
- Install the required packages:
- Configure the iscsi services:
- Restart services
- Configure /etc/cinder/api-paste.ini like this:
- Edit the /etc/cinder/cinder.conf to
- Add env CEPH_ARGS=”–id volumes” after “stop on runlevel [!2345]” line in /etc/init/cinder-volume.conf
- Create ceph authentication and keyring for cinder
- Then, synchronize your database
- Restart the cinder services:
3.14. Horizon
- Install horizon packages
- Modify the /etc/openstack-dashboard/local_settings.py file like:
- Modify /etc/memcached.conf, replace 127.0.0.1 with the controller management IP address. (here takes R710-3 as example)
- Restart memcached and httpd
- Try to log into dashboard webUI with admin or normal project users
http://119.100.200.143/horizon
4. Compute Nodes
4.1. Preparing the Node
- Install Ubuntu 13.04
- Add ceph hosts entries to /etc/hosts
- Update your system
- Setup ntp service
- Add controllers as ntp servers, then restart ntp service.
- Install other services
- Enable IP_Forwarding
4.2. Networking
- Edit /etc/network/interfaces, following example is for R710-7 node, change IPs accordingly for other compute nodes
- Restart networking service
4.3. KVM
- Make sure that your hardware enables virtualization in BIOS, for DELL R610/R710 similar nodes, following CPU configs are recommanded
- Double check from OS that your hardware enables virtualization
- Install and start libvirt and kvm
- Edit the cgroup_device_acl array in the /etc/libvirt/qemu.conf file to:
- Delete default virtual bridge
- Enable live migration by updating /etc/libvirt/libvirtd.conf file:
- Edit libvirtd_opts variable in /etc/init/libvirt-bin.conf file:
- Edit /etc/default/libvirt-bin file
- Restart the libvirt service to load the new values
4.4. OpenVSwitch
- Install and start the openVSwitch
- Create the bridges and add port
4.5. Quantum
- Install the Quantum openvswitch agent:
- Edit the OVS plugin configuration file /etc/quantum/plugins/openvswitch/ovs_quantum_plugin.ini with
- Edit /etc/quantum/quantum.conf
- Restart the service
4.6. Ceph
- Updage librdb from Ceph repository
- Copy ceph volume key to compute nodes( Do this from 1st controller node)
- On one compute nodes, add ceph volumes key to libvirt (here we do this on R710-7)
- On other compute nodes, add the ceph volumes key
4.7. Nova
- Install nova’s required components for the compute node:
Now modify authtoken section in the /etc/nova/api-paste.ini file to this:
- Edit /etc/nova/nova-compute.conf file
- Edit /etc/nova/nova.conf file, replace 10.10.10.7 with management IP of the compute node
- Restart nova-* service
- Check for the smiling faces on nova-* services to confirm your installation, run this on controller node:
5. Swift Node
In this case, we install a All-in-One Swift node with 4 internal disks simulating 4 zones. Swift Proxy or OS itself has no HA protection
5.1. Preparing the Node
- Install Ubuntu 13.04
- Update your system
- Setup ntp service
- Add controllers as ntp servers, then restart ntp service.
5.2. Networking
- Edit /etc/network/interfaces
- Restart networking service
5.3. Swift Storage
- Install swift related packages
- Edit /etc/swift/swift.conf file
- For those 4 disks, setup the XFS filesystem, setup mount points, create need folders
- Create /etc/rsyncd.conf file
- Enable and restart rsyncd
- Setup rsyslog for individual logging, create /etc/rsyslog.d/10-swift.conf:
- Edit /etc/rsyslog.conf and make the following change:
- Change right and restart rsyslog
- Create /etc/swift/account-server/1.conf
- Create /etc/swift/account-server/2.conf
- Create /etc/swift/account-server/3.conf
- Create /etc/swift/account-server/4.conf
- Create /etc/swift/container-server/1.conf
- Create /etc/swift/container-server/2.conf
- Create /etc/swift/container-server/3.conf
- Create /etc/swift/container-server/4.conf
- Create /etc/swift/object-server/1.conf
- Create /etc/swift/object-server/2.conf
- Create /etc/swift/object-server/3.conf
- Create /etc/swift/object-server/4.conf
- Create rings
5.4. Swift Proxy
- Install packages
- Create /etc/swift/proxy-server.conf
- Make sure all the config files are owned by the swift user
- Start all swift services
- Check if swift works on controller by swift CLI:
You will see something similar to:
6. Create networks and router to start VM launching
To start your first VM, we first need to create an internal network, router and an external network.
- On keystone node, source keystonerc file
- Retreive demo tenant id
- Create a new network for the tenant demo
- Create a new subnet inside the new tenant network
- Create the router
- Add the subnet-1 to the router
- Create the external network
- Create the subnet for floating IPs
- Set the router gateway towards the external network:
- For DHCP agent HA purpose, let’s add the net-1 to DHCP agent on both network nodes
- That’s it ! Log on to your dashboard, create your secure key and modify your security groups then create your first VM, later you could also add floating IP to your running instances!!
7. Network service recovery from a network node failure
Only quantum-l3-agent service in the solution has a single point of failure, quantum-dhcp-agent services are running in active-active mode on 2 network nodes. This section describes how to recover l3-agent service from a network node failure.
- Check all agent list and status
We can see L3 agent on R610-4 and R610-5 are both alive, this is normal status.
- Check our router is running on which L3 agent:
We can see now our router “router-net-1″ is running on R610-5 node.
- If the R610-5 node is down, we should see the alive status in output above is “XXX” instead of “:-)“, then we need to switch it over to another running node: R610-4:
- openstack ha
- openstack HA介绍
- openstack neutron L3 HA
- OpenStack虚拟机HA建议
- OpenStack虚拟机HA建议
- OpenStack Instance HA Proposal
- Mirantis OpenStack HA
- OpenStack heat HA
- openstack HA配置-Mysql
- openstack neutron L3 HA
- openstack-ha部署文档
- openstack HA--1(rabbitMQ cluster)
- openstack HA--1(rabbitMQ cluster)
- 理解 OpenStack 高可用(HA)(5):RabbitMQ HA
- RabbitMQ HA 理解 OpenStack 高可用(HA)(5)
- 理解 OpenStack 高可用(HA)(5):RabbitMQ HA
- Openstack 使用Evacuate来实现HA
- small-mid-scale openstack cluster HA
- 浅谈HTTP中Get与Post的区别
- LCD驱动编写小结及BSWP 和 HWSWP的作用
- 查看Linux系统位数
- URL短地址压缩算法 微博短地址原理解析
- 基于springMVC的JAVA WEB实例开发
- openstack ha
- unity3d鼠标2D控制方法
- New* Government Grants & Free U.s Money.
- linux平台下的软件安装于升级
- visual studio: fatal error LNK1123
- python 读写文件
- How do you search for files containing dos line endings (CRLF) with grep on Linux?
- IOS实现拨打电话直接拨出分机号
- linux men usage