官方文档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. 菜鸟详细解析Cookie注入原理

    一.SQL注入原理 我以aspx为例,现在我们来研究下Cookie注入是怎么产生的,在获取URL参数的时候,如果在代码中写成Request[“id”],这样的写法问题就出现了.我先普及下科普知识,在a ...

  2. Linux命令 df du

    df: 列出文件系统的整体磁盘使用量 du: 评估文件系统的磁盘使用量 $ df [-ahikHTm] [目录或文件名] 参数: -a: 列出所有的文件系统,包括系统特有的/proc 等文件系统 -k ...

  3. 12生成器,send,推导式

    # 1.生成器的本质就是迭代器 # 2.通过函数变成一个生成器 # def func(): # print(1) # yield 5 # 我的函数走到这了 # print(2) # yield 9 # ...

  4. freemarker知识点

    一----------------------------freemarker  如果变量不存在或者未NULL时应给默认值,否则报错 ${username!}    默认值空字符串 ${usernam ...

  5. python中list添加元素的方法append()、extend()和insert()

    append()函数:将新元素追加到列表末尾 In [1]: a = [1, 2, 3, 4, 5] In [2]: a.append(6) In [3]: a Out[3]: [1, 2, 3, 4 ...

  6. Python中的引用传参

    Python中函数参数是引用传递(注意不是值传递).对于不可变类型,因变量不能修改,所以运算不会影响到变量自身:而对于可变类型来说,函数体中的运算有可能会更改传入的参数变量. 引用传参一: >& ...

  7. linux中MTDflash设备驱动大概

    一.主要结构体 1.mtd_info,主要是描述MTD原始设备层中的设备或分区, 2.mtd_part,表示一个分区,用里面的主mtd_info和本分区mtd_info描述分区, 3.mtd_part ...

  8. [vue--开发记录]使用location.href修改地址跳转页面在ie上遇到的坑

    管理后台项目上在用vue2.0开发,因为刚转vue2.0,不是太熟悉.在跳转页面的时候直接用location.href来修改地址跳转,在chrome和火狐上展现都是正常的.后面因为说要兼容到IE9,就 ...

  9. 3n+1猜想——模拟

    package dxb.com; import java.util.Scanner; public class caixiang { public static void main(String[] ...

  10. studio-3t 配置文件位置

    换电脑了,原来的studio-3t的配置 在 C:\Users\用户名\.3T. 将这个目录下的所有文件拷贝到 新电脑里的 相同文件夹,覆盖即可