ColumnStore 1.2 を non-root ユーザでインストール

2019年7月23日に MariaDB のDWH(データウェアハウス), BI用列指向RDBMS, MariaDB ColumnStore 1.2.5 がリリースされました。昨今はセキュリティ要件から non-root ユーザでのインストール/運用が行われる場合も多いため,今回は ColumnStore 1.2 を non-root  ユーザでインストールする手順について解説したいと思います。

実行環境

  • OS: CentOS 7.6.1810
  • ColumnStore モジュール構成: single combined (UM+PM)
  • インストール/実行ユーザ: maria
  • インストール先: ~maria

公式ドキュメント(Knowledge Base)

Preparing for ColumnStore Installation – 1.2.0
Installing and Configuring a Single Server ColumnStore System – 1.2.x

事前準備(rootユーザで実行)

OS設定変更

以下のファイルの設定変更を root ユーザで実施します。

#/etc/rc.d/rc.local
/sbin/ifconfig eth0 txqueuelen 10000
#/etc/sysctl.conf
# increase TCP max buffer size
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216

# increase Linux autotuning TCP buffer limits
# min, default, and max number of bytes to use
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 65536 16777216

# don't cache ssthresh from previous connection
net.ipv4.tcp_no_metrics_save = 1

# recommended to increase this for 1000 BT or higher
net.core.netdev_max_backlog = 2500

vm.vfs_cache_pressure = 10
#/etc/security/limits.conf
mariadb hard nofile 65536
mariadb soft nofile 65536

firewalld を停止/無効化

firewalld を停止します。可能であれば SELinux も disabled にしておくことを推奨いたします。

systemctl status firewalld  
systemctl stop firewalld  
systemctl disable firewalld

上記の設定変更後,設定の反映のため OS を reboot しておくことを推奨いたします。

依存パッケージのインストール

yum -y install boost
yum -y install expect perl perl-DBI openssl zlib file sudo libaio rsync 
yum -y install snappy net-tools numactl-libs nmap
yum -y install epel-release
yum -y install jemalloc

インストール作業(maria ユーザで実行)

ColumnStore bin tarball ダウンロード

ColumnStore 1.2.5 binary tarball をダウンロード/展開します。

cd $HOME
curl -O https://downloads.mariadb.com/ColumnStore/1.2.5/centos/x86_64/7/mariadb-columnstore-1.2.5-1-centos7.x86_64.bin.tar.gz
tar xf mariadb-columnstore-1.2.5-1-centos7.x86_64.bin.tar.gz

クイックインストーラを実行

ColumnStore 1.2 から導入されたクイックインストーラで初期設定を行います。

cd $HOME
./mariadb/columnstore/bin/quick_installer_single_server.sh

root 権限で syslog 設定を行います。

sudo su -
export COLUMNSTORE_INSTALL_DIR=/home/maria/mariadb/columnstore
export LD_LIBRARY_PATH=${COLUMNSTORE_INSTALL_DIR}/lib:${COLUMNSTORE_INSTALL_DIR}/mysql/lib
cd ~maria
./mariadb/columnstore/bin/syslogSetup.sh --installdir=$COLUMNSTORE_INSTALL_DIR install

mcsadmin getSystemInfo によるシステム情報確認

初期設定が完了後,mcsadmin getSystemInfo により ColumnStore システムのステータス確認を行います。

[maria@mcs12 ~]$ ma getsystemi
getsysteminfo   Fri Jul 26 12:11:18 2019

System columnstore-1
System and Module statuses

Component     Status                       Last Status Change
------------  --------------------------   ------------------------
System        ACTIVE                       Fri Jul 26 12:09:24 2019
Module pm1    ACTIVE                       Fri Jul 26 12:09:21 2019

MariaDB ColumnStore Process statuses

Process             Module    Status            Last Status Change        Process ID
------------------  ------    ---------------   ------------------------  ----------
ProcessMonitor      pm1       ACTIVE            Fri Jul 26 12:08:50 2019        6008
ProcessManager      pm1       ACTIVE            Fri Jul 26 12:08:56 2019        6145
DBRMControllerNode  pm1       ACTIVE            Fri Jul 26 12:09:00 2019        6553
ServerMonitor       pm1       ACTIVE            Fri Jul 26 12:09:02 2019        6575
DBRMWorkerNode      pm1       ACTIVE            Fri Jul 26 12:09:02 2019        6609
PrimProc            pm1       ACTIVE            Fri Jul 26 12:09:06 2019        6680
ExeMgr              pm1       ACTIVE            Fri Jul 26 12:09:10 2019        6764
WriteEngineServer   pm1       ACTIVE            Fri Jul 26 12:09:14 2019        6847
DDLProc             pm1       ACTIVE            Fri Jul 26 12:09:18 2019        6954
DMLProc             pm1       ACTIVE            Fri Jul 26 12:09:22 2019        6990
mysqld              pm1       ACTIVE            Fri Jul 26 12:09:02 2019        6493

Active Alarm Counts: Critical = 0, Major = 0, Minor = 0, Warning = 0, Info = 0

すべてのステータスが ACTIVE になっていますので,ColumnStoreシステムは正常に稼働しているようです。

MariaDB monitor の起動

ColumnStore では MariaDB Community/Enterprise Server と異なり,MariaDB monitor(CLIクライアント)は ${COLUMNSTORE_INSTALL_DIR}/mysql/bin/mysql にあり,mcsmysql という alias が設定されています。

[maria@mcs12 ~]$ mcsmysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 10.3.16-MariaDB-log Columnstore 1.2.5-1

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

ColumnStore Backup Tool 1.2 のインストール

バージョン 1.1 以降 ColumnStore 専用のバックアップツールが提供されています。

Backup and Restore for MariaDB ColumnStore 1.1.0 onwards

この columnstoreBackup / columnstoreRestore を含む ColumnStore Tools は BSL(Business Source License)でライセンスされています。
インストールは以下のように行うことができます。

cd $HOME
mkdir tools-1.2.5
cd tools-1.2.5
curl -O https://downloads.mariadb.com/ColumnStore-Tools/1.2.5/centos/x86_64/7/mariadb-columnstore-tools-1.2.5-1.bin.tar.gz
tar xvf mariadb-columnstore-tools-1.2.5-1.bin.tar.gz
cp -pf backuprestore/columnstoreBackup ~/
cp -pf backuprestore/columnstoreRestore ~/