一、双机数据库安装
1、禁用防火墙及SElinux
systemctl stop firewalld
systemctl disable firewalld
sed -i -e 's,enforcing,disabled,' /etc/selinux/config
2、创建用户
groupadd dbgrp
useradd -g dbgrp -d /home/omm -m -s /bin/bash omm
echo redhat|passwd --stdin omm
3、解压缩安装包
mkdir -p /opt/software/gaussdb
cd /opt/s服务器托管网oftware/gaussdb
tar -xf GaussDB_T_*.tar.gz
4、重启服务器
5、主节点安装
cd GaussDB_T_*
python install.py
-U omm:dbgrp
-R /opt/gaussdb/app
-D /opt/gaussdb/data
-C LSNR_ADDR=127.0.0.1,192.168.120.28
-C LSNR_PORT=1888
-C REPL_PORT=1889
-C "ARCHIVE_DEST_2=SERVICE=192.168.120.29:1889 SYNC"
-C SESSIONS=1500
6、备节点安装
cd GaussDB_T_*
python install.py
-U omm:dbg服务器托管网rp
-R /opt/gaussdb/app
-D /opt/gaussdb/data
-C LSNR_ADDR=127.0.0.1,192.168.120.29
-C LSNR_PORT=1888
-C REPL_PORT=1889
-C "ARCHIVE_DEST_2=SERVICE=192.168.120.28:1889 SYNC"
-O
7、备节点重建数据库
cd /opt/gaussdb/app/bin
python zctl.py -t build
8、模拟数据同步
zsql sys/Changeme_123@127.0.0.1:1888
create table test(id int);
insert into test values (1);
insert into test values (2);
insert into test values (3);
select * from test;
9、主备倒换switchover
备机查询
select database_role,database_condition,switchover_status from dv_database;
主备切换
alter database switchover;
10、主备倒换failover
主机停止
shutdown immediate;
备机状态查询
select database_role,database_condition,switchover_status from dv_database;
备升主
alter database failover;
原主降备
python zctl.py -t demote
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.fwqtg.net
相关推荐: python中scikit-learn机器学习例子
# -*- coding: utf-8 -*- import numpy from sklearn import metrics from sklearn.svm import LinearSVC from sklearn.naive_bayes import…