我使用 配置了虚拟 NICS pf,并使用qjail create pgsql-jail 192.168.0.3.
当我尝试使用端口收集安装 PostgreSQL 9.3 时,它首先显示奇怪的消息。
pgsql-jail /usr/ports/databases/postgresql93-server >make install
===> Building/installing dialog4ports as it is required for the config dialog
===> Cleaning for dialog4ports-0.1.5_1
===> Skipping 'config' as NO_DIALOG is defined
====> You must select one and only one option from the KRB5 single
*** [check-config] Error code 1
Stop in /basejail/usr/ports/ports-mgmt/dialog4ports.
*** [install] Error code 1
Stop in /basejail/usr/ports/ports-mgmt/dialog4ports.
===> Options unchanged
=> postgresql-9.3.0.tar.bz2 doesn't seem to exist in /var/ports/distfiles/postgresql. …Run Code Online (Sandbox Code Playgroud) 似乎 Postgresql 安装在 Debian 上分为三个文件夹位置:
配置:/etc/postgresql
二进制文件:/usr/lib/postgresql
数据:/var/lib/postgresql
我理解拆分配置文件和数据的好处,但是,二进制文件的位置让我感到困惑——为什么不简单地在 /usr/bin 中?
更重要的是,为什么有些二进制文件会进入 /usr/bin 而其他二进制文件会进入 /usr/lib?
我们运行一个运行 PostgreSQL 的数据库服务器,数据库大小约为 130GB,以每天 500MB 的速度增长。我们使用 HP Data Protector 软件来备份数据库。
这里的问题是我们的数据库位于 GFS 挂载分区上,当前的备份软件许可证不便于从 GFS、NFS 挂载分区进行备份。
因此,作为一种变通方法,我们计划使用pg_dump实用程序将数据库复制到本地分区,并使用数据保护软件从本地分区进行备份。但我不确定我们是否可以使用pg_dump. 我们不可能每天进行完整备份。
请提出对 PostgreSQL 数据库进行增量备份的步骤。
我有两台服务器。服务器 1 可以访问我有权访问但不能通过 SSH 登录的服务器上的 Oracle 实例。我想使用 SSH 端口转发从服务器 2 连接到服务器 1,再从那里连接到 Oracle 实例。我已经设置了GatewayPorts=yes,AllowTcpForwarding=yes但我仍然觉得有些不对劲。
出于这个问题的目的,我只想专注于从服务器 2 端口从 16951 向前连接到服务器 1(端口 5432)上的 postgres 实例。
运行后:
ssh -L 16951:localhost:5432 server1 -nNT -f -g
Run Code Online (Sandbox Code Playgroud)
从服务器 2,我可以"localhost.16951"在运行netstat检查打开的端口后看到,这使我相信该端口正在成功侦听。
当我运行时:
psql -U jbarton -p 16951
Run Code Online (Sandbox Code Playgroud)
我收到一条消息说没有监听端口 localhost:16951
psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.16951"?
Run Code Online (Sandbox Code Playgroud)
非常感谢任何意见、答案或建议。
更新
当我现在使用 oracle 尝试此操作时,使用连接:./sqlplus W_USER/password@//localhost:16951/dbname …
我有一个很长的 psql 命令要在 bash shell 脚本中执行,我想知道将它分成几行的正确方法是什么?标准的 Unix 脚本“分割线”反斜杠字符不起作用。当然,在 postgres 环境中,您可以一行接一行地继续执行,并且在您输入结束分号之前不会处理该命令,但是您不在 shell 脚本中使用它。
我的命令是这样的:
sudo -u postgres /opt/puppet/bin/psql puppetdb -t -c "select certname, r.value as role, e.value as env from certname_facts r join certname_facts e using (certname) where r.name = 'role' and e.name = 'env' order by role,env,certname" | grep -v "^$" > /home/ansible/inventory_list
Run Code Online (Sandbox Code Playgroud)
我不想更改命令,手动输入时一切正常,但我需要知道将其转换为分割线条目的正确方法,例如:
sudo -u postgres /opt/puppet/bin/psql puppetdb -t
-c "select certname, r.value as role, e.value as env
from certname_facts r join certname_faces e using (certname)
where r.name = …Run Code Online (Sandbox Code Playgroud) 我想使用 Postfix、Dovecot、LMTP 和 PostgreSQL 数据库将我自己的邮件服务器放在 VPS 上。我无法使用 mail 命令从 VPS 发送消息,即我没有在我的替换帐户中收到这些电子邮件,并且从备份帐户发送电子邮件以错误结束:
Undelivered Mail Returned to Sender
This is the mail system at host mail.hubot.pl.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<hubot@hubot.pl> (expanded from …Run Code Online (Sandbox Code Playgroud) 我有一个运行多个不同 psql 语句的脚本。当输入的密码不正确时,我试图从 psql 捕获错误输出。检查前输入密码(正确后psql语句执行成功)
我尝试了以下方法:
pwcheck=`psql -q -U postgres -h $ip -d $database;`
echo "error message: $pwcheck"
Run Code Online (Sandbox Code Playgroud)
当我输入错误的密码进行检查时,会输出错误消息但变量为空。
psql: FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres"
error message:
Run Code Online (Sandbox Code Playgroud)
理想情况下,我想将错误消息保存到变量中,而不是打印我自己的错误消息/提示,也根本不显示 psql 错误。
如何将这些错误消息中的任何一个存储在 bash 变量中?
我试图通过关于 digitalocean 的文章(https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-on-postgresql-on- an-ubuntu-12-04-vps)。
第一个奴隶成功连接到主人并且工作正常。第二个从站无法连接。来自 postgresql(第二个从站)日志:
2015-11-02 11:17:35 MSK [14198-1] FATAL: could not connect to the primary server: FATAL: too many connections for role "rep"
Run Code Online (Sandbox Code Playgroud)
来自主服务器的日志:
2015-11-02 11:17:32 MSK [18981-1] rep@[unknown] FATAL: too many connections for role "rep"
Run Code Online (Sandbox Code Playgroud)
每个奴隶需要不同的用户?
如何在 CentOS 7 上停止 Postgresql 实例 9.2。
我在/etc/init.d/ctl 程序下也没有发现任何内容。
需要进行哪些特定更改,以便本地 IP 上的 CentOS 7 安装192.168.1.6可以telnet到另一个本地 IP上的CentOS 7 安装192.168.1.5?
如您所见,可以192.168.1.6PING192.168.1.5如下:
[root@localhost /]# ping 192.168.1.5
PING 192.168.1.5 (192.168.1.5) 56(84) bytes of data.
64 bytes from 192.168.1.5: icmp_seq=1 ttl=64 time=0.515 ms
64 bytes from 192.168.1.5: icmp_seq=2 ttl=64 time=0.565 ms
^C
--- 192.168.1.5 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1000ms
rtt min/avg/max/mdev = 0.515/0.540/0.565/0.025 ms
Run Code Online (Sandbox Code Playgroud)
但telnetFROM 192.168.1.6TO192.168.1.5失败如下:
[root@localhost /]# telnet 192.168.1.5
Trying …Run Code Online (Sandbox Code Playgroud)