대부분의 오픈스택 서비스들은 그 정보를 데이터베이스에 저장합니다. 이러한 데이터베이스 서버는 전형적으로 컨트롤러 노드에서 실행되는데 MySQL, MariaDB, PostgreSQL 등이 일반적으로 오픈스택에서 사용되는 데이터베이스 프로그램들입니다. 여기선 MariaDB 서버를 구성하고자 합니다.
MariaDB 서버 설치 및 실행
1. mariaDB 설치
apt install mariadb-server python3-pymysql -y
2. mariaDB 설정 수정
vim /etc/mysql/mariadb.conf.d/50-server.cnf
:27 bind-address = [controller Node IP]
:90 # * InnoDB
:91 default-storage-engine = innodb
:92 innodb_file_per_table = on
:93 max_connections = 4096
:94 character-set-server = utf8
:95 #collation-server = utf8mb4_general_ci
- 27 : MariaDB 서버가 수신할 네트워크 인터페이스의 IP 주소를 설정하는 과정으로, 컨트롤러 노드에서 두개 이상의 네트워크 인터페이스가 있을 경우 오픈스택 서비스 간의 관리를 위해 사용되는 IP주소를 입력해야 합니다.
- 91 : 기본 저장 엔진을 InnoDB로 설정합니다.
- 92 : 각 InnoDB 테이블을 별도의 파일로 저장하도록 설정합니다.
- 93 : MariaDB에 허용되는 최대 동시 연결 수를 설정합니다.
- 94 : 서버의 기본 문자 세트를 UTF-8로 설정합니다.
- 95 : 'utf8_general_ci' 가 아닌 시스템의 기본 정렬 설정을 사용합니다.
3. mariaDB 서버 재시작
systemctl restart mariadb.service
4. mariaDB 초기화
root@controller:~# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] n
... skipping.
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] Y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] Y
... Success!
By default, MariaDB comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] Y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] Y
... Success!
Cleaning up...
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!
mysql_secure_installation 스크립트를 실행하여 데이터베이스 root 계정에 대해 알맞은 암호를 설정합니다.
5. mariaDB 계정 설정 검증
RabbitMQ 서버 설치
openstack은 서비스 간 작업과 상태정보에 대한 상호 교환 및 조정을 위해 Message Queue를 사용합니다. 오픈스택 구성요소들은 REST-call을 통해 내부에서 서로 통신하는데, RabbitMQ 서버는 AMQP 브로커로서 오픈스택 요소 사이에 위치하며 서로 통신하도록 돕는 역할을 합니다.
일반적으로 Message Queue는 Controller 노드에서 동작합니다.
1. RabbitMQ 설치
apt install rabbitmq-server -y
systemctl status rabbitmq-server
2. RabbitMQ 사용자 추가
rabbitmqctl add_user openstack [passwd값]
3. openstack 사용자에 권한 설정
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
위 과정에서 생성한 사용자 openstack에게 권한을 부여합니다.
여기서 첫번째 ".*" 는 설정, 두번째 ".*" 는 쓰기, 세번째 ".*" 는 읽기에 관한 권한입니다.
systemctl restart rabbitmq-server
rabbitmq-server 서비스를 재시작해줍니다.
rabbit MQ의 비번이 나중에 Nova-compute설정과 맞지않으면 Nova-compute가 정상동작하지 않으니 주의해야 합니다.
4. 방화벽에 RabbitMQ 서버 포트 추가(선택)
제 구축과정에선 방화벽을 사용하고 있지 않기 때문에 할 필요는 없지만, 방화벽을 사용하고 있다면 RabbitMQ 서버가 사용하는 포트를 추가하고 firewall을 다시 시작한 후 추가한 포트를 확인해줘야 합니다.
Memcached 서버 설치
Memcached 데몬은 여러 가지 목적으로 사용되는 분산 메모리 캐싱 시스템입니다.
외부 데이터 소스를 읽어야 할 경우 그 접속하는 전체 횟수를 감소시키기 위해, 인증에 사용하는 토큰 같은 임시 데이터를 캐시에 저장해 속도를 빠르게 하기 위해 일반적으로 사용됩니다.
1. Memcached 설치
apt install memcached -y
2. Memcached 설정 수정
vim /etc/memcached.conf
35 : -l [controller IP 주소]
3. Memcached 데몬 재시작
systemctl enable memcached && systemctl restart memcached && systemctl status memcached
openstack | yoga 버전 수동 설치(작성중)
신입으로 입사하였을때 오픈스택을 packstack, triple-o, ansible, kolla-ansible 방식으로 배포 테스트 해보았는데 자동화 설치 툴로 설치를 하다보니 각 구성요소가 어떻게 배포하는지 알지 못하는 문제
velog.io
'OpenStack > Real Server' 카테고리의 다른 글
[실습] 3-1. Keystone 재구성하기(수정 중) (0) | 2024.07.10 |
---|---|
[실습/Failed] 3. Keystone 구성하기(Failed) (0) | 2024.07.05 |
[실습] 1. Openstack 환경 설정하기 (0) | 2024.07.04 |