快速安装
搭建集群
初始启动节点
创建好各自的配置文件后,直接使用greatdb_init初始化各个节点,greatdb_init会自动初始化数据库节点实例,并启动实例。
greatdb_init参数说明:
defaults-file: 指定配置文件
cluster-user: 指定集群内部管理用户,所有的 sqlnode 节点和 datanode 节点需要保持一致
cluster-host: 指定管理用户的hostname,默认为 %,也可以指定为特定内网,如 172.%,或者 172.16.% 或者 172.16.10.%
cluster-password: 指定管理用户和 root@localhost 用户密码,不推荐使用空密码
node-type:只能是 sqlnode 、datanode、或者backup_node
其它注意事项:
如果配置文件中开启了 skip_name_resolve 参数,greatdb_init 命令无法使用
初始启动SQLNode
[root@localhost greatdb-cluster]# pwd
/usr/local/greatdb-cluster
## 初始化SQL节点的数据目录
[root@localhost greatdb-cluster]# bin/greatdb_init --defaults-file=/etc/greatdb-cluster/sqlnode1.cnf --cluster-user=greatdb --cluster-host=% --cluster-password=greatdb --node-type=sqlnode
[root@localhost greatdb-cluster]# bin/greatdb_init --defaults-file=/etc/greatdb-cluster/sqlnode2.cnf --cluster-user=greatdb --cluster-host=% --cluster-password=greatdb --node-type=sqlnode
[root@localhost greatdb-cluster]# bin/greatdb_init --defaults-file=/etc/greatdb-cluster/sqlnode3.cnf --cluster-user=greatdb --cluster-host=% --cluster-password=greatdb --node-type=sqlnode
初始启动DataNode
[root@localhost greatdb-cluster]# bin/greatdb_init --defaults-file=/etc/greatdb-cluster/datanode1.cnf --cluster-user=greatdb --cluster-host=% --cluster-password=greatdb --node-type=datanode
[root@localhost greatdb-cluster]# bin/greatdb_init --defaults-file=/etc/greatdb-cluster/datanode2.cnf --cluster-user=greatdb --cluster-host=% --cluster-password=greatdb --node-type=datanode
[root@localhost greatdb-cluster]# bin/greatdb_init --defaults-file=/etc/greatdb-cluster/datanode3.cnf --cluster-user=greatdb --cluster-host=% --cluster-password=greatdb --node-type=datanode
[root@localhost greatdb-cluster]# bin/greatdb_init --defaults-file=/etc/greatdb-cluster/datanode4.cnf --cluster-user=greatdb --cluster-host=% --cluster-password=greatdb --node-type=datanode
[root@localhost greatdb-cluster]# bin/greatdb_init --defaults-file=/etc/greatdb-cluster/datanode5.cnf --cluster-user=greatdb --cluster-host=% --cluster-password=greatdb --node-type=datanode
[root@localhost greatdb-cluster]# bin/greatdb_init --defaults-file=/etc/greatdb-cluster/datanode6.cnf --cluster-user=greatdb --cluster-host=% --cluster-password=greatdb --node-type=datanode
初始启动备份节点
仅需要在启动备份功能时初始化
[root@localhost greatdb-cluster]# bin/greatdb_init --defaults-file=/etc/greatdb-cluster/backup_node_1.cnf --cluster-user=greatdb --cluster-host=% --cluster-password=greatdb --node-type=backup_node
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




