Menu Close

Souce Install MariaDB 10.3 on CentOS 7

Souce Install MariaDB 10.3 on CentOS 7

 

의존성 패키지 설치 (10.3 버전은 gnutls-devel 패키지가 필수)

yum -y install cmake make gcc gcc-c++ ncurses-devel libevent openssl openssl-devel gnutls-devel libxml2 libxml2-devel bison wget

 

유저생성

useradd -M -r -s /sbin/nologin maria

 

mariadb 다운로드 (link : https://downloads.mariadb.org/)

cd /data/apps/dn
wget https://downloads.mariadb.org/f/mariadb-10.3.12/source/mariadb-10.3.12.tar.gz/from/http%3A//ftp.kaist.ac.kr/mariadb/?serve --content-disposition

 

mariadb 압축해제

tar xvzf mariadb-10.3.12.tar.gz

 

configure

mkdir /data/apps/dn/mariadb-10.3.12/target
cd /data/apps/dn/mariadb-10.3.12/target

cmake .. \
-DCMAKE_INSTALL_PREFIX=/data/apps/src/mariadb-10.3.12 \
-DINSTALL_SYSCONFDIR=/data/apps/src/mariadb-10.3.12/etc \
-DINSTALL_SUPPORTFILESDIR=/data/apps/src/mariadb-10.3.12/support-files \
-DTMPDIR=/data/apps/src/mariadb-10.3.12/tmp \
-DPID_FILE_DIR=/data/apps/src/mariadb-10.3.12 \
-DDAEMON_NAME=mariadb \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_DATADIR=/data/apps/src/mariadb-10.3.12/data \
-DMYSQL_UNIX_ADDR=/data/apps/src/mariadb-10.3.12/mysql.sock \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_READLINE=1 \
-DWITH_SSL=bundled \
-DWITH_ZLIB=system \
-DWITH_JEMALLOC=no \
-DWITH_EXTRA_CHARSETS=all \
-DWITH_ARIA_STORAGE_ENGINE=1 \
-DWITH_XTRADB_STORAGE_ENGINE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 \
-DWITH_PARTITION_STORAGE_ENGINE=1 \
-DWITH_FEDERATEDX_STORAGE_ENGINE=1 \
-DWITH_QUERY_CACHE_INFO=1 \
-DWITH_QUERY_RESPONSE_TIME=1 \
-DWITH_SAFEMALLOC=AUTO \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci

 

컴파일 및 설치

make && make install

 

권한 수정 및 tmp, logs 디렉토리 생성

mkdir /data/apps/src/mariadb-10.3.12/tmp /data/apps/src/mariadb-10.3.12/logs
chown maria. /data/apps/src/mariadb-10.3.12

 

링크생성

cd /data/apps/ln
ln -s /data/apps/src/mariadb-10.3.12 mariadb

 

mariadb 설정파일 편집
: vi /data/apps/ln/mariadb/etc/my.cnf

https://github.com/fallboyz/umount.net-config/blob/master/mariadb/my.cnf

 

systemd 파일생성
: vi /etc/systemd/system/mariadb.service

https://github.com/fallboyz/umount.net-config/blob/master/mariadb/systemd.mariadb.service

 

systemd 등록 및 실행

systemctl enable mariadb
systemctl start mariadb

 

log directory 링크

ln -s /data/apps/ln/mariadb/logs/ /data/logs/mariadb

 

TIP. [MysqlTuner]를 이용하여 자신의 서버에 맞게 옵션 튜닝

 

댓글 남기기

이메일은 공개되지 않습니다. 필수 입력창은 * 로 표시되어 있습니다

This site uses Akismet to reduce spam. Learn how your comment data is processed.