YJWANG

[ OpenStack / CentOS 7.X ] Openstack Prerequisite 본문

60.Cloud/60.OpenStack

[ OpenStack / CentOS 7.X ] Openstack Prerequisite

왕영주 2021. 2. 26. 17:28

[ OpenStack / CentOS 7.X ] Openstack Prerequisite


refer to : https://docs.openstack.org/install-guide/openstack-services.html#minimal-deployment-for-train

prerequisite

본 실습에선 Firewalld를 모두 중지한 상태에서 진행할 예정

Configure Network Interface


https://docs.openstack.org/install-guide/environment-networking-controller.html

Controller node

Management Interface

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether ca:fe:02:00:c0:20 brd ff:ff:ff:ff:ff:ff
    inet 10.99.99.22/24 brd 10.99.99.255 scope global dynamic eth0
       valid_lft 3296sec preferred_lft 3296sec
    inet6 fe80::c8fe:2ff:fe00:c020/64 scope link 
       valid_lft forever preferred_lft forever

Provider Interface

[root@yjwang0-stack-03 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 
DEVICE="eth1"
BOOTPROTO="none"
ONBOOT="yes"
TYPE="Ethernet"

hosts file

[root@yjwang0-stack-03 ~]# cat /etc/hosts
...
# controller
10.99.99.22    controller
# compute
10.99.99.23    compute
# blck
10.99.99.23    block

Compute node

Management Interface

[root@yjwang0-stack-02 ~]# ip a show dev eth0
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether ca:fe:02:00:c0:21 brd ff:ff:ff:ff:ff:ff
    inet 10.99.99.23/24 brd 10.99.99.255 scope global dynamic eth0
       valid_lft 3281sec preferred_lft 3281sec
    inet6 fe80::c8fe:2ff:fe00:c021/64 scope link 
       valid_lft forever preferred_lft forever

Provider Interface

[root@yjwang0-stack-02 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 
DEVICE="eth1"
BOOTPROTO="none"
ONBOOT="yes"
TYPE="Ethernet"

hosts file

[root@yjwang0-stack-02 ~]# cat /etc/hosts
...
# controller
10.99.99.22    controller
# compute
10.99.99.23    compute
# blck
10.99.99.23    block

Block node

https://docs.openstack.org/install-guide/environment-networking-storage-cinder.html

compute node와 동일한 서버로 사용하여 별도 설정 x

Configure NTP


https://docs.openstack.org/install-guide/environment-ntp-controller.html

Controller / Compute

Install chrony package

[root@yjwang0-stack-03 ~]# yum -y install chrony

chrony.conf

[root@yjwang0-stack-03 ~]# grep -Ev "^$|^#" /etc/chrony.conf 
server 10.99.99.22 iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
allow 10.99.99.0/24
logdir /var/log/chrony

compute node에서는 allow 부분 없이 설정합니다.

restart chronyd

[root@yjwang0-stack-03 ~]# systemctl restart chronyd

Confirm

[root@yjwang0-stack-03 ~]# timedatectl 
      Local time: Fri 2021-02-26 01:31:19 UTC
  Universal time: Fri 2021-02-26 01:31:19 UTC
        RTC time: Fri 2021-02-26 01:31:20
       Time zone: UTC (UTC, +0000)
     NTP enabled: yes
NTP synchronized: yes

[root@yjwang0-stack-03 ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* controller                   10   6   377   171  -1939ns[  -11us] +/-   24us

Openstack Package installation steps


https://docs.openstack.org/install-guide/environment-packages-rdo.html#finalize-the-installation

Install Openstack repo

[root@yjwang0-stack-03 ~]# yum install -y centos-release-openstack-train

Upgrade packages on all nodes

[root@yjwang0-stack-03 ~]# yum -y upgrade

Install Openstack Client

[root@yjwang0-stack-03 ~]# yum install -y python-openstackclient

For setting SELinux automatically

[root@yjwang0-stack-03 ~]# yum install -y openstack-selinux

SQL Database


https://docs.openstack.org/install-guide/environment-sql-database-rdo.html

controller node

[root@yjwang0-stack-03 ~]# yum -y install mariadb mariadb-server python2-PyMySQL

configure

파일이 없다면 생성하세요

[root@yjwang0-stack-03 ~]# cat /etc/my.cnf.d/openstack.cnf 
[mysqld]
bind-address = 10.99.99.22

default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

enable and start DB service

[root@yjwang0-stack-03 ~]# systemctl enable mariadb.service --now

configure security for db

[root@yjwang0-stack-03 ~]# mysql_secure_installation
root / testtest

Message queue


https://docs.openstack.org/install-guide/environment-messaging-rdo.html

Controller node

[root@yjwang0-stack-03 ~]# yum -y install rabbitmq-server

enable and start rabbitmq service

[root@yjwang0-stack-03 ~]# systemctl enable rabbitmq-server.service --now

Add openstack user in rebbitmq

[root@yjwang0-stack-03 ~]# rabbitmqctl add_user openstack testtest
Creating user "openstack"

Permit configuration, write, and read access for openstack user

[root@yjwang0-stack-03 ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/"

Memcached


https://docs.openstack.org/install-guide/environment-memcached.html

Identity service authentication 서버가 (keyston) token cache서버로 memcache를 사용함

controller node

[root@yjwang0-stack-03 ~]# yum -y install memcached python-memcached

enable other nodes can access to controller node via management address

[root@yjwang0-stack-03 ~]# tail /etc/sysconfig/memcached 
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="64"
OPTIONS="-l 127.0.0.1,::1,controller"

enable/start

[root@yjwang0-stack-03 ~]# systemctl enable memcached.service --now

Etcd


https://docs.openstack.org/install-guide/environment-etcd.html

key:value 형태의 data를 저장하기위한 용도로 사용

controller node

[root@yjwang0-stack-03 ~]# yum -y install etcd

Make server to other server can access via management network

[root@yjwang0-stack-03 ~]# tail -12 /etc/etcd/etcd.conf 

#[Member]
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://10.99.99.22:2380"
ETCD_LISTEN_CLIENT_URLS="http://10.99.99.22:2379"
ETCD_NAME="controller"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.99.99.22:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://10.99.99.22:2379"
ETCD_INITIAL_CLUSTER="controller=http://10.99.99.22:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new"

enable /start

[root@yjwang0-stack-03 ~]# systemctl enable etcd --now
반응형