Greenplum 如何直连segment节点

本文涉及的产品
云原生数据库 PolarDB MySQL 版,Serverless 5000PCU 100GB
云原生数据库 PolarDB 分布式版,标准版 2核8GB
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:
直连greenplum segment节点的方法, utility模式 : 
使用这种方式,不与其他节点通讯,只操作当前节点。也没有数据分布的概念。
如果使用utility模式连接的是master节点,写入数据时,数据不会分布到segment,使用正常模式连接后,写入master的数据也查不出来。

$  PGOPTIONS='-c gp_session_role=utility' psql -p 40005
psql (8.2.15)
Type "help" for help.

postgres=# \dt
             List of relations
 Schema | Name | Type  |  Owner   | Storage 
--------+------+-------+----------+---------
 public | t    | table | digoal | heap
 public | test | table | digoal | heap
(2 rows)

postgres=# select * from pg_locks;
   locktype    | database | relation | page | tuple | transactionid | classid | objid | objsubid | transaction |  pid   |      mode       | granted | mppsessionid | mppiswriter | gp_segment_id 
---------------+----------+----------+------+-------+---------------+---------+-------+----------+-------------+--------+-----------------+---------+--------------+-------------+---------------
 transactionid |          |          |      |       |        136604 |         |       |          |      136604 | 130724 | ExclusiveLock   | t       |            6 | t           |            -1
 relation      |    10899 |    10333 |      |       |               |         |       |          |      136604 | 130724 | AccessShareLock | t       |            6 | t           |            -1
(2 rows)

注意使用PGOPTIONS='-c gp_session_role=utility'后,只操作本地节点

$psql -p # master
psql (8.2.15)
Type "help" for help.
postgres=# select count(*) from test;
 count 
-------
     0
(1 row)
postgres=# \q


$psql -p 40001 # segment
psql (8.2.15)
Type "help" for help.
postgres=# select count(*) from test;
  count  
---------
 4166801
(1 row)
相关文章
|
6月前
|
负载均衡
Pgpool-II实现高可用+读写分离+负载均衡(七)---- recovery_1st_stage分析
recovery_1st_stage是Pgpool online recovery的第一阶段,位于PG_DATA目录下,主要功能就是使用pg_basebackup恢复(recovery)从节点。
199 0
|
消息中间件 存储 关系型数据库
PostqreSQL 表级复制-Londiste3多节点数据同步合 并到单节点|学习笔记
快速学习 PostqreSQL 表级复制-Londiste3多节点数据同步合并到单节点
180 0
PostqreSQL 表级复制-Londiste3多节点数据同步合 并到单节点|学习笔记
|
11月前
|
存储 大数据 调度
GBase8s分片表操作实践
GBase8s分片表操作实践
120 0
|
存储 运维 Kubernetes
PolarDB-X 数据节点备库重搭
本文主要介绍PolarDB-X中DN(数据节点)备库重搭的背景,以及polardbx-operator上是如何实现DN备库重搭的。
PolarDB-X 数据节点备库重搭
|
运维 容灾 关系型数据库
【DB吐槽大会】第79期 - PG standby不支持配置多个上游节点
大家好,这里是DB吐槽大会,第79期 - PG standby不支持配置多个上游节点
|
存储 固态存储 Linux
【最佳实践】Elasticsearch 运用 shard filtering 实现冷热节点索引分配
在 Elasticsearch 的部署中,由于 node(节点)能力不同,会用来做不同的用途:运算能力较强的节点可以用来做 indexing(建立索引表格)的工作,而那些能力较差一点的节点,我们可以用来做搜索用途,这就是我们常说的 hot / warm 架构。
1368 0
【最佳实践】Elasticsearch 运用 shard filtering 实现冷热节点索引分配
|
SQL 关系型数据库 OLAP
PostgreSQL sharding : citus 系列5 - worker节点网络优化
标签 PostgreSQL , citus , pgbouncer , 网络优化 , worker节点 背景 citus 节点间的网络需求: 1、cn节点访问所有worker节点。oltp业务的访问较频繁。
1455 0
|
关系型数据库 数据库 C语言
Greenplum扩容节点步骤
为Greenplum添加计算节点
3977 0