여러 OpenStack 서비스는 데이터베이스 유지 관리를 통해 중요한 리소스, 사용량 및 기타 정보를 추적합니다. 기본적으로 개별 SQLite 데이터베이스가 이 용도로 지정되며 단일 노드 구성에 유용합니다. 다중 노드 구성의 경우 이 정보를 저장하는 데 MySQL 데이터베이스가 권장됩니다.
컨트롤러 노드의 기본 IP 주소를 사용하여 해당 노드와 연결된 기본 이름을 확인합니다.
controller# getent hosts controller-IP controller-IP controller-name
controller# pkg install mysql-55
controller# pkg install mysql-55/client
controller# svcadm enable mysql:version_55
controller# mysqladmin -u root password MySQL-root-password
CreateOpenStack에서 사용될 테이블을 만듭니다. 해당 데이터베이스에 대해 배타적 액세스를 제공하기 위해 컨트롤러 노드의 서비스에 권한을 부여합니다. 이전 getent hosts 명령으로 출력된 controller-name을 사용합니다.
controller# mysql -u root -p Enter password: MySQL-root-password mysql> create database cinder; mysql> grant all privileges on cinder.* \ -> to 'cinder'@'controller-name' \ -> identified by 'cinder'; mysql> create database glance; mysql> grant all privileges on glance.* \ -> to 'glance'@’controller-name’ \ -> identified by 'glance'; mysql> create database keystone; mysql> grant all privileges on keystone.* \ -> to 'keystone'@’controller-name’ \ -> identified by 'keystone'; mysql> create database nova; mysql> grant all privileges on nova.* \ -> to 'nova'@’controller-name’ \ -> identified by 'nova'; mysql> flush privileges; mysql> quit
controller# pkg install python-mysql