gpt4 book ai didi

PostgreSQL - 无法在 pgpool 2 上启动委托(delegate) ip 地址

转载 作者:行者123 更新时间:2023-11-29 12:24:42 25 4
gpt4 key购买 nike

我尝试在 ubuntu 服务器上设置 pgpool 服务器并点击此链接:pgpool-II Tutorial [ Watchdog ] .

但是当我启动一个 pgpool 服务时,委托(delegate)的 IP 并没有启动。

我在 syslog 的日志文件中看到了这样的错误。

    Oct 25 08:46:25 pgpool-1 pgpool[1647]: [8-2] 2017-10-25 08:46:25: pid 1647: DETAIL:  Host:"172.16.0.42" WD Port:9000 pgpool-II port:5432 
Oct 25 08:46:25 pgpool-1 pgpool: SIOCSIFADDR: Operation not permitted
Oct 25 08:46:25 pgpool-1 pgpool: SIOCSIFFLAGS: Operation not permitted
Oct 25 08:46:25 pgpool-1 pgpool: SIOCSIFNETMASK: Operation not permitted
Oct 25 08:46:25 pgpool-1 pgpool[1648]: [18-1] 2017-10-25 08:46:25: pid 1648: LOG: failed to acquire the delegate IP address
Oct 25 08:46:25 pgpool-1 pgpool[1648]: [18-2] 2017-10-25 08:46:25: pid 1648: DETAIL: 'if_up_cmd' failed
Oct 25 08:46:25 pgpool-1 pgpool[1648]: [19-1] 2017-10-25 08:46:25: pid 1648: WARNING: watchdog escalation failed to acquire delegate IP

我将 ubuntu 14.04 与 pgpool2 版本 3.6.6-1 和看门狗版本 5.31-1 一起使用。

我已经在 pgpool.conf 上配置了这样的虚拟 IP 设置。

# - Virtual IP control Setting -
delegate_IP = '172.16.0.201'
if_cmd_path = '/sbin'
if_up_cmd = 'ifconfig eth0:0 inet $_IP_$ netmask 255.255.0.0'
if_down_cmd = 'ifconfig eth0:0 down'
arping_path = '/usr/sbin'
arping_cmd = 'arping -U $_IP_$ -w 1'

对此有什么建议吗?感谢您的帮助。

最佳答案

看起来运行它的用户没有使用 ifconfig 的权限。你关注了吗those steps来自教程?

setuid configuration

In watchdog process, root privilege is required to contol virtual IP. You could start pgpool-II as root user. However in this tutorial, Apache needs to start pgpool as apache user and control virtual IP because we are using pgpoolAdmin. For this purpose, we setuid if_config and arping. Also we don't want any user other than apache accesses the commands because of security reason. Execute following commands on each of osspc19 and osspc20 (It requires root privilege).

At first, make a directory for containing ipconfig and arping which is set setuid. The path is specified at ifconif_path and arping_path; in this tutorial, this is /home/apache/sbin. Then give execute privilege to only apache user.

$ su -
# mkdir -p /home/apache/sbin
# chown apache:apache /home/apache/sbin
# chmod 700 /home/apache/sbin

Next, copy the original ifconfig and arping to the directory and then set setuid to these.

# cp /sbin/ifconfig /home/apache/sbin
# cp /use/sbin/arping /home/apache/sbin
# chmod 4755 /home/apache/sbin/ifconfig
# chmod 4755 /home/apache/sbin/arping

Note that explained above should be used for tutorial purpose only. In the real world you'd better create setuid wrapper programs to execute ifconfig and arping. This is left for your exercise.

关于PostgreSQL - 无法在 pgpool 2 上启动委托(delegate) ip 地址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46928633/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com