如何安装 StoneDB 2.0 企业版? | StoneDB 使用教程 #2

发布时间 2023-11-09 13:51:45作者: StoneDB




图片通过二进制TAR包安装(CentOS 7.X)


下载安装包

stonedb-ee-8.0-v2.1.0.el7.x86_64.tar.gz
下载地址:https://www.stoneatom.com/download

解压安装包

点击查看代码
tar -zxvf stonedb-ee-8.0-v2.1.0.el7.x86_64.tar.gz -C /opt

依赖检查

点击查看代码
ldd -r /opt/stonedb_v2/install/bin/mysqld
ldd -r /opt/stonedb_v2/install/bin/mysql
注:若检查返回有关键字"not found",说明缺少依赖文件,可以从安装目录 /opt/stonedb_v2/install/lib64 下找到对应的依赖文件,然后拷贝到本地目录 /lib64。

编辑参数文件

点击查看代码
[client]
port = 3306
socket          = /opt/stonedb_v2/install/tmp/mysql.sock

[mysqld]
port                = 3306
basedir             = /opt/stonedb_v2/install/
tmpdir              = /opt/stonedb_v2/install/tmp/
socket              = /opt/stonedb_v2/install/tmp/mysql.sock
datadir             = /opt/stonedb_v2/install/data/
pid-file            = /opt/stonedb_v2/install/mysqld.pid
log-error           = /opt/stonedb_v2/install/log/mysqld.log
slow_query_log_file = /opt/stonedb_v2/install/log/slow.log
log-bin             = /opt/stonedb_v2/install/binlog/mysql-bin.log

max_connections = 1000
max_binlog_size = 512M
sync_binlog = 1
binlog_format = row
open_files_limit = 65535
server_id = 1

innodb_buffer_pool_size = 512M
innodb_data_file_path = ibdata1:1G:autoextend
innodb_log_buffer_size = 32M
innodb_log_file_size = 512M
innodb_log_files_in_group = 2

创建组、用户、目录

点击查看代码
groupadd mysql
useradd -g mysql mysql -s /usr/bin/nologin

mkdir -p /opt/stonedb_v2/install/tmp
mkdir -p /opt/stonedb_v2/install/data
mkdir -p /opt/stonedb_v2/install/log
mkdir -p /opt/stonedb_v2/install/binlog

chown -R mysql:mysql /opt/stonedb_v2

初始化实例

点击查看代码
/opt/stonedb_v2/install/bin/mysqld --defaults-file=/opt/stonedb_v2/install/my.cnf --initialize --user=mysql

启动实例

点击查看代码

/opt/stonedb_v2/install/bin/mysqld_safe --defaults-file=/opt/stonedb_v2/install/my.cnf --user=mysql &

登录数据库

点击查看代码
cat /opt/stonedb_v2/install/log/mysqld.log |grep password

/opt/stonedb_v2/install/bin/mysql -uroot -p -S /opt/stonedb_v2/install/tmp/mysql.sock

图片通过RPM包安装(CentOS 7.X)

下载安装包

stonedb-ee-8.0-v2.1.0.el7.x86_64.rpm

下载地址:https://www.stoneatom.com/download

解压安装包

点击查看代码
rpm -ivh stonedb-ee-8.0-v2.1.0.el7.x86_64.rpm
注:解压后,默认路径为 /opt/stonedb_v2/install。

检查依赖

点击查看代码
ldd -r /opt/stonedb_v2/install/bin/mysqld
ldd -r /opt/stonedb_v2/install/bin/mysql
注:若检查返回有关键字"not found",说明缺少依赖文件,可以从安装目录 /opt/stonedb_v2/install/lib64 下找到对应的依赖文件,然后拷贝到本地目录 /lib64。

编辑参数文件

点击查看代码
[client]
port = 3306
socket          = /opt/stonedb_v2/install/tmp/mysql.sock

[mysqld]
port                = 3306
basedir             = /opt/stonedb_v2/install/
tmpdir              = /opt/stonedb_v2/install/tmp/
socket              = /opt/stonedb_v2/install/tmp/mysql.sock
datadir             = /opt/stonedb_v2/install/data/
pid-file            = /opt/stonedb_v2/install/mysqld.pid
log-error           = /opt/stonedb_v2/install/log/mysqld.log
slow_query_log_file = /opt/stonedb_v2/install/log/slow.log
log-bin             = /opt/stonedb_v2/install/binlog/mysql-bin.log

max_connections = 1000
max_binlog_size = 512M
sync_binlog = 1
binlog_format = row
open_files_limit = 65535
server_id = 1

innodb_buffer_pool_size = 512M
innodb_data_file_path = ibdata1:1G:autoextend
innodb_log_buffer_size = 32M
innodb_log_file_size = 512M
innodb_log_files_in_group = 2

创建组、用户、目录

点击查看代码
groupadd mysql
useradd -g mysql mysql -s /usr/bin/nologin

mkdir -p /opt/stonedb_v2/install/tmp
mkdir -p /opt/stonedb_v2/install/data
mkdir -p /opt/stonedb_v2/install/log
mkdir -p /opt/stonedb_v2/install/binlog

chown -R mysql:mysql /opt/stonedb_v2

初始化实例

点击查看代码
/opt/stonedb_v2/install/bin/mysqld --defaults-file=/opt/stonedb_v2/install/my.cnf --initialize --user=mysql

启动实例

点击查看代码
/opt/stonedb_v2/install/bin/mysqld_safe --defaults-file=/opt/stonedb_v2/install/my.cnf --user=mysql &

登录数据库

点击查看代码
cat /opt/stonedb_v2/install/log/mysqld.log |grep password

/opt/stonedb_v2/install/bin/mysql -uroot -p -S /opt/stonedb_v2/install/tmp/mysql.sock

图片通过DEB包安装(Ubuntu 20.04)

下载安装包

stonedb-ee-8.0-v2.1.0.ubuntu.amd64.deb
下载地址:https://www.stoneatom.com/download

解压安装包

点击查看代码
dpkg -x stonedb-ee-8.0-v2.1.0.ubuntu.amd64.deb /opt
注:解压后,默认路径为 /opt/stonedb_v2/install。

检查依赖

点击查看代码
ldd -r /opt/stonedb_v2/install/bin/mysqld
ldd -r /opt/stonedb_v2/install/bin/mysql
注:若检查返回有关键字"not found",说明缺少依赖文件,可以从安装目录 /opt/stonedb_v2/install/lib64 下找到对应的依赖文件,然后拷贝到本地目录 /lib64。

编辑参数文件

点击查看代码
[client]
port = 3306
socket          = /opt/stonedb_v2/install/tmp/mysql.sock

[mysqld]
port                = 3306
basedir             = /opt/stonedb_v2/install/
tmpdir              = /opt/stonedb_v2/install/tmp/
socket              = /opt/stonedb_v2/install/tmp/mysql.sock
datadir             = /opt/stonedb_v2/install/data/
pid-file            = /opt/stonedb_v2/install/mysqld.pid
log-error           = /opt/stonedb_v2/install/log/mysqld.log
slow_query_log_file = /opt/stonedb_v2/install/log/slow.log
log-bin             = /opt/stonedb_v2/install/binlog/mysql-bin.log

max_connections = 1000
max_binlog_size = 512M
sync_binlog = 1
binlog_format = row
open_files_limit = 65535
server_id = 1

innodb_buffer_pool_size = 512M
innodb_data_file_path = ibdata1:1G:autoextend
innodb_log_buffer_size = 32M
innodb_log_file_size = 512M
innodb_log_files_in_group = 2

创建组、用户、目录

点击查看代码
groupadd mysql
useradd -g mysql mysql -s /usr/bin/nologin

mkdir -p /opt/stonedb_v2/install/tmp
mkdir -p /opt/stonedb_v2/install/data
mkdir -p /opt/stonedb_v2/install/log
mkdir -p /opt/stonedb_v2/install/binlog

chown -R mysql:mysql /opt/stonedb_v2

初始化实例

点击查看代码
/opt/stonedb_v2/install/bin/mysqld --defaults-file=/opt/stonedb_v2/install/my.cnf --initialize --user=mysql

启动实例

点击查看代码
/opt/stonedb_v2/install/bin/mysqld_safe --defaults-file=/opt/stonedb_v2/install/my.cnf --user=mysql &

登录数据库

点击查看代码
cat /opt/stonedb_v2/install/log/mysqld.log |grep password

/opt/stonedb_v2/install/bin/mysql -uroot -p -S /opt/stonedb_v2/install/tmp/mysql.sock

以上是StoneDB-8.0-V2.0企业公测版系列的安装说明,需要指出的是,在本文中我们只是以V2.1.0版本为例,本编译安装教程具有通用性,版本号读者可以自行更新为最新版本。

StoneDB 产品介绍

StoneDB 是石原子科技自主设计研发的国内首款完全兼容于 MySQL 生态的开源一体化实时 HTAP 数据库产品,具备行列混存、智能索引等核心特性,为 MySQL 数据库提供在线数据实时就近分析服务,能够高效解决 MySQL 数据库在分析型应用场景中面临的能力问题。同时,StoneDB 使用多存储引擎架构的设计,事务引擎具有数据强一致特性,具备完整的事务并发处理能力,使得 StoneDB 可以替代 MySQL 数据库满足在线事务处理场景的需求,使用 MySQL 的用户,通过 StoneDB 可以实现 TP+AP 混合负载,分析性能提升 10 倍以上,不需要进行数据迁移,也无需与其他 AP 集成,弥补 MySQL 分析领域的空白。

加入StoneDB社区

Github:https://github.com/stoneatom/stonedb

Gitee:https://gitee.com/StoneDB/stonedb

社区官网:https://stonedb.io/

哔哩哔哩:https://space.bilibili.com/1154290084

Twitter:https://twitter.com/StoneDataBase

Linkedin:https://www.linkedin.com/in/stonedb/

加入微信群:添加社区助理-小石侠;加入钉钉群:扫描下方钉钉群二维码。

image