官方文档https://mariadb.com/kb/en/library/mariadb-columnstore/

推荐使用最新1.2.x最新版本。

先决条件

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

安装1.0的jemalloc,可下载rpm包如jemalloc-3.6.0-1.el7.x86_64.rpm。

安装(单机)

推荐下载linux二进制版本https://downloads.mariadb.com/ColumnStore/1.2.2/centos/x86_64/7/mariadb-columnstore-1.2.2-1-centos7.x86_64.bin.tar.gz,更加透明。

直接运行自带shell命令/usr/local/mariadb/columnstore/bin/quick_installer_single_server.sh即可完成单机版本安装与启动。

使用这种模式安装的columnstore并没有独立UM模块,而是作为原生进程存在(否则、至少需要2台服务器)。

安装完成后,建议执行命令/usr/local/mariadb/columnstore/bin/columnstoreAlias为columnstore的两个主要客户端:SQL客户端以及mcsadmin(MariaDB ColumnStore MySQL Console)创建别名:

其中:

# 和非columnstore引擎的mysql是一样的
mcsmysql = /usr/local/mariadb/columnstore/mysql/bin/mysql
--defaults-file=/usr/local/mariadb/columnstore/mysql/my.cnf
-u root # 默认密码为空 mcsadmin = /usr/lodcal/mariadb/columnstore/bin/mcsadmin

然后就可以检查节点状态了(节点状态异常是可用来查看),如下所示:

[root@oel-12c ~]# mcsadmin getsysteminfo
getsysteminfo Wed Mar 13 15:52:54 2019 System columnstore-1 System and Module statuses Component Status Last Status Change
------------ -------------------------- ------------------------
System ACTIVE Tue Mar 12 13:35:07 2019 Module pm1 ACTIVE Tue Mar 12 13:34:59 2019 MariaDB ColumnStore Process statuses Process Module Status Last Status Change Process ID
------------------ ------ --------------- ------------------------ ----------
ProcessMonitor pm1 ACTIVE Tue Mar 12 13:34:23 2019 1281
ProcessManager pm1 ACTIVE Tue Mar 12 13:34:29 2019 1838
DBRMControllerNode pm1 ACTIVE Tue Mar 12 13:34:39 2019 2428
ServerMonitor pm1 ACTIVE Tue Mar 12 13:34:42 2019 2447
DBRMWorkerNode pm1 ACTIVE Tue Mar 12 13:34:42 2019 2465
PrimProc pm1 ACTIVE Tue Mar 12 13:34:45 2019 2544
ExeMgr pm1 ACTIVE Tue Mar 12 13:34:50 2019 2628
WriteEngineServer pm1 ACTIVE Tue Mar 12 13:34:54 2019 2685
DDLProc pm1 ACTIVE Tue Mar 12 13:34:58 2019 2756
DMLProc pm1 ACTIVE Tue Mar 12 13:35:06 2019 2827
mysqld pm1 ACTIVE Tue Mar 12 13:34:36 2019 2260 Active Alarm Counts: Critical = 0, Major = 0, Minor = 0, Warning = 0, Info = 0
[root@oel-12c ~]# mcsadmin getsystemstatus
getsystemstatus Wed Mar 13 15:53:05 2019 System columnstore-1 System and Module statuses Component Status Last Status Change
------------ -------------------------- ------------------------
System ACTIVE Tue Mar 12 13:35:07 2019 Module pm1 ACTIVE Tue Mar 12 13:34:59 2019

查看后台进程状态

查看所有支持的命令:

[root@oel-12c ~]# mcsadmin help
help Wed Mar :: List of commands:
Note: the command must be the first entry entered on the command line Command Description
------------------------------ --------------------------------------------------------
? Get help on the Console Commands
addDbroot Add DBRoot Disk storage to the MariaDB Columnstore System
addModule Add a Module within the MariaDB Columnstore System
alterSystem-disableModule Disable a Module and Alter the MariaDB Columnstore System
alterSystem-enableModule Enable a Module and Alter the MariaDB Columnstore System
assignDbrootPmConfig Assign unassigned DBroots to Performance Module
assignElasticIPAddress Assign Amazon Elastic IP Address to a module
disableLog Disable the levels of process and debug logging
disableMySQLReplication Disable MySQL Replication functionality on the system

查看命令的详细参数:

[root@oel-12c ~]# mcsadmin help getsysteminfo
help Wed Mar :: Command: getSystemInfo Description: Get the Over-all System Statuses
Get the System, Module, Process, and Active Alarm Statuses Arguments: None

进入mcsadmin控制台:

[root@oel-12c ~]# mcsadmin

MariaDB ColumnStore Admin Console
enter 'help' for list of commands
enter 'exit' to exit the MariaDB ColumnStore Command Console
use up/down arrows to recall commands Active Alarm Counts: Critical = , Major = , Minor = , Warning = , Info = Critical Active Alarms:

进入SQL控制台(密码默认空):

[root@oel-12c ~]# mcsmysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is
Server version: 10.3.-MariaDB-log Columnstore 1.2.- Copyright (c) , , Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>

修改密码、远程登录(同普通mysql),如下:

MariaDB [(none)]> create user root@'%' identified by "";
Query OK, rows affected (0.001 sec) MariaDB [(none)]> grant all on *.* to root@'%';
Query OK, rows affected (0.000 sec) MariaDB [(none)]> exit
Bye
[root@oel-12c ~]# lsof -i:3306 # 端口,同普通mysql
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mysqld mysql 26u IPv6 0t0 TCP *:mysql (LISTEN)
[root@oel-12c ~]#

使用IDE访问:

所以,columnstore仅仅只是一个引擎,上层架构相同。下层分布式,和mysql ndb cluster的架构是一样的。

停止和启动

系统停止

完全停止columnstore(包括管理控制台和告警服务,停止后一个进程都没了):

[root@oel-12c ~]# ps axu | grep columnstore
root 0.0 0.0 ? S 3月12 : /bin/bash /usr/local/mariadb/columnstore/bin/run.sh -l /tmp/columnstore_tmp_files /usr/local/mariadb/columnstore/bin/ProcMon
root 0.2 0.4 ? Sl 3月12 : /usr/local/mariadb/columnstore/bin/ProcMon
root 0.0 0.0 ? S 3月12 : /bin/sh /oradata/mariadb/columnstore/mysql//bin/mysqld_safe --datadir=/oradata/mariadb/columnstore/mysql/db --pid-file=/oradata/mariadb/columnstore/mysql/db/oel-12c.pid --ledir=/oradata/mariadb/columnstore/mysql//bin
mysql 0.0 3.1 ? Sl 3月12 : /oradata/mariadb/columnstore/mysql//bin/mysqld --basedir=/oradata/mariadb/columnstore/mysql/ --datadir=/oradata/mariadb/columnstore/mysql/db --plugin-dir=/oradata/mariadb/columnstore/mysql/lib/plugin --user=mysql --log-error=/oradata/mariadb/columnstore/mysql/db/oel-12c.err --pid-file=/oradata/mariadb/columnstore/mysql/db/oel-12c.pid --socket=/oradata/mariadb/columnstore/mysql/lib/mysql/mysql.sock --port=3306
root 0.0 0.3 ? Sl 3月12 : /usr/local/mariadb/columnstore/bin/controllernode fg
root 0.1 0.3 ? Sl 3月12 : /usr/local/mariadb/columnstore/bin/ServerMonitor
root 0.0 0.4 ? Sl 3月12 : /usr/local/mariadb/columnstore/bin/workernode DBRM_Worker1 fg
root 0.0 0.0 pts/ S+ : : grep --color=auto columnstore
[root@oel-12c ~]# mcsadmin shutdownSystem y
shutdownsystem Wed Mar :: This command stops the processing of applications on all Modules within the MariaDB ColumnStore System Checking for active transactions Stopping System...
Successful stop of System Shutting Down System...
Successful shutdown of System [root@oel-12c ~]# ps axu | grep columnstore
root 0.0 0.0 pts/ S+ : : grep --color=auto columnstore

启动系统(异常时可用来启动):

[root@oel-12c ~]# mcsadmin startSystem
startsystem Wed Mar :: startSystem command, 'columnstore' service is down, sending command to
start the 'columnstore' service on all modules System being started, please wait........
Successful start of System [root@oel-12c ~]# ps axu | grep columnstore
root 0.0 0.0 pts/ S : : /bin/bash /usr/local/mariadb/columnstore/bin/run.sh -l /tmp/columnstore_tmp_files /usr/local/mariadb/columnstore/bin/ProcMon
root 19.8 0.4 pts/ Sl : : /usr/local/mariadb/columnstore/bin/ProcMon
root 0.0 0.0 pts/ S : : /bin/sh /oradata/mariadb/columnstore/mysql//bin/mysqld_safe --datadir=/oradata/mariadb/columnstore/mysql/db --pid-file=/oradata/mariadb/columnstore/mysql/db/oel-12c.pid --ledir=/oradata/mariadb/columnstore/mysql//bin
mysql 0.4 3.0 pts/ Sl : : /oradata/mariadb/columnstore/mysql//bin/mysqld --basedir=/oradata/mariadb/columnstore/mysql/ --datadir=/oradata/mariadb/columnstore/mysql/db --plugin-dir=/oradata/mariadb/columnstore/mysql/lib/plugin --user=mysql --log-error=/oradata/mariadb/columnstore/mysql/db/oel-12c.err --pid-file=/oradata/mariadb/columnstore/mysql/db/oel-12c.pid --socket=/oradata/mariadb/columnstore/mysql/lib/mysql/mysql.sock --port=3306
root 0.0 0.3 pts/ Sl : : /usr/local/mariadb/columnstore/bin/controllernode fg
root 0.1 0.3 pts/ Sl : : /usr/local/mariadb/columnstore/bin/ServerMonitor
root 0.0 0.4 pts/ Sl : : /usr/local/mariadb/columnstore/bin/workernode DBRM_Worker1 fg
root 0.0 0.0 pts/ S+ : : grep --color=auto columnstore

停止应用(跟rac不停止cluster类似,相当于重启库本身):

[root@oel-12c ~]# mcsadmin stopSystem y   #此时客户端发送请求,将收到 [Err] 1815 - Internal error: The system is not yet ready to accept queries
stopsystem Wed Mar :: This command stops the processing of applications on all Modules within the MariaDB ColumnStore System Checking for active transactions System being stopped now...
Successful stop of System [root@oel-12c ~]# ps axu | grep columnstore
root 0.0 0.0 pts/ S : : /bin/bash /usr/local/mariadb/columnstore/bin/run.sh -l /tmp/columnstore_tmp_files /usr/local/mariadb/columnstore/bin/ProcMon
root 7.9 0.4 pts/ Sl : : /usr/local/mariadb/columnstore/bin/ProcMon
root 0.0 0.0 pts/ S+ : : grep --color=auto columnstore

最近测试发现个额外现象。mcsadmin startSystem后,重新连接报"[Err] 1815 - Internal error: fatal error running mysql_real_connect() in libmysql_client lib (1045) (Access denied for user 'root'@'localhost' (using password: NO))",各种进程、模块状态都是正常的。

常规的SQL以及DDL、建库等和普通mysql一样,唯一的差别是引擎要声明为columnstore,如下:

create database mcs;
use mcs;
create table idbtest(col1 int, col2 int) engine=columnstore;
show create table idbtest;
insert into idbtest values (1, 2);
insert into idbtest values (3, 4);
select * from idbtest;

设置utf-8

vim /usr/local/mariadb/columnstore/mysql/my.cnf

[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci
init-connect=’SET NAMES utf8’ 设置columnstore本身的本地语言(建议不要直接修改配置文件/usr/local/mariadb/columnstore/etc/Columnstore.xml),改了后要通过mcsadmin stopSystem/startSystem使之生效:
/usr/local/mariadb/columnstore/bin/setConfig SystemConfig SystemLang en_US.utf8

将文件转换为utf-8格式:
iconv -f ISO-8859-1 -t UTF-8 < input.txt > output.txt

ColumnStore完整验证指南之安装与启动停止的更多相关文章

  1. redis的安装部署启动停止<17.3.21已更新>

    --------------------------------------------------------- 启动redis时使用下面两条命令: redis-server /etc/redis. ...

  2. [AirFlow]AirFlow使用指南一 安装与启动

    1. 安装 通过pip安装: xiaosi@yoona:~$ pip install airflow 如果速度比较慢,可以使用下面提供的源进行安装: xiaosi@yoona:~$ pip insta ...

  3. Windows下Nginx的下载安装、启动停止和配置浏览

    前言: 记录一下今天在Windows下载安装Nginx服务器的过程.因为网上关于Nginx的资料都太复杂了,大多数是在Linux下使用的方法. 1.下载 Nginx官网下载地址:http://ngin ...

  4. 通过批处理进行Windows服务的安装/卸载&启动/停止

    安装服务 @echo off set checked=2 set PATHS=%~sdp0 echo 按任意键执行安装……? pause>nul if %checked% EQU 2 ( %PA ...

  5. ubuntu上安装 MySQL 启动/停止 连接MySQL

    1.Ubuntu上安装MySQL服务   1.安装服务端   sudo apt-get install mysql-server    2.安装客户端   sudo apt-get install m ...

  6. windows 服务 安装 删除 启动 停止

    一.停止 sc stop 服务名 二.删除 sc delete 服务名 注意:有时删除不了,报什么“服务为删除标识” ,请将服务窗口关掉就好了. 三.创建 sc create XmlcSendServ ...

  7. redis安装及启动

    Redis 的安装及启动停止 下载 https://redis.io/download 软件copy至虚拟机中,常用的路径为/root/software 开始安装 安装gcc 目的是为了编译软件 yu ...

  8. Nginx 安装学习笔记(1.安装和启动)

    centos7 编译安装和启动.停止https://www.cnblogs.com/xingyunblog/p/9072553.html 一.安装nginx 1.下载 wget http://ngin ...

  9. 2017.7.1 mysql安装与启动(已验证可以使用)

    下载地址:http://learning.happymmall.com/ 之前一直用解压版安装,启动mysql服务的时候总是失败,这次用mysql installer安装一遍,终于成功启动. 1.下载 ...

随机推荐

  1. thinkPHP3.2使用__ROOT__显示为空,为什么

    在模板展示上传文件的时候用了__ROOT__,但是显示为空. 在网上找解决办法,改为__ROOT__/,然后就可以了

  2. ThinkPHP5 添加多个文字水印及疑难解答

    public function imageload() { $imgpath = ROOT_PATH . 'public' . DS . 'static' . DS . 'www' . DS . 'i ...

  3. body里面的onload和window.onload,window.load的区别

    区别:body里面的onload是在“页面加载完成后执行的动作”window里面的onload是在“页面加载时执行的动作” window.load这个应该只是表明事件方法,但并未执行,比如click表 ...

  4. UIPullRefreshFlash模块demo示例

    UIPullRefreshFlash 模块概述:UIPullRefreshFlash模块对引擎新推出的下拉刷新接口进行了一层封装,app可以通过此模块来实现带炫酷动画效果的下拉刷新功能.使用此模块,在 ...

  5. Docker 实战(二)——centos7镜像安装nginx,将安装nginx的centos容器生成新的镜像,并导出

    Docker centos7镜像安装nginx 1.安装docker 使用yum安装docker不再重复:见  Linux常用命令 2.pull centos 1)在docker仓库中搜索centos ...

  6. 构建react项目失败解决办法

    1.初始化项目,报下方错误 2.解决方法,更新淘宝镜像 npm config set registry https://registry.npm.taobao.org 3.在初始化项目 create- ...

  7. eclemma怎么安装 eclemma的安装与简单使用图文教程(附下载)

    来自于:https://www.jb51.net/softjc/628026.html 一. 安装 有两种安装方法 1. 下载安装(推荐) 地址: http://sourceforge.net/pro ...

  8. JVM入门到放弃之基本概念

    1. 基本概念 jvm 是可运行Java代码的假想计算机,包括一套字节码指令集.一组寄存器.一个栈.一个垃圾回收堆和一个存储方法域. jvm 是运行在操作系统之上的,屏蔽了与具体操作系统平台相关的信息 ...

  9. OFFICE 您正试图运行的函数包含有宏或需要宏语言支持的内容。

    故障现象:打开WORD的时候,提示“您正试图运行的函数包含有宏或需要宏语言支持的内容.而在安装此软件时,您(或您的管理员)选择了不安装宏或控件的支持功能”. 提示现象: 解决办法 : 1.进入“控制面 ...

  10. office word memo

    显示左侧目录树 office 和 wps 的差异 wps 的版本:视窗 ->文档结构图 office 的版本: 视图 ->导航窗格