openstack pike 버전 lbaasv2 설치

| 2018년 2월 23일 | 0 Comments
  1. 컨트롤러 노드

패키지 설치


root@controller:~# apt-get install python-neutron-lbaas
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
다음 새 패키지를 설치할 것입니다:
  python-neutron-lbaas
0개 업그레이드, 1개 새로 설치, 0개 제거 및 9개 업그레이드 안 함.
181 k바이트 아카이브를 받아야 합니다.
이 작업 후 1,634 k바이트의 디스크 공간을 더 사용하게 됩니다.
받기:1 http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/pike/main amd64 python-neutron-lbaas all 2:11.0.2-0ubuntu1~cloud0 [181 kB]
내려받기 181 k바이트, 소요시간 3초 (56.8 k바이트/초)
Selecting previously unselected package python-neutron-lbaas.
(데이터베이스 읽는중 ...현재 134529개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../python-neutron-lbaas_2%3a11.0.2-0ubuntu1~cloud0_all.deb ...
Unpacking python-neutron-lbaas (2:11.0.2-0ubuntu1~cloud0) ...
python-neutron-lbaas (2:11.0.2-0ubuntu1~cloud0) 설정하는 중입니다 ...

설정 파일 수정


root@controller:~# vi /etc/neutron/neutron.conf
[DEFAULT]
..
..
service_plugins = router,neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2
allow_automatic_lbaas_agent_failover = true

root@controller:~# vi /etc/neutron/neutron_lbaas.conf
[DEFAULT]
..
..
allow_automatic_lbaas_agent_failover = true
..
..
[service_providers]
service_provider=LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default

db 업데이트


root@controller:~# neutron-db-manage --subproject neutron-lbaas upgrade head
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
  Running upgrade for neutron-lbaas ...
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> start_neutron_lbaas, start neutron-lbaas chain
INFO  [alembic.runtime.migration] Running upgrade start_neutron_lbaas -> lbaasv2, lbaas version 2 api
INFO  [alembic.runtime.migration] Running upgrade lbaasv2 -> 4deef6d81931, add provisioning and operating statuses
INFO  [alembic.runtime.migration] Running upgrade 4deef6d81931 -> 4b6d8d5310b8, add_index_tenant_id
INFO  [alembic.runtime.migration] Running upgrade 4b6d8d5310b8 -> 364f9b6064f0, agentv2
INFO  [alembic.runtime.migration] Running upgrade 364f9b6064f0 -> lbaasv2_tls, lbaasv2 TLS
INFO  [alembic.runtime.migration] Running upgrade lbaasv2_tls -> 4ba00375f715, edge_driver
INFO  [alembic.runtime.migration] Running upgrade 4ba00375f715 -> kilo, kilo
INFO  [alembic.runtime.migration] Running upgrade kilo -> 3345facd0452, Initial Liberty no-op expand script.
INFO  [alembic.runtime.migration] Running upgrade 3345facd0452 -> 4a408dd491c2, Addition of Name column to lbaas_members and lbaas_healthmonitors table
INFO  [alembic.runtime.migration] Running upgrade 4a408dd491c2 -> 3426acbc12de, Add flavor id
INFO  [alembic.runtime.migration] Running upgrade 3426acbc12de -> 6aee0434f911, independent pools
INFO  [alembic.runtime.migration] Running upgrade 6aee0434f911 -> 3543deab1547, add_l7_tables
INFO  [alembic.runtime.migration] Running upgrade 3543deab1547 -> 62deca5010cd, Add tenant-id index for L7 tables
INFO  [alembic.runtime.migration] Running upgrade kilo -> 130ebfdef43, Initial Liberty no-op contract revision.
INFO  [alembic.runtime.migration] Running upgrade 130ebfdef43 -> 4b4dc6d5d843, rename tenant to project
INFO  [alembic.runtime.migration] Running upgrade 4b4dc6d5d843 -> e6417a8b114d, Drop v1 tables
INFO  [alembic.runtime.migration] Running upgrade 62deca5010cd -> 844352f9fe6f, Add healthmonitor max retries down
  OK

확인


root@controller:~# neutron service-provider-list
neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+----------------+-------------+---------+
| service_type   | name        | default |
+----------------+-------------+---------+
| L3_ROUTER_NAT  | single_node | False   |
| L3_ROUTER_NAT  | ha          | False   |
| L3_ROUTER_NAT  | dvrha       | False   |
| L3_ROUTER_NAT  | dvr         | False   |
| LOADBALANCERV2 | haproxy     | True    |
+----------------+-------------+---------+

서비스 재시작


root@controller:~# service neutron-server restart 

      2. 네트워크 노드

패키지 설치


root@network:~# apt-get install neutron-lbaasv2-agent
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다       
상태 정보를 읽는 중입니다... 완료
The following additional packages will be installed:
  neutron-lbaas-common python-barbicanclient python-neutron-lbaas python-pyasn1-modules
다음 새 패키지를 설치할 것입니다:
  neutron-lbaas-common neutron-lbaasv2-agent python-barbicanclient python-neutron-lbaas python-pyasn1-modules
0개 업그레이드, 5개 새로 설치, 0개 제거 및 6개 업그레이드 안 함.
292 k바이트 아카이브를 받아야 합니다.
이 작업 후 2,563 k바이트의 디스크 공간을 더 사용하게 됩니다.
계속 하시겠습니까? [Y/n] y

설정 파일 수정


root@network:~# vi /etc/neutron/neutron.conf
[DEFAULT]
..
..
service_plugins = router,neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2

root@network:~# vi /etc/neutron/neutron_lbaas.conf
[DEFAULT]
..
..
allow_automatic_lbaas_agent_failover = true
..
..
[service_providers]
service_provider=LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default

root@network:~# vi /etc/neutron/lbaas_agent.ini 
[DEFAULT]
debug = True
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
network_device_mtu = 1450

소스 파일 수정


root@network:~# cp /usr/lib/python2.7/dist-packages/neutron_lbaas/drivers/haproxy/templates/haproxy_base.j2 /usr/lib/python2.7/dist-packages/neutron_lbaas/drivers/haproxy/templates/haproxy_base.j2_ori

root@network:~# vi /usr/lib/python2.7/dist-packages/neutron_lbaas/drivers/haproxy/templates/haproxy_base.j2
{# # Copyright 2014 OpenStack Foundation
#
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.
#
#}
# Configuration for {{ loadbalancer_name }}
global
    daemon
    user nobody
    group {{ usergroup }}
    log /dev/log local0
    log /dev/log local1 notice
    maxconn {{ connection_limit }}
    stats socket {{ sock_path }} mode 0666 level user
    maxconn 15000

defaults
    log global
    retries 3
    option redispatch
    timeout connect 5000
    timeout client 50000
    timeout server 50000
    maxconn 15000
    contimeout 5000
    clitimeout 50000
    srvtimeout 50000

listen 0.0.0.0
    bind :{포트번호} 
    mode http 
    stats enable 
    stats uri / 
    stats hide-version 
    stats refresh 5s 
    stats show-legends 
    stats show-desc 
    stats auth {계정}:{비밀번호}

{% block proxies %}{% endblock proxies %}

서비스 재시작


root@network:~# service neutron-lbaasv2-agent restart 

Category: 가상화/클라우드

장영호

About the Author ()