오픈스택 queens senlin 설치

| 2020년 5월 20일 | 0 Comments

senlin은 오픈스택 클라우드를 위한 클러스터링 서비스입니다.

senlin은 오픈스택의 다른서비스 keystone, nova, heat등의 서비스와 연동하여 클러스터를 생성하고 운영할 수 있습니다.

profile로 오픈스택 서비스와 상호 작용하여 리소스 생성, 업데이트, 삭제 가능하며 web hook를 이용하여 이벤트를 생성할 수 있습니다.

설치 환경은 Ubuntu 18.04 오픈스택 버전은 queens 입니다.

 


 

  • db 생성
    # mysql

    MariaDB [(none)]> CREATE DATABASE senlin;
    Query OK, 1 row affected (0.00 sec)

    MariaDB [(none)]> GRANT ALL ON senlin.* TO ‘senlin’@’localhost’ \
    -> IDENTIFIED BY ‘{패스워드}’;
    Query OK, 0 rows affected (0.00 sec)

    MariaDB [(none)]> GRANT ALL ON senlin.* TO ‘senlin’@’%’ \
    -> IDENTIFIED BY ‘{패스워드}’;
    Query OK, 0 rows affected (0.00 sec)

    MariaDB [(none)]> quit
    Bye

  • 서비스 관련 설정

    # source vinchin_env/admin_openrc

    # openstack user create –project service –password {패스워드} senlin
    +———————+———————————-+
    | Field | Value |
    +———————+———————————-+
    | default_project_id | 2d67b0be4e2948278503fd2f9de4f81b |
    | domain_id | default |
    | enabled | True |
    | id | f7e8c339babe4ee286c87649034230f3 |
    | name | senlin |
    | options | {} |
    | password_expires_at | None |
    +———————+———————————-+

    # openstack role add –project service –user senlin admin

    # openstack service create –name senlin \
    > –description “Senlin Clustering Service V1” clustering
    +————-+———————————-+
    | Field | Value |
    +————-+———————————-+
    | description | Senlin Clustering Service V1 |
    | enabled | True |
    | id | f542aa18b5184696b0ec1461fdeb895b |
    | name | senlin |
    | type | clustering |
    +————-+———————————-+

    # openstack endpoint create senlin –region vinchin public http://controller:8777
    +————–+———————————-+
    | Field | Value |
    +————–+———————————-+
    | enabled | True |
    | id | 4a174ebe70df4b6781b9a2ab308ad410 |
    | interface | public |
    | region | vinchin |
    | region_id | vinchin |
    | service_id | f542aa18b5184696b0ec1461fdeb895b |
    | service_name | senlin |
    | service_type | clustering |
    | url | http://controller:8777 |
    +————–+———————————-+

    # openstack endpoint create senlin –region vinchin internal http://controller:8777
    +————–+———————————-+
    | Field | Value |
    +————–+———————————-+
    | enabled | True |
    | id | a1c334d0298d49fb9a31353052e824b0 |
    | interface | internal |
    | region | vinchin |
    | region_id | vinchin |
    | service_id | f542aa18b5184696b0ec1461fdeb895b |
    | service_name | senlin |
    | service_type | clustering |
    | url | http://controller:8777 |
    +————–+———————————-+

    # openstack endpoint create senlin –region vinchin admin http://controller:8777
    +————–+———————————-+
    | Field | Value |
    +————–+———————————-+
    | enabled | True |
    | id | 0ab3a5fd5b9b4726b426d31ea501a60e |
    | interface | admin |
    | region | vinchin |
    | region_id | vinchin |
    | service_id | f542aa18b5184696b0ec1461fdeb895b |
    | service_name | senlin |
    | service_type | clustering |
    | url | http://controller:8777 |
    +————–+———————————-+

  • 패키지 설치
    # apt install senlin-*
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Note, selecting ‘senlin-api’ for glob ‘senlin-*’
    Note, selecting ‘senlin-doc’ for glob ‘senlin-*’
    Note, selecting ‘senlin-engine’ for glob ‘senlin-*’
    Note, selecting ‘senlin-common’ for glob ‘senlin-*’
    The following packages were automatically installed and are no longer required:
    linux-headers-4.15.0-29 linux-headers-4.15.0-29-generic linux-image-4.15.0-29-generic linux-modules-4.15.0-29-generic linux-modules-extra-4.15.0-29-generic
    Use ‘apt autoremove’ to remove them.
    The following additional packages will be installed:
    dbconfig-common golang-docker-credential-helpers libsecret-1-0 libsecret-common python-backports.ssl-match-hostname python-docker python-dockerpycreds python-jsonpath-rw python-qpid python-senlin
    python-websocket sqlite3
    Suggested packages:
    dbconfig-mysql | dbconfig-pgsql | dbconfig-sqlite | dbconfig-sqlite3 | dbconfig-no-thanks sqlite3-doc
    The following NEW packages will be installed:
    dbconfig-common golang-docker-credential-helpers libsecret-1-0 libsecret-common python-backports.ssl-match-hostname python-docker python-dockerpycreds python-jsonpath-rw python-qpid python-senlin
    python-websocket senlin-api senlin-common senlin-doc senlin-engine sqlite3
    0 upgraded, 16 newly installed, 0 to remove and 2 not upgraded.
    Need to get 4419 kB of archives.
    After this operation, 18.1 MB of additional disk space will be used.
    Do you want to continue? [Y/n]
  • 설정 파일 수정

    # cat /etc/senlin/senlin.conf
    [DEFAULT]
    transport_url = rabbit://openstack:{패스워드}@controller
    default_region_name = {region 명}
    debug = true

    [senlin_api]
    bind_host = 0.0.0.0
    bind_port = 8777

    [database]
    connection = mysql+pymysql://senlin:{패스워드}@controller/senlin

    [keystone_authtoken]
    service_token_roles_required = True
    auth_type = password
    user_domain_name = Default
    project_domain_name = Default
    project_name = service
    username = senlin
    password = {패스워드}
    www_authenticate_uri = http://controller:5000/identity/v3
    auth_url = http://controller:5000/identity

    [matchmaker_redis]
    [oslo_messaging_amqp]
    [oslo_messaging_kafka]

    [oslo_messaging_notifications]
    driver = messaging

    [oslo_messaging_rabbit]
    rabbit_host = controller
    rabbit_userid = openstack
    rabbit_password = %ckqTkfntseo!83

    [oslo_messaging_zmq]
    [oslo_policy]
    [ssl]

    [authentication]
    auth_url = http://controller:5000/v3
    service_username = senlin
    service_password = {패스워드}
    service_project_name = service

  • db 테이블 생성
    # senlin-manage db_sync
    2020-05-20 11:17:01.488 7392 INFO migrate.versioning.api [req-62dfbfc7-dc57-48df-9ae0-c01d2b6a3412 – – – – -] 0 -> 1…
    2020-05-20 11:17:02.276 7392 INFO migrate.versioning.api [req-62dfbfc7-dc57-48df-9ae0-c01d2b6a3412 – – – – -] done
    2020-05-20 11:17:02.276 7392 INFO migrate.versioning.api [req-62dfbfc7-dc57-48df-9ae0-c01d2b6a3412 – – – – -] 1 -> 2…
    2020-05-20 11:17:02.345 7392 INFO migrate.versioning.api [req-62dfbfc7-dc57-48df-9ae0-c01d2b6a3412 – – – – -] done
    2020-05-20 11:17:02.346 7392 INFO migrate.versioning.api [req-62dfbfc7-dc57-48df-9ae0-c01d2b6a3412 – – – – -] 2 -> 3…
    ..
    ..
  • 서비스 재시작
    # systemctl restart senlin-*
  • 확인
    # openstack cluster build info
    +——–+———————+
    | Field | Value |
    +——–+———————+
    | api | { |
    | | “revision”: “1.0” |
    | | } |
    | engine | { |
    | | “revision”: “1.0” |
    | | } |
    +——–+———————+

Category: 가상화/클라우드

장영호

About the Author ()