通过APT安装ColumnStore
注:ubuntu 20.04版本
1、配置APT包存储列
MariaDB ColumnStore5.5在MariaDB Community Server上可用10.5
要配置APT软件包存储库
sudo apt install wget
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
echo "d4e4635eeb79b0e96483bd70703209c63da55a236eadd7397f769ee434d92ca8 mariadb_repo_setup" / | sha256sum -c -
chmod +x mariadb_repo_setup
sudo ./mariadb_repo_setup / --mariadb-server-version="mariadb-10.6"
sudo apt update
2、为column store安装一些额外的依赖项
sudo apt install libjemalloc2
3、安装MariaDB ColumnStore和包依赖项
sudo apt install mariadb-server mariadb-backup / libmariadb3 mariadb-client / mariadb-plugin-columnstore
4、配置MariaDB列存储
安装只会将 MariaDB ColumnStore 加载到系统中。MariaDB ColumnStore 需要在数据库服务器准备好使用之前进行配置和额外的安装后步骤
注说明:在 Ubuntu 上,MariaDB 的软件包捆绑了以下配置文件:
-
/etc/mysql/my.cnf
-
/etc/mysql/mariadb.cnf
-
/etc/mysql/mariadb.conf.d/50-client.cnf
-
/etc/mysql/mariadb.conf.d/50-mysql-clients.cnf
-
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf
-
/etc/mysql/mariadb.conf.d/50-server.cnf
-
/etc/mysql/mariadb.conf.d/60-galera.cnf
在 Ubuntu 上,默认读取以下目录中的自定义配置文件:
-
/etc/mysql/conf.d/
-
/etc/mysql/mariadb.conf.d/
添加配置文件,自定义配置文件存放目是:/etc/mysql/mariadb.conf.d/z-custom-my.cnf
touch z-custom-my.cnf #自己新建的文件 vim z-custom-my.cnf #添加配置的内容如下 [mariadb] log_error = mariadbd.err character_set_server = utf8 collation_server = utf8_general_ci columnstore_use_import_for_batchinsert = ALWAYS
5、启动列存储的进程
sudo systemctl restart mariadb-columnstore sudo systemctl restart mariadb-columnstore sudo systemctl start mariadb sudo systemctl status mariadb sudo systemctl status mariadb-columnstore
注意:mariadb的状态是active(running)即可,mariadb-columnstore的状态是active (exited)不用管
6、测试部署结果
1、命令行执行输入sudo mariadb即可进入
sudo mariadb
2、创建表查看验证
(1)首先创建一个库
CREATE DATABASE inventory;
(2)创建columnstore的表
CREATE TABLE inventory.products ( product_name varchar(11) NOT NULL DEFAULT '', supplier varchar(128) NOT NULL DEFAULT '', quantity varchar(128) NOT NULL DEFAULT '', unit_cost varchar(128) NOT NULL DEFAULT '' ) ENGINE=Columnstore DEFAULT CHARSET=utf8;
到此为止,mariadb_columnstore的单机版环境部署成功,并且验证通过
mariadb-columnstore的官方安装介绍链接:https://mariadb.com/docs/deploy/topologies/single-node/community-columnstore-cs10-6/#deploy-single-node-community-columnstore-cs10-6-start-config
原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/277387.html