南大通用数据库-Gbase-8a-学习-15-Gbase8a通过Dblink访问Gbase8a(95->86)
一、测试环境
名称 | 值 |
---|---|
cpu | Intel® Core™ i5-1035G1 CPU @ 1.00GHz |
操作系统 | CentOS Linux release 7.9.2009 (Core) |
内存 | 4G |
逻辑核数 | 3 |
Gbase-8a源端节点-IP | 192.168.142.11 |
Gbase-8a目的端节点-IP | 192.168.142.10 |
Gbase-8a源端数据库版本 | 9.5.3.27.6e43a8ca |
Gbase-8a目的端数据库版本 | 8.6.2.43-R33.132743 |
二、测试步骤
测试目的端Gbase-8a-86版本通过DBLINK访问源端Gbase-8a-95版本数据。
1、Gbase-8a源端创建用户
[gbase@xdw1 ~]$ gccliGBase client 9.5.3.27.6e43a8ca. Copyright (c) 2004-2022, GBase. All Rights Reserved.gbase> create database czg;
Query OK, 1 row affected (Elapsed: 00:00:00.01)gbase> use czg;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)gbase> create user czg@'%' identified by 'qwer1234';
Query OK, 0 rows affected (Elapsed: 00:00:00.11)gbase> grant all privileges on *.* to 'czg'@'%';
Query OK, 0 rows affected (Elapsed: 00:00:00.01)
2、Gbase-8a源端测试数据
gbase> create table czg(a int);
Query OK, 0 rows affected (Elapsed: 00:00:00.13)gbase> insert into czg values(1);
Query OK, 1 row affected (Elapsed: 00:00:00.01)
3、配置透明网关
[gbase@xdw0 pkg]$ tar -xvf GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15.tar[gbase@xdw0 GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15]$ ll
总用量 12
drwxrwxrwx 5 gbase gbase 101 8月 15 15:53 conf
drwxrwxrwx 2 gbase gbase 30 11月 30 2020 gateway
-rwxrwxrwx 1 gbase gbase 1896 11月 7 2019 gbaseGatewayServer.sh
-rwxrwxrwx 1 gbase gbase 654 7月 16 2020 gt.sh
drwxrwxrwx 5 gbase gbase 185 7月 16 2020 jre
drwxrwxrwx 4 gbase gbase 4096 7月 16 2020 lib
drwxrwxrwx 2 gbase gbase 30 8月 15 15:31 logs
(1)conf.properties
这个文件不用改动,但大家需要记录一下端口9898。
[root@xdw0 GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15]# cat conf/conf.properties
gbase.gt.port=9898
gbase.gt.encode=utf8
gbase.gt.pagesize=1000
#load data type : batch=1, insert values=0
gbase.gt.load.data.type=1
gbase.gt.table.use.decimal=1
#paging query : not=0, yes=1;default=0
gbase.gt.gc.paging.query=0
gbase.gt.st.paging.query=0
gbase.gt.orcl.paging.query=0
#commit type : transaction commit=0, paging commit=1
gbase.gt.commit.type=0
#timeout
gbase.gt.wait.timeout=7200
#timeout to fetch gcluster datasource(second) : default=108000
gbase.gt.gc.fetch.timeout=108000
#thread pool type: 0-fixed thread pool 1-thread pool executor
gbase.gt.thread.pool.type=0
#thread pool size(gbase.gt.thread.pool.type=0 effect)
gbase.gt.thread.pool.size=5000
#core pool size(gbase.gt.thread.pool.type=1 effect)
gbase.gt.core.pool.size=200
#maximum pool size(gbase.gt.thread.pool.type=1 effect)
gbase.gt.maximum.pool.size=5000
#keep alive time(gbase.gt.thread.pool.type=1 effect)
gbase.gt.keep.alive.time=0
#queue size(gbase.gt.thread.pool.type=1 effect)
gbase.gt.queue.size=10
(2)gbase8a_gcluster.properties
我这边的集群是一个管理节点,两个数据节点,我们都要写到这个配置文件里。
[root@xdw0 GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15]# gcadmin
CLUSTER STATE: ACTIVE
CLUSTER MODE: NORMAL=====================================================================
| GBASE COORDINATOR CLUSTER INFORMATION |
=====================================================================
| NodeName | IpAddress |gcware |gcluster |DataState |
---------------------------------------------------------------------
| coordinator1 | 192.168.142.10 | OPEN | OPEN | 0 |
---------------------------------------------------------------------
=================================================================
| GBASE DATA CLUSTER INFORMATION |
=================================================================
|NodeName | IpAddress |gnode |syncserver |DataState |
-----------------------------------------------------------------
| node1 | 192.168.142.10 | OPEN | OPEN | 0 |
-----------------------------------------------------------------
[root@xdw0 GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15]# cat conf/gcluster/gbase8a_gcluster.properties
[gc1]
gcluster_IP=192.168.142.10
gcluster_port=5258
gcluster_user=root
gcluster_pwd=qwer1234
gcluster_encode=utf-8
[gn1]
gcluster_IP=192.168.142.10
gcluster_port=5050
gcluster_user=root
gcluster_pwd=qwer1234
gcluster_encode=utf-8
(3)gbase_link1.properties
gbase_link1.properties需要和sample文件同一层。
[root@xdw0 GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15]# cat conf/dataSource/gbase_link1.properties
[ds1]
dataSource_IP=192.168.142.11
dataSource_port=5258
dataSource_dbname=czg
dataSource_dbtype=gcluster
dataSource_user=czg
dataSource_pwd=qwer1234
dataSource_charset=utf8
(4)启动程序
[root@xdw0 GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15]# chown -R gbase:gbase /opt/pkg/GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.1[root@xdw0 GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15]# su - gbase
上一次登录:一 8月 15 16:00:06 CST 2022pts/0 上[gbase@xdw0 ~]$ cd /opt/pkg/GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15/[gbase@xdw0 GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15]$ sh gt.sh [gbase@xdw0 GBase8a_MPP_Cluster_Gateway_8.5.1.2_build4.15]$ ps -ef|grep java
gbase 24603 1 5 16:55 pts/0 00:00:00 java -Dfile.encoding=UTF-8 -Dcom.sun.management.jmxremote -Xmx2048m -cp gateway/gbaseGateway.jar:lib/commons-beanutils-1.7.0.jar:lib/commons-collections-3.2.1.jar:lib/commons-lang-2.4.jar:lib/commons-logging-1.1.jar:lib/commons-net-1.4.1.jar:lib/dom4j-1.6.1.jar:lib/ezmorph-1.0.6.jar:lib/gbase-connector-java-8.3.81.53-build55.5.5-bin.jar:lib/jaxen-1.1-beta-6.jar:lib/json-lib-2.4-jdk15.jar:lib/jtds-1.2.5.jar:lib/log4j-1.2.15.jar:lib/ojdbc8.jar:lib/commons-configuration-1.8.jar:lib/oscarJDBC.jar:lib/oscarClusterJDBC.jar cn.com.gbase.gbaseGateway.server.GBaseGateway
gbase 24624 24537 0 16:56 pts/0 00:00:00 grep --color=auto java
(5)修改目的端gcluster层参数
每个管理节点都需要添加此参数。
我的dblink程序是在192.168.142.10节点启动,所以填写此IP。
添加这两个参数到/opt/gcluster/config/gbase_8a_gcluster.cnf中
gbase_dblink_gateway_ip = '192.168.142.10'
gbase_dblink_gateway_port = 9898
我是放在[gbased]下
(6)目的端重启服务
我这边是重启了所有节点的服务,但应该是只重启所有管理节点的服务。
[root@xdw0 dataSource]# service gcware restart
Stopping GCMonit success!
Signaling GCRECOVER (gcrecover) to terminate: [ 确定 ]
Waiting for gcrecover services to unload:... [ 确定 ]
Signaling GCSYNC (gc_sync_server) to terminate: [ 确定 ]
Waiting for gc_sync_server services to unload: [ 确定 ]
Signaling GCLUSTERD to terminate: [ 确定 ]
Waiting for gclusterd services to unload:..... [ 确定 ]
Signaling GBASED to terminate: [ 确定 ]
Waiting for gbased services to unload:... [ 确定 ]
Signaling GCWARE (gcware) to terminate: [ 确定 ]
Waiting for gcware services to unload:.. [ 确定 ]
Starting GCWARE (gcwexec): [ 确定 ]
Starting GBASED : [ 确定 ]
Starting GCSYNC : [ 确定 ]
Starting GCLUSTERD : [ 确定 ]
Starting GCRECOVER : [ 确定 ]
Starting GCMonit success!
(7)目的端gbase创建用户
gbase> create user czg identified by 'qwer1234';
Query OK, 0 rows affected (Elapsed: 00:00:00.11)gbase> grant all privileges on *.* to 'czg'@'%';
Query OK, 0 rows affected (Elapsed: 00:00:00.00)gbase> flush privileges;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)
(8)目的端创建Dblink
gbase_link1这个名称和gbase_link1.properties的前缀要一样。
gbase> CREATE DATABASE LINK dblink_gbase connect to '' identified by '' using 'gbase_link1';
Query OK, 0 rows affected (Elapsed: 00:00:00.30)
(9)目的端测试Dblink
gbase> select * from czg@dblink_gbase-> ;
+------+
| a |
+------+
| 1 |
+------+
1 row in set (Elapsed: 00:00:00.07)
4、DBLINK数据字典表
gbase> desc gbase.db_links;
+-------------+--------------------------+------+-----+-------------------+-----------------------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------------------+------+-----+-------------------+-----------------------------+
| owner | varchar(128) | NO | PRI | NULL | |
| db_link | varchar(128) | NO | PRI | NULL | |
| dblink_priv | enum('PUBLIC','PRIVATE') | NO | PRI | NULL | |
| username | varchar(128) | YES | | NULL | |
| password | varchar(41) | YES | | NULL | |
| host | varchar(2000) | YES | | NULL | |
| created | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+-------------+--------------------------+------+-----+-------------------+-----------------------------+
7 rows in set (Elapsed: 00:00:00.00)
三、错误简记
1、ERROR 1105 (HY000): connect gateway server timeout. Connection refused
(1)错误信息
gbase> select * from czg@dblink_gbase;
ERROR 1105 (HY000): connect gateway server timeout. Connection refused
(2)解决方法
启动gt.sh。
2、ERROR 1105 (HY000): errorCode: 1818, errorMsg: No VC selected.
(1)错误信息
gbase> use vc vc1;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)gbase> use czg;
Query OK, 0 rows affected (Elapsed: 00:00:00.00)gbase> select * from czg@dblink_gbase;
ERROR 1105 (HY000): errorCode: 1818, errorMsg: No VC selected.
(2)解决方法
gbase> set default_vc for czg = vc2;
Query OK, 0 rows affected (Elapsed: 00:00:00.13)
3、ERROR 1105 (HY000): SELECT command denied to user ‘czg’@‘192.168.142.10’ for table ‘czg’
(1)错误信息
gbase> select * from czg@dblink_gbase;
ERROR 1105 (HY000): SELECT command denied to user 'czg'@'192.168.142.10' for table 'czg'
(2)解决方法
gbase> grant all on *.*.* to czg@'%';
Query OK, 0 rows affected (Elapsed: 00:00:00.04)gbase> select * from czg@dblink_gbase;
+------+
| a |
+------+
| 1 |
+------+
1 row in set (Elapsed: 00:00:00.09)
南大通用数据库-Gbase-8a-学习-15-Gbase8a通过Dblink访问Gbase8a(95->86)相关推荐
- linux安装南大通用数据库 GBase 8s V8.8
linux安装南大通用数据库 GBase 8s V8.8 1.操作系统.数据库 2.下载链接 3.安装文档 4.安装前准备 4.1.以root用户创建 gbasedbt 组和用户 4.2.创建 GBa ...
- 南大通用数据库Gbase 8s遇到的坑
南大通用数据库Gbase 8s的坑 1.没有批量插入,只能在xml循环拼接完整的INSERT语句,而不能拼接多个values 2.关键字段不能用于列查询,如timestamp,需要用表名点列名 3.在 ...
- springbootJpa 连接南大通用数据库Gbase配置
第一步:添加连接驱动包以及hibernate方言包 驱动包下载链接:GBase8sV8.8连接驱动包.zip-其它文档类资源-CSDN下载 第二步:配置连接信息 spring:profiles: de ...
- 南大通用数据库(2):客户端的使用(GBase 企业管理器的使用)
在安装好南大通用服务端之后,安装好客户端之后,测试企业管理器的使用. 服务端是VMware 虚拟机 Centos7.6, IP 是192.168.80.129, PORT是5258 客户端是Win10 ...
- 南大通用数据库-Gbase-8a-学习-17-Gbase8a集群版本升级
一.测试环境 名称 值 cpu Intel® Core™ i5-1035G1 CPU @ 1.00GHz 操作系统 CentOS Linux release 7.9.2009 (Core) 内存 4G ...
- 南大通用数据库-Gbase-8a-学习-34-gcdump(导出数据库对象定义)
目录 一.测试环境 二.介绍 三.命令帮助 四.参数介绍 1.--print-defaults (1)含义 (2)例子 2.--connect_timeout (1)含义 (2)例子 3.-A, -- ...
- 南大通用数据库-Gbase-8a-学习-19-Gbase8a从Kafka订阅Topic消费数据
一.测试环境 名称 值 cpu Intel® Core™ i5-1035G1 CPU @ 1.00GHz 操作系统 CentOS Linux release 7.9.2009 (Core) 内存 4G ...
- 南大通用数据库-Gbase-8a-学习-13-配置ODBC数据源(Linux、Win)
一.测试环境 名称 值 cpu Intel® Core™ i5-1035G1 CPU @ 1.00GHz 操作系统 CentOS Linux release 7.9.2009 (Core) Gbase ...
- 南大通用数据库迁移工具使用指南
一.工具简介 GBase Migration Toolkit 是南大通用自主研发的数据对象迁移工具,能够以图形化界面形式,实现以任务为单位对不同数据库之间库元数据和用户数据的自动迁移. 该工具基于C/ ...
- 南大通用数据库-Gbase-8a-学习-24-全文检索
一.测试环境 名称 值 cpu 12th Gen Intel® Core™ i7-12700H 操作系统 CentOS Linux release 7.9.2009 (Core) 内存 3G 逻辑核数 ...
最新文章
- rethat linux安装nginx,RedHat和CentOS下Nginx安装
- 联邦学习的一些使用库
- 文件传输_python socket实现文件传输(防粘包)
- c# socket接收字符串_socket通信很难?这一文让你轻松搞定!
- python3.4 pip必须升级python3.5_在ubuntu上将python3.4升级到python3.6会破坏pip
- Android Ormlite 学习笔记1 -- 基础
- [java]ArrayList的介绍
- 基于TTP223金属触摸开关电路模块原理图和PCB工程文件
- mac 如何快速生成SSH key,配置github SSH公钥连接(解决git push 413问题)
- win7的Par虚拟机版优化(parellel desktop)
- android菜单键 r9,Android OPPO R9 后台 无法启动 Activity 问题
- 感恩节(Thanksgiving Day)与感恩(组图)
- 计算机科学计算矩阵答案,计算机科学计算答案.doc
- KVM虚拟化之(1):CPU技术
- 小红书怎么推广笔记?小红书推广笔记有什么用?
- 普源精电科创板上市:股价重挫35% 公司市值48亿
- 5.1声道转化为左右声道
- JavaWeb-Servlet生命周期
- Linux 监控工具 tsar(转)
- 【数论】求组合数的四种方法
热门文章
- 电商模式O2O、C2C、B2B、B2C的区别
- 从来没有一种工作叫钱多、事少、离家近(转)
- sqoop将hbase数据导入mysql_Sqoop将mysql数据导入hbase的血与泪
- java计算机毕业设计公务用车管理智慧云服务监管平台源程序+mysql+系统+lw文档+远程调试
- 网易雷火9.18笔试题
- springboot图书管理怎么实现借书时间到期提醒_智慧档案管理系统的功能,你真的了解?...
- 兔子--自学ps的整个过程
- ERP库存管理 金蝶
- Ubuntu报错E:Package vim has no installation candidate
- ARCore平面与空间点云实现