top of page
  • 작성자 사진김영찬

CDP PvC Install #2 - DBMS Install & Setup


Cloudera CDP PvC(Private Cloud Base)의 Cloudera Manager를 위한 관리용 DBMS를 설치하고 setup하기 위한 내용을 설명합니다. DBMS는 MariaDB를 기준으로 설명합니다.





// 기존 OS에 설치된 DB 삭제(CDP Trial embedded PostgreSQL 사용시 - 가동중 PostgreSQL 시작 안됨)

  • yum remove postgresql*

// DBMS(MariaDB/MySQL) Local Repository로 설정 --> MariaDB Installation 상세 절차 참조

  • MariaDB Download :

  • /etc/yum.repos.d/MariaDB.repo

[mariadb]

name=MariaDB

baseurl=http://server:port/rpm/mariadb10.2/

enabled=1

gpgheck=0

// DBMS(MariabDB/MySQL) 설치 및 설정

  • yum repolist all

  • yum install -y MariaDB

  • systemctl start mariadb

  • systemctl enable mariadb

// MariaDB 설정 및 Characteret 변경(Cloudera CDP는 utf8, 일반 개발은 utf8mb4로 설정)

  • mysql -u root -p

  • MariaDB > SHOW VARIABLES LIKE 'char%'; // 현재 characterset 설정 확인

  • MariaDB > status

  • /etc/my.cnf에 다음 내용 설정(Cloudera MariaDB 설치 및 설정)

  • my.cnf (MariaDB 용, MySQL용은 조금 다름)

# Cloudera Mariadb Settings(일반 설정에서는 상황에 따라 제외)

[mysqld]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

transaction-isolation = READ-COMMITTED

# Disabling symbolic-links is recommended to prevent assorted security risks;

# to do so, uncomment this line:

symbolic-links = 0

# Settings user and group are ignored when systemd is used.

# If you need to run mysqld under a different user or group,

# customize your systemd unit file for mariadb according to the

key_buffer = 16M

key_buffer_size = 32M

max_allowed_packet = 32M

thread_stack = 256K

thread_cache_size = 64

query_cache_limit = 8M

query_cache_size = 64M

query_cache_type = 1

max_connections = 550

#log_bin should be on a disk with enough free space.

#Replace '/var/lib/mysql/mysql_binary_log' with an appropriate path for your

#system and chown the specified folder to the mysql user.

log_bin=/var/lib/mysql/mysql_binary_log

#In later versions of MariaDB, if you enable the binary log and do not set

#a server_id, MariaDB will not start. The server_id must be unique within

#the replicating group.

server_id=1

binlog_format = mixed

read_buffer_size = 2M

read_rnd_buffer_size = 16M

sort_buffer_size = 8M

join_buffer_size = 8M

# InnoDB settings

innodb_file_per_table = 1

innodb_flush_log_at_trx_commit = 2

innodb_log_buffer_size = 64M

innodb_buffer_pool_size = 4G

innodb_thread_concurrency = 8

innodb_flush_method = O_DIRECT

innodb_log_file_size = 512M

[mysqld_safe]

log-error=/var/log/mariadb/mariadb.log

pid-file=/var/run/mariadb/mariadb.pid

#

# include all files from the config directory

#

!includedir /etc/my.cnf.d

// MariaDB Characterset 설정(필요시 설정, Cloudera CDP는 utf8 권장. utf8mb4는 안됨)

[mysqld]

default_storage_engine=innodb

skip-character-set-client-handshake

init-connect="SET collation_connection = utf8_general_ci"

init-connect="SET NAMES utf8 COLLATE utf8_general_ci"

character-set-server=utf8

collation-server=utf8_general_ci

lower_case_table_names=1

skip-character-set-client-handshake

[client]

port=3306

default-character-set = utf8

[mysqldump]

default-character-set = utf8

[mysql]

default-character-set = utf8

// MariaDB Secure Installation

  • systemctl start mariadb // 설정을 위해 stop 시킨 MariaDB 재시작

  • /usr/bin/mariadb-secure-installation 실행

  • 아래 항목을 'Y'로 설정 // 나머지는 n로 설정

Remove anonymous Users ? Y, Disallow root login remotely ? Y, Remove test database ? Y, Reload privileage tables ? Y

  • mysql의 경우 /usr/bin/mysql_secure_installation으로 이름이 다름

// MariaDB 설치 확인

  • mysql -u root -p"password" -D mysql // -p 옵션 뒤에는 공백이 없이 암호가 와야 한다.

  • MariaDB > show databases;

// Cloudera CDP database 생성 및 확인 --> mysql-setup.sql (MySQL과 MariaDB는 동일)

  • DROP DATABASE IF EXISTS scm; --> CREATE DATABASE scm --> GRANT ALL ON scm --> … --> flush privileges

  • mysql -u root -p"password" < mysql-setup.sql

  • mysql -u root -p"password" -e 'SHOW DATABASES'

  • Install and Configure MariaDB for Cloudera Software

  • Install and Configure MySQL for CLoudera Software

// DBMS(MySQL) JDBC Connector 설치 확인

  • ls -l /usr/share/java/mysql* // mysql-connector-java.jar

// MYSQL client 설치(cmhost에 MariaDB가 설치 안된 경우)

  • DBMS가 Cloudera Manager Host(cmhost)에 설치되어 있지 않는 경우 원격 접속을 위한 client 설치 필요(그외 필요한 서버에서도)

  • yum install mysql -- MariaDB client 설치

// DBMS 접속 테스트(local 혹은 원격에서 DB 접속 및 Cloudera DB 생성 확인)

  • mysql 명령으로 DBMS 서버에 접속 가능 여부 확인

mysql -htools.futuresoft.co.kr -P3306 -uscm -ppassword -Dscm

조회수 30회댓글 0개

최근 게시물

전체 보기
bottom of page