Tuesday, 31 May 2016

[Maria/MySQL] How to install TokuDB storage engine and set it enabled.(TokuDB 스토리지 엔진 설치 및 사용방법)

TokuDB is available on the following distributions:
DistributionIntroduced
CentOS 6 64-bit and newerMariaDB 5.5.36 and MariaDB 10.0.9
Debian 7 "wheezy"64-bit and newerMariaDB 5.5.33 and MariaDB 10.0.5
Fedora 19 64-bit and newerMariaDB 5.5.33 and MariaDB 10.0.5
openSUSE 13.1 64-bit and newerMariaDB 5.5.41 and MariaDB 10.0.15
Red Hat 6 64-bit and newerMariaDB 5.5.36 and MariaDB 10.0.9
Ubuntu 12.10 "quantal" 64-bit and newerMariaDB 5.5.33 and MariaDB 10.0.5

1. Installing TokuDB
TokuDB has been included with MariaDB since MariaDB 5.5.34 and MariaDB 10.0.6 and does not require separate installation.

1.1. Installing TokuDB on Fedora, RedHat, & CentOS

# yum install MariaDB-tokudb-engine

1.2. Installing TokuDB on Ubuntu & Debian

# apt-get install mariadb-tokudb-engine-5.5

I have 10.1.12 MariaDB. So don't not need to install tokudb engine package.

2. Enabling TokuDB

2.1. Enabling TokuDB in configuration file

It is applied after starting or restarting.

# vi /etc/my.cnf.d/tokudb.cnf
[mariadb]
# See https://mariadb.com/kb/en/how-to-enable-tokudb-in-mariadb/
# for instructions how to enable TokuDB
#
# See https://mariadb.com/kb/en/tokudb-differences/ for differences
# between TokuDB in MariaDB and TokuDB from http://www.tokutek.com/

plugin-load-add=ha_tokudb.so


2.2. Enabling TokuDB when MariaDB is running

# mysqld --plugin-load=ha_tokudb --plugin-dir=<MariaDB Library Directory>/plugin



2.3. Enabling TokuDB manually from the mysql command line

# mysql -uroot -p


INSTALL SONAME 'ha_tokudb';



3. Create TokuDB Engine Table

CREATE TABLE TB_IOT_DHT_DATA
(
 MCU_NO int NOT NULL COMMENT 'MCU번호',
 SENSOR_NO int NOT NULL COMMENT '센서번호',
 SENSOR_DT datetime NOT NULL COMMENT '센서일시',
 SERVER_DT datetime COMMENT '서버일시',
 HUMI double COMMENT '습도',
 TEMP_C double COMMENT '섭씨온도',
 TEMP_F double COMMENT '화씨온도',
 LOC_LAT double COMMENT '위도',
 LOC_LON double COMMENT '경도',
 VOLTAGE int COMMENT '전압',
 PRIMARY KEY (MCU_NO, SENSOR_NO, SENSOR_DT)
) COMMENT = '온습도수집데이터', ENGINE = 'TokuDB';

No comments:

Post a Comment