绑定完请刷新页面
取消
刷新

分享好友

×
取消 复制
【SequoiaDB】安装配置
2022-03-21 16:14:16

巨杉.png

SequoiaDB 巨杉数据库作为分布式数据库,由数据库存储引擎与数据库实例两大模块构成。其中,数据库存储引擎模块是数据存储的核心,负责提供整个数据库的读写服务、数据的高可用与容灾、ACID与分布式事务等全部核心数据服务能力。

##学习网站:
【初级】:http://www.sequoiadb.com/cn/university-detail-id-75
【】:http://www.sequoiadb.com/cn/university-detail-id-89

##一、图形化安装
【前期准备】
修改主机名:
vi etc/hostname

配置主机名/IP地址映射:
vi etc/hosts


systemctl stop firewalld.service
systemctl disable firewalld.service
关闭防火墙:
# systemctl stop firewalld.service # 临时关闭防火墙

# systemctl disable firewalld.service # 设置开机禁用防火墙

【官方说明】http://doc.sequoiadb.com/cn/sequoiadb-cat_id-1561381803-edition_id-500

下载安装包:http://download.sequoiadb.com/cn/sequoiadb

# tar zxvf sequoiadb-5.0.1-linux_x86_64.tar.gz
# cd sequoiadb-5.0.1
# chmod u+x sequoiadb-5.0.1-linux_x86_64-installer.run
# chmod u+x sequoiasql-mysql-5.0.1-linux_x86_64-installer.run
# chmod u+x sequoiasql-postgresql-5.0.1-x86_64-installer.run
# chmod u+x setup.sh

./sequoiadb-5.0.1-linux_x86_64-installer.run --help

./sequoiadb-5.0.1-linux_x86_64-installer.run --SMS true
【--SMS true:安装OM service】


安装完成之后登录浏览器访问SAC页面。访问地址:ip+8000端口
如果访问不了,可能是防火墙没关。
账户:admin 密码:admin


##卸载
【顺序】:先实例、再分布式存储、后主机

##一、手动安装

备注:
1、主机名的修改:(记得重启reboot)
Centos7:直接修改/etc/hostname就可以了
(其他版本修改、/etc/hosts ,/etc/sysconfig/network)
命令:hostnamectl set-hostname node_master

2、所有节点在/etc/hosts文件中写入本地解析
192.168.56.107 SDB1 node1
192.168.56.108 SDB2 node2
192.168.56.109 SDB3 node3

3、关闭防火墙:
# systemctl stop firewalld.service # 临时关闭防火墙
# systemctl disable firewalld.service # 设置开机禁用防火墙







下载并安装巨杉存储引擎:
【SDB1】:
上传安装包、解压
tar zxvf sequoiadb-5.0.1-linux_x86_64.tar.gz
cd sequoiadb-5.0.1
# chmod u+x sequoiadb-5.0.1-linux_x86_64-installer.run
# chmod u+x sequoiasql-mysql-5.0.1-linux_x86_64-installer.run
# chmod u+x sequoiasql-postgresql-5.0.1-x86_64-installer.run
# chmod u+x setup.sh

scp sequoiadb-5.0.1-linux_x86_64-installer.run root@SDB2:/root
scp sequoiadb-5.0.1-linux_x86_64-installer.run root@SDB3:/root

【SDB1、SDB2、SDB3】:
./sequoiadb-5.0.1-linux_x86_64-installer.run --mode text --SMS false



创建零时协调节点:
【SDB1】:
su - sdbadmin
sdb
var oma = new Oma( "localhost", 18900 )
oma.help()
oma.createCoord(18900,"/opt/sequoiadb/database/tmpCoord/18900");
oma.startNode(18900)

##连接零时协调节点
var db = new Sdb( "localhost", 18900 )
db.help()
db.createCataRG("sdb1",11800,"/opt/sequoiadb/database/catalog/11800");##编目节点组
var rg = db.getRG(1)
var node = rg.createNode("sdb2",11800,"/opt/sequoiadb/database/catalog/11800")
node.start()
var node = rg.createNode("sdb3",11800,"/opt/sequoiadb/database/catalog/11800")
node.start()

var rg = db.createRG("group1")
rg.createNode("sdb1",11820,"/opt/sequoiadb/database/data/11820")
rg.createNode("sdb2",11820,"/opt/sequoiadb/database/data/11820")
rg.createNode("sdb3",11820,"/opt/sequoiadb/database/data/11820")
rg.start()

var rg = db.createRG("group2")
rg.createNode("sdb1",11830,"/opt/sequoiadb/database/data/11830")
rg.createNode("sdb2",11830,"/opt/sequoiadb/database/data/11830")
rg.createNode("sdb3",11830,"/opt/sequoiadb/database/data/11830")
rg.start()


##协调节点
var rg = db.createCoordRG()
rg = db.getRG(2)
rg.createNode("sdb1",11810,"/opt/sequoiadb/database/data/11810")
rg.createNode("sdb2",11810,"/opt/sequoiadb/database/data/11810")
rg.createNode("sdb3",11810,"/opt/sequoiadb/database/data/11810")
rg.start()


db ##获取当前端口
oma.stopNode(18900)
oma.removeCoord(18900)
quit;



安装MYSQL实例:

【SDB1、SDB2、SDB3】:
./sequoiasql-mysql-5.0.1-linux_x86_64-installer.run --mode text

su - sdbadmin
cd opt/sequoiasql/mysql
mkdir database
/opt/sequoiasql/mysql/bin/sdb_sql_ctl addinst mytest -D opt/sequoiasql/mysql/database/3306
【尽量服务器上有安装有netstat】
/opt/sequoiasql/mysql/bin/sdb_sql_ctl listinst
/opt/sequoiasql/mysql/bin/sdb_sql_ctl status mytest

mysql -uroot --socket=/opt/sequoiasql/mysql/database/3306/mysqld.sock

同步工具:
/opt/sequoiasql/mysql/tools/metaSync/README.md

mysql -uroot --socket=/opt/sequoiasql/mysql/database/3306/mysqld.sock
CREATE USER 'sdbadmin'@'%' IDENTIFIED BY 'sdbadmin';
GRANT all on *.* TO 'sdbadmin'@'%' with grant option;

cp opt/sequoiasql/mysql/tools/lib/release/server_audit.so opt/sequoiasql/mysql/lib/plugin/

cd opt/sequoiasql/mysql/database
mkdir auditlog
vi opt/sequoiasql/mysql/database/3306/auto.cnf
---------【加入】

# 加载审计插件
plugin-load=server_audit=server_audit.so
# 审计记录的审计,建议只记录需要同步的DCL和DDL操作
server_audit_events=CONNECT,QUERY_DDL,QUERY_DCL
# 开启审计
server_audit_logging=ON
# 审计日志路径及文件名
server_audit_file_path=/opt/sequoiasql/mysql/database/auditlog/server_audit.log
# 强制切分审计日志文件
server_audit_file_rotate_now=OFF
# 审计日志文件大小10MB,超过该大小进行切割,单位为byte
server_audit_file_rotate_size=10485760
# 审计日志保留个数,超过后会丢弃旧的
server_audit_file_rotations=999
# 输出类型为文件
server_audit_output_type=file
# 限制每行查询日志的大小为100kb,若表比较复杂,对应的操作语句比较长,建议增大该值
server_audit_query_log_limit=102400


/opt/sequoiasql/mysql/bin/sdb_sql_ctl restart mytest

cd opt/sequoiasql/mysql/tools/metaSync
cp config.sample config
cp log.config.sample log.config
python /opt/sequoiasql/mysql/tools/metaSync/meta_sync.py &

crontab -e
*/1 * * * * /usr/bin/python /opt/sequoiasql/mysql/tools/metaSync/meta_sync.py >/dev/null 2>&1 &



分享好友

分享这个小栈给你的朋友们,一起进步吧。

SequoiaDB
创建时间:2022-03-21 15:57:50
SequoiaDB
展开
订阅须知

• 所有用户可根据关注领域订阅专区或所有专区

• 付费订阅:虚拟交易,一经交易不退款;若特殊情况,可3日内客服咨询

• 专区发布评论属默认订阅所评论专区(除付费小栈外)

技术专家

查看更多
  • 飘絮絮絮丶
    专家
戳我,来吐槽~