오븐스댁의 대부분은 DB와 연동해서 서비스를 관리하다보니 DB설치는 필수다요
고맙게도 mariadb,mysql,postgreSQL 기타 다른 DB도 지원한다고 하나
결국 우리는 마리아로 갈것아닌가?
대세를 따라보련다.
DB는 contorller node 에만 설치해도 됨
[root@7controller ~]# yum install mariadb mariadb-server python2-PyMySQL
Dependencies Resolved
===============================================================================================================
Package Arch Version Repository Size
===============================================================================================================
Installing:
mariadb x86_64 3:10.3.10-1.el7.0.0.rdo2 centos-openstack-stein 6.0 M
mariadb-server x86_64 3:10.3.10-1.el7.0.0.rdo2 centos-openstack-stein 16 M
python2-PyMySQL noarch 0.9.2-2.el7 centos-openstack-stein 92 k
Installing for dependencies:
mariadb-errmsg x86_64 3:10.3.10-1.el7.0.0.rdo2 centos-openstack-stein 226 k
psmisc x86_64 22.20-15.el7 base 141 k
Transaction Summary
===============================================================================================================
Install 3 Packages (+2 Dependent packages)
Total download size: 23 M
Installed size: 121 M
/etc/my.cnf.d/openstack.cnf 파일 생성 및 편집
/etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 10.0.0.11
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
오븐스댁 홈피에서 저렇게 하라고했으니, 육군만기전역한 나는 까라면 깠다.
다만 bind-address 를 꼭 사용해줌으로써 다른 노드에서도 접근할 수 있도록 해주는 것은 잊지않도록(찡끗)
근데 살짝 의문이 드는 것이
mysql 시절 mysql 의 설정이 적용되는 값은 /etc/my.cnf 파일이 기준이 되었다.
저렇게 새롭게 cnf 파일을 만들면 그게 적용이 될까? 하는 의문이 들더라.
우선 mysql 에서 mariadb 의 설정 파일 위치가 OS버전이되었던 DBMS의 버전때문이던
달라졌다 라는 생각이 들고
아무것도 설정 안한상태에서 서비스를 시작하니, IPv6 로 전체 binding 이 되더라,
앞서 오븐스댁이 알려준 파일을 그 위치에 두니, 10.0.0.11 로 binding 이 되는 것을 보면
내가 원하는 설정 파일이 잘 적용했음을 알 수 있다.
[root@7controller my.cnf.d]# mv openstack.cnf ../o.c
[root@7controller my.cnf.d]# systemctl start mariadb
[root@7controller my.cnf.d]# netstat -na|grep 33
tcp6 0 0 :::3306 :::* LISTEN
unix 3 [ ] STREAM CONNECTED 24533
[root@7controller my.cnf.d]# systemctl stop mariadb
[root@7controller my.cnf.d]# mv ../o.c openstack.cnf
[root@7controller my.cnf.d]# systemctl start mariadb
[root@7controller my.cnf.d]# netstat -na|grep 33
tcp 0 0 10.0.0.11:3306 0.0.0.0:* LISTEN
unix 3 [ ] STREAM CONNECTED 24533
여튼 난 착하니깐 오븐스댁의 가이드를 의심하며 따라본다.
[root@7controller ~]# systemctl enable mariadb.service
Created symlink from /etc/systemd/system/mysql.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/mysqld.service to /usr/lib/systemd/system/mariadb.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
[root@7controller ~]# 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
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.
Set 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!
명령어 요약
# yum install mariadb mariadb-server python2-PyMySQL
# cat > /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 10.0.0.11
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
# systemctl enable mariadb.service
# systemctl start mariadb.service
# mysql_secure_installation
'IT > LINUX' 카테고리의 다른 글
오븐스댁 memcached,etcd 설치 (0) | 2019.06.04 |
---|---|
오븐스댁 메시지큐 MQ 설치 (0) | 2019.06.04 |
오븐스댁 기본 패키지 설치스 (0) | 2019.06.04 |
오븐스댁 네드워그 레이아웃 (0) | 2019.06.03 |
스데인 최소 배포 서비스 (0) | 2019.05.30 |