AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / dba / 问题

问题[pgpool](dba)

Martin Hope
Stefan Midjich
Asked: 2019-07-31 01:47:25 +0800 CST

.pcppass 不工作

  • 0

我以 postgres 用户身份运行 pgpool-II,因此我可以在这篇文章中以一个顺序准确地复制我所做的事情。

-bash-4.2$ echo "pgpool:$(pg_md5 test)" > /etc/pgpool-II-11/pcp.conf
-bash-4.2$ cat /etc/pgpool-II-11/pcp.conf
pgpool:098f6bcd4621d373cade4e832627b4f6
<Restart pgpool-II-11 service>
-bash-4.2$ echo "cia-db-vip:9898:pgpool:$(pg_md5 test)" > .pcppass
-bash-4.2$ cat .pcppass
cia-db-vip:9898:pgpool:098f6bcd4621d373cade4e832627b4f6
-bash-4.2$ pcp_watchdog_info -h cia-db-vip -p 9898 -U pgpool -w 0
FATAL:  authentication failed for user "pgpool"
DETAIL:  username and/or password does not match

-bash-4.2$ pcp_watchdog_info -h cia-db-vip -p 9898 -U pgpool 0
Password: <I Enter the password test>
2 YES cia-db-3:9999 Linux cia-db-3 cia-db-3

cia-db-3:9999 Linux cia-db-3 cia-db-3 9999 9000 4 MASTER
-bash-4.2$ ls -l .pcppass /etc/pgpool-II-11/pcp.conf
-rw-------. 1 postgres postgres 40 Jul 30 11:22 /etc/pgpool-II-11/pcp.conf
-rw-------. 1 postgres postgres 56 Jul 30 11:23 .pcppass

所以只有我输入密码才能工作。我也试过在没有密码的情况下按回车键。

我尝试检查 strace -ff pcp_watchdog_info 并开始读取文件 .pcppass 但我只能看到第一行。不知道它是继续读取文件还是关闭它。

stat("/var/lib/pgsql/.pcppass", {st_mode=S_IFREG|0600, st_size=56, ...}) = 0
open("/var/lib/pgsql/.pcppass", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0600, st_size=56, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f581f3d6000
read(4, "cia-db-vip:9898:pgpool:098f6bcd4"..., 4096) = 56
close(4)                                = 0
munmap(0x7f581f3d6000, 4096)            = 0
write(3, "M\0\0\0\4", 5)                = 5
select(4, [3], NULL, [3], NULL)         = 1 (in [3])
read(3, "m\0\0\0\10\205^\v\341", 1024)  = 9
write(3, "R\0\0\0,pgpool\000381d652cc9ef7891d4cb"..., 45) = 45
select(4, [3], NULL, [3], NULL)         = 1 (in [3])
read(3, "E\0\0\0xSFATAL\0CXX000\0Mauthenticati"..., 1024) = 121
close(3)                                = 0
write(2, "FATAL:  authentication failed fo"..., 98FATAL:  authentication failed for user "pgpool"
DETAIL:  username and/or password does not match

我还尝试重置 postgres 用户 pgpool 密码以进行测试,包括在 /etc/pgpool-II-11/pool_passwd 中,但我怀疑它是否重要,因为如果我输入密码,我实际上可以使用 pcp 命令。因此,用户似乎与 postgres 用户是分开的。

编辑:还尝试将 SElinux 临时设置为 permissive,但没有帮助。

postgresql pgpool
  • 1 个回答
  • 1454 Views
Martin Hope
VynlJunkie
Asked: 2018-02-08 08:32:58 +0800 CST

连接到 Pgpool

  • 1

为这篇长文道歉,但我很难让 Pgpool 为我工作。

运行 Centos7 我有两个 Postgres 实例在主复制模式的不同端口上运行。

我已经成功安装了 pgpool-II。

启动 pgpool 我得到输出:

[root@PLHSISRV035 pgpool-II-96]# pgpool -n
2018-02-07 16:21:54: pid 118373: LOG:  Setting up socket for 0.0.0.0:9999
2018-02-07 16:21:54: pid 118373: LOG:  Setting up socket for :::9999
2018-02-07 16:21:54: pid 118373: LOG:  find_primary_node_repeatedly: waiting     for finding a primary node
2018-02-07 16:21:54: pid 118373: LOG:  find_primary_node: checking backend no 0
2018-02-07 16:21:54: pid 118373: LOG:  find_primary_node: primary node id is 0
2018-02-07 16:21:54: pid 118373: LOG:  pgpool-II successfully started. version     3.7.1 (amefuriboshi)

所以从这里我应该能够使用:

psql -l -p 9999 (default settings)

相反,我得到标准未运行 Postgres 错误:

psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.9999"?

任何人都可以帮忙。?

谢谢,

postgresql pgpool
  • 1 个回答
  • 2327 Views
Martin Hope
Roberto
Asked: 2017-02-10 11:31:21 +0800 CST

PgPool II:只写和只读数据库

  • 0

我想设置以下基础设施:

美国的 PSQL 9.6(主)

欧洲的 PSQL 9.6(从属)

欧洲的 PgPool-II

欧洲的应用服务器(它在 90% 的时间内读取数据库)。

我的问题是:我可以在 pgpool 中设置只写和只读数据库吗?我想将我所有的读取发送给从属设备,并将每次写入(但只写)发送给主控设备。这可能吗?或者在主/从模式下,读取查询被发送到主从模式?

postgresql pgpool
  • 1 个回答
  • 1486 Views
Martin Hope
ramanadh
Asked: 2015-11-04 06:42:30 +0800 CST

pgpool 负载平衡将所有查询仅发送到 master

  • 2

我的两台 postgresql 服务器配置为流式复制,运行良好。

Pgpool 配置为主从模式/负载平衡模式。

pgpool.conf:

listen_addresses = '*'
port = 9999
backend_hostname0 = 'master-postgres-ip'
backend_port0 = port-no
backend_weight0 = 1
backend_data_directory0 = 'data-dir'
backend_hostname1 = 'slave-postgres-ip'
backend_port1 = port-no
backend_weight1 = 1
backend_data_directory1 = 'data-dir'
load_balance_mode = on
master_slave_mode = on
master_slave_sub_mode='stream'

我预计所有的写查询都将转到主查询,而读查询将分布在两者之间。但是,所有的查询都只会掌握。但是,如果我停止 master,查询将成为奴隶。

有人可以告诉我可能出了什么问题吗?

pgpool 在启动时给出以下日志:

2015-11-03 17:25:56: pid 21284: LOG:  find_primary_node: checking backend no 0
2015-11-03 17:25:56: pid 21284: LOG:  find_primary_node: checking backend no 1
2015-11-03 17:25:56: pid 21284: DEBUG:  SSL is requested but SSL support is not available
2015-11-03 17:25:56: pid 21284: DEBUG:  authenticate kind = 3
2015-11-03 17:25:56: pid 21284: ERROR:  failed to authenticate
2015-11-03 17:25:56: pid 21284: DETAIL:  invalid authentication message response type, Expecting 'R' and received 'E'
2015-11-03 17:25:56: pid 21284: DEBUG:  find_primary_node: no primary node found
postgresql pgpool
  • 2 个回答
  • 5663 Views
Martin Hope
Luan Huynh
Asked: 2015-03-06 18:06:08 +0800 CST

Pgpool II:无法读取两个网络接口之间的消息长度

  • 4

启动日志文件:

2015-03-06 01:57:56: pid 2760: LOG:  Setting up socket for 0.0.0.0:9999
2015-03-06 01:57:56: pid 2760: LOG:  Setting up socket for :::9999
2015-03-06 01:57:56: pid 2760: LOG:  pgpool-II successfully started. version 3.4.
0 (tataraboshi)
2015-03-06 01:57:56: pid 2760: LOG:  find_primary_node: checking backend no 0
2015-03-06 01:57:56: pid 2760: LOG:  find_primary_node: primary node id is 0
2015-03-06 01:58:02: pid 2792: ERROR:  unable to read message length
2015-03-06 01:58:02: pid 2792: DETAIL:  message length (8) in slot 1 does not mat
ch with slot 0(12)

调试日志文件:

2015-03-06 01:55:07: pid 2680: LOG:  find_primary_node: primary node id is 0
2015-03-06 01:55:42: pid 2712: DEBUG:  I am 2712 accept fd 6
2015-03-06 01:55:42: pid 2712: DEBUG:  reading startup packet
2015-03-06 01:55:42: pid 2712: DETAIL:  Protocol Major: 1234 Minor: 5679 database
:  user: 
2015-03-06 01:55:42: pid 2712: DEBUG:  selecting backend connection
2015-03-06 01:55:42: pid 2712: DETAIL:  SSLRequest from client
2015-03-06 01:55:42: pid 2712: DEBUG:  reading startup packet
2015-03-06 01:55:42: pid 2712: DETAIL:  application_name: psql
2015-03-06 01:55:42: pid 2712: DEBUG:  reading startup packet
2015-03-06 01:55:42: pid 2712: DETAIL:  Protocol Major: 3 Minor: 0 database: post
gres user: enterprisedb
2015-03-06 01:55:42: pid 2712: DEBUG:  creating new connection to backend
2015-03-06 01:55:42: pid 2712: DETAIL:  connecting 0 backend
2015-03-06 01:55:42: pid 2712: DEBUG:  creating new connection to backend
2015-03-06 01:55:42: pid 2712: DETAIL:  connecting 1 backend
2015-03-06 01:55:42: pid 2712: DEBUG:  reading message length
2015-03-06 01:55:42: pid 2712: DETAIL:  slot: 0 length: 12
2015-03-06 01:55:42: pid 2712: DEBUG:  reading message length
2015-03-06 01:55:42: pid 2712: DETAIL:  slot: 1 length: 8
2015-03-06 01:55:42: pid 2712: ERROR:  unable to read message length
2015-03-06 01:55:42: pid 2712: DETAIL:  message length (8) in slot 1 does not mat
ch with slot 0(12)

psql 命令:

[enterprisedb@testing_ppas93]$ psql -h localhost -p 9999 -d postgres
psql: server closed the connection unexpectedly
        This probably means the server terminated abnormally
        before or while processing the request

我使用 pgpool II 来控制两台服务器之间的故障转移事件(谷歌云上的主服务器,我本地的从属服务器,centos x64,数据库:Postgres Plus Advanced Server 9.3)。当我尝试通过端口 9999 (example: psql -h localhost -p 9999 -d postgres) 连接我的数据库时,pgpool 会引发错误

错误:无法读取消息长度

postgresql pgpool
  • 1 个回答
  • 7349 Views
Martin Hope
Rob
Asked: 2015-01-14 05:44:01 +0800 CST

PGpool 升级为 master 并且 Slave 不会在失败时复制

  • 0

很抱歉从 stackoverflow 复制粘贴,但这可能是发布此内容的更好地方。

版本 pgpool-II-pg93-3.4.0-3pgdg.rhel6.x86_64.rpm

不久前我在网上看到过一些关于这个问题的讨论,但我还没有找到解决办法。

我有 2 台 pgpool 服务器运行流复制和负载平衡。它们连接到 3 个 postgres 服务器。2 台是虚拟机,1 台是物理机。

我希望物理机成为主服务器。我已经使用 pcp_promote_node 命令完成了测试,我看到了 show pool_nodes; 显示我选择作为主节点的节点,但是在 postgres 端,命令SELECT pg_is_in_recovery();显示该服务器仍在恢复中。

所有pcp_promote_node命令都是分离主节点。然后阻止插入数据库。

其次,如果主服务器发生故障,另一台服务器确实会成为主服务器,但是另一个从服务器对此一无所知,并且在我从新主服务器恢复之前不会复制任何新数据。

是否有解决上述两个问题的方法。如果您需要更多信息,例如日志等,请告诉我。

谢谢

postgresql pgpool
  • 1 个回答
  • 1704 Views
Martin Hope
Robert
Asked: 2014-09-30 05:13:17 +0800 CST

在不同的主机中使用 pgpool 和 PostgreSQL。

  • 0

我想使用 pgpool 但我做了一些研究,我有疑问,是否需要在同一台机器上安装 PostgreSQL 和 pgpool?当我在同一台主机上进行第一次配置和安装时。但这给我带来了一些问题,有时 Postgresql 服务无法启动,我想将它们分开?有可能的?

postgresql-9.3 pgpool
  • 1 个回答
  • 363 Views
Martin Hope
Czachovic
Asked: 2014-08-12 00:09:42 +0800 CST

使用 Pgpool-II 将 Jira 连接到 Postgresql

  • 0

我在将 Jira 6 连接到 Pgpool-II 时遇到了问题,Pgpool-II 负责 Postgresql 基础(2 个实例)中的负载平衡和复制。

在此处输入图像描述

Pgpool 在端口 9999 上启动,我只想在此(Jira)安装步骤中连接到它,但 Jira 告诉我连接尝试失败....

postgresql pgpool
  • 2 个回答
  • 716 Views
Martin Hope
Ronaldinho
Asked: 2014-08-07 19:23:45 +0800 CST

Pgpool、Postgresql 和客户端之间的数据流是怎样的

  • 2

我是 Pgpool 的新手。

我想问的问题是,客户端查询数据时Pgpool、Postgresql之间的数据流是怎样的

1/

  • 客户端向Pgpool查询数据,
  • PgPool 问问 Postgresql
  • Postgresql计算结果,返回数据给PgPool
  • PgPool 向 Client 传输数据

2/

  • 客户端查询数据到PgPool
  • PgPool 问问 Postgresql
  • Client 和 Postgresql 建立连接
  • Postgresql计算结果,
  • Postgresql直接向Client传输数据

3/其他模式?

你能告诉我正确答案吗

非常感谢

postgresql-9.3 pgpool
  • 1 个回答
  • 806 Views
Martin Hope
Czachovic
Asked: 2014-07-05 02:45:45 +0800 CST

pgpoolAdmin 安装问题

  • 1

我在安装 pgpoolAdmin(最新版本)时遇到了权限问题。问题是当我使用主配置进入窗口时,应该可以进入下一个安装步骤。

问题是访问两个文件:pgpool.conf和pcp.conf。应用程序说:“写访问被拒绝”。我在这些配置文件上尝试了“chmod 777”,而“chown apache config_file_name”没有任何效果。我仍然看到“写访问被拒绝”。整个 pgpool 应用程序位于 /var/www/html/pgpoolAdmin。这两个文件的位置是/usr/local/etc/。我正在使用 Centos 6.5。

抱歉没有图片,但我有上传权限

postgresql pgpool
  • 1 个回答
  • 2351 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve