openstack Load-Balancer-as-a-Service 坑中飞行

作者: admin 分类: openstack 发布时间: 2014-12-24 10:43 ė 6 没有评论

http://docs.openstack.org/admin-guide-cloud/content/install_neutron-lbaas-agent.html
官方配置文档
lbaas-agent配置在哪个节点上应该都可以,我是配置在网络节点上。配置前你需要先安装haproxy,直接用yum即可。

主要说坑吧
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager self.deploy_instance(logical_config)
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager File “/usr/lib/python2.6/site-packages/neutron/openstack/common/lockutils.py”, line 249, in inner
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager return f(*args, **kwargs)
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager File “/usr/lib/python2.6/site-packages/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py”, line 282, in deploy_instance
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager self.create(logical_config)
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager File “/usr/lib/python2.6/site-packages/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py”, line 87, in create
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager self._spawn(logical_config)
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager File “/usr/lib/python2.6/site-packages/neutron/services/loadbalancer/drivers/haproxy/namespace_driver.py”, line 110, in _spawn
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager ns.netns.execute(cmd)
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager File “/usr/lib/python2.6/site-packages/neutron/agent/linux/ip_lib.py”, line 466, in execute
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager check_exit_code=check_exit_code)
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager File “/usr/lib/python2.6/site-packages/neutron/agent/linux/utils.py”, line 76, in execute
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager raise RuntimeError(m)
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager RuntimeError:
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager Command: [‘sudo’, ‘neutron-rootwrap’, ‘/etc/neutron/rootwrap.conf’, ‘ip’, ‘netns’, ‘exec’, ‘qlbaas-5b46b820-85f7-41a3-97eb-a07ccc96cff0’, ‘haproxy’, ‘-f’, ‘/var/lib/neutron/lbaas/5b46b820-85f7-41a3-97eb-a07ccc96cff0/conf’, ‘-p’, ‘/var/lib/neutron/lbaas/5b46b820-85f7-41a3-97eb-a07ccc96cff0/pid’]
2014-12-24 09:57:58.977 729 TRACE neutron.services.loadbalancer.agent.agent_manager Exit code: 255

selinux没关

2014-12-24 10:19:58.525 729 TRACE neutron.services.loadbalancer.agent.agent_manager Command: [‘sudo’, ‘neutron-rootwrap’, ‘/etc/neutron/rootwrap.conf’, ‘ip’, ‘netns’, ‘exec’, ‘qlbaas-5b46b820-85f7-41a3-97eb-a07ccc96cff0’, ‘haproxy’, ‘-f’, ‘/var/lib/neutron/lbaas/5b46b820-85f7-41a3-97eb-a07ccc96cff0/conf’, ‘-p’, ‘/var/lib/neutron/lbaas/5b46b820-85f7-41a3-97eb-a07ccc96cff0/pid’]
2014-12-24 10:19:58.525 729 TRACE neutron.services.loadbalancer.agent.agent_manager Exit code: 1
2014-12-24 10:19:58.525 729 TRACE neutron.services.loadbalancer.agent.agent_manager Stdout: ”
2014-12-24 10:19:58.525 729 TRACE neutron.services.loadbalancer.agent.agent_manager Stderr: “[ALERT] 357/101958 (29997) : parsing [/var/lib/neutron/lbaas/5b46b820-85f7-41a3-97eb-a07ccc96cff0/conf:4] : cannot find group id for ‘nogroup’ (0:Success)n[ALERT] 357/101958 (299

解决办法: Change default LBaaS user group

Change user_group default parameter:
* nobody for Red Hat systems
* nogroup for Debian systems

在dashboard上配置的时候发现一个郁闷的问题,现在还不支持从dashboard给lb绑定floating ip,虽然有选框,但是灰化了,写明”还不支持“。不支持你还放到界面上,真是!@#$%^&*。
好在它只是dashboard不支持,那咱手工配。首先你先需要在dashboard上生成一个租户内部的lb,然后按照以下步骤绑定floatingip

从floating ip池中申请一个ip:

neutron floatingip-create 91af27b8-4d3d-4145-8244-fe674721c656
后面那一大串是floating ip池的id,然后查看一下你lb的端口id

我看到我的lbaas的端口id是4643a69c-97bd-4478-b48f-94417b9f2240。
最后关联floating ip:

neutron floatingip-associate 160c2baf-2cc7-4f73-945f-d45990dbe180 4643a69c-97bd-4478-b48f-94417b9f2240
第一个长串是floatingip的id,后面那个就是lb的端口id

最后在页面上添加的时候 记得添加HTTP协议 80端口

Neutron controller node configure:

vi /etc/neutron/neutron.conf
service_plugins=router,lbaas

[service_providers]
service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default

service neutron-server restart

Neutron Network node:
yum -y install neutron-lbaas-agent haproxy

vi /etc/neutron/neutron.conf
service_plugins=router,lbaas

[service_providers]
service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default

vi /etc/neutron/lbaas_agent.ini
verbose = True
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
device_driver = neutron.services.loadbalancer.drivers.haproxy.namespace_driver.HaproxyNSDriver

[haproxy]
user_group = nobody

service neutron-plugin-openvswitch-agent restart
service neutron-lbaas-agent restart

Neutron Compute Node: not needed

openstack dashboard node:
vi /etc/openstack-dashboard/local_settings.py
OPENSTACK_NEUTRON_NETWORK = {
‘enable_lb’: True

service httpd restart
service memcached restart

JUNO LBAAS的 DASHBOARD的BUG 默认关联监控 下拉菜单看不到监控模板
/usr/share/openstack-dashboard/openstack_dashboard/dashboards/project/loadbalancers/workflows.py

        monitor_id_choices = [('', _("Select a Monitor"))]
        try:
            tenant_id = self.request.user.tenant_id
            monitors = api.lbaas.pool_health_monitor_list(request,
                                                          tenant_id=tenant_id)
            pool_monitors_ids = [pm.id for pm in context['pool_monitors']]
            for m in monitors:
                if m.id not  in pool_monitors_ids:
                    display_name = utils.get_monitor_display_name(m)
                    monitor_id_choices.append((m.id, display_name))

改为
monitor_id_choices = [('', _("Select a Monitor"))]
try:
tenant_id = self.request.user.tenant_id
monitors = api.lbaas.pool_health_monitor_list(request,
tenant_id=tenant_id)
pool_monitors_ids = [pm.id for pm in context['pool_monitors']]
for m in monitors:
if m.id in pool_monitors_ids:
display_name = utils.get_monitor_display_name(m)
monitor_id_choices.append((m.id, display_name))

本文出自 小Q,转载时请注明出处及相应链接。

本文永久链接: http://www.linuxqq.com/archives/1413.html

0
更多
Ɣ回顶部