我使用HAProxy 1.5-dev21来通过一些只读Postgresql 9.2服务器来平衡PostgreSQL连接。 HAProxy版本1.5实现了一个pgsql-check选项 ,类似于mysql-check。 这是我的这种池的典型HAProxyconfiguration: listen pgsql_pool 0.0.0.0:10001 mode tcp option pgsql-check user postgres balance roundrobin server slave1 10.0.0.1:5432 check server slave2 10.0.0.2:5432 check 这是有效的,我的意思是HAProxy检测到slave1 / slave2启动,我可以正常连接到端口10001上的PG,但由于pgsql-check选项,我在postgresql日志中看到这样的消息,每2秒: 2014-01-29 17:37:33 CET [17170] postgres postgres (10.0.0.10(56706)) LOG: could not receive data from client: Connection reset by peer 2014-01-29 17:37:35 CET [17173] postgres postgres (10.0.0.10(56707)) LOG: could […]
我正在使用连接到pgpool2的Liferay集群,当我对Web服务器运行大量的用户活动时,我发现很多关于liferay无法build立到数据库连接的exception。 在pgpool后面有两个数据库 例外情况 Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database! ———- Caused by: com.mchange.v2.resourcepool.ResourcePoolException: A ResourcePool cannot acquire a new resource — the factory or source appears to be down. org.postgresql.util.PSQLException: The connection attempt failed. at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:152) at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66) at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125) at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30) at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24) at org.postgresql.Driver.makeConnection(Driver.java:393) at org.postgresql.Driver.connect(Driver.java:267) at […]
我正在尝试按照网站上的这些说明安装istSOS : 安装 安装PostgreSQL $ sudo apt-get install postgresql postgresql-client postgresql-contrib pgadmin3 安装PostGIS $ sudo apt-get install postgresql-9.1-postgis configurationPostgreSQL密码 $ sudo -u postgres psql > alter user postgres password 'postgres'; 安装Apache2 $ sudo apt-get install apache2 安装mod_wsgi $ sudo apt-get install libapache2-mod-wsgi 安装psycopg2 $ sudo apt-get install python-psycopg2 下载istSOS并将其解压到/usr/local/istsos $ wget http://istsos.googlecode.com/files/istSOS-2.0.tar.gz 下载位置实际上已经改变为SourceForge 。 $ […]
我有一台高兴地运行PostgreSQL的服务器,直到今天早上崩溃。 试图重新启动Postgres,但它失败: sudo /etc/init.d/postgresql start Starting PostgreSQL 9.1 database server Removed stale pid file. The PostgreSQL server failed to start. Please check the log output: …fail! 做tail /var/log/postgresql/postgresql-9.1-main.log ,我看到它崩溃之前的几个消息 – 但没有从重新启动输出。 旧的消息说: UTC WARNING: pgstat wait timeout 操作系统:Ubuntu 12.04.3
我有一个奇怪的问题,我试图在Apache下CentOS 7 mod_wsgi下运行一个烧瓶应用程序( https://github.com/pyfarm/pyfarm-master )无法连接到本地postgresql服务器 – 但只有当说apache已经使用systemctl从systemd启动。 如果我在命令行上使用/usr/sbin/httpd -DFOREGROUND手动启动apache(systemd说明使用相同的命令),一切正常。 Apache,Postgresql和mod_wsgi几乎没有改变来自CentOS仓库或EPEL的默认安装。 pyfarm-core和pyfarm-master已经在pip的帮助下安装了。 除了将基于主机的身份validation设置为“信任”localhost的所有内容之外,postgresqlconfiguration与默认值没有任何关系: # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust # IPv6 local connections: host all all ::1/128 trust 之后,我创build了一个用户和一个数据库 CREATE USER pyfarm WITH PASSWORD 'pyfarmpw'; CREATE DATABASE pyfarm WITH OWNER […]
我正试图将Weblogic环境从Oracle移植到PostgreSQL。 当我使用PostgreSQL上的安全存储configuration一个域时,它无法启动。 Weblogic 12c,Java 7,PostgreSQL 9.3.4这里在Mac OS X上,但在Linux上同样的问题。 该域是使用安全存储数据源作为PostgreSQL创build的(可从下拉菜单中select),并已正确configuration。 该模式是基于Derby模式通过用BYTEAreplaceBLOB而创build的。 startWeblogic给出: <Aug 7, 2014 5:48:02 PM CEST> <Warning> <Security> <BEA-090076> <A failure occurred attempting to load LDIF for provider Authorizer from file /Users/darcher/Dev/wls/wlserver/server/lib/XACMLAuthorizerInit.ldift.> <Aug 7, 2014 5:48:02 PM CEST> <Error> <Security> <BEA-090870> <The realm "myrealm" failed to be loaded: weblogic.security.service.SecurityServiceException: com.bea.common.engine.ServiceInitializationException: weblogic.security.spi.ProviderInitializationException: A failure occurred […]
我有一个Nginx和PostgreSQL的OpenShift设备,需要允许一个Java applet(由Nginx提供)直接访问PG数据库。 我已经尝试编辑~/postgresql/conf/postgresql.conf.erb.hidden ,但是我似乎没有适当的权限来更改它,并且不能更改环境variablesOPENSHIFT_POSTGRESQL_DB_PORT 。 那么有没有人有其他的build议? 这是一个学校的任务,我宁愿不必使用另一台服务器的数据库,并且从字面上不能为此(不幸的是,这部分的任务)的API。
我有一个使用PostgreSQL 9.3的主和热备份设置,我试图使用check_postgres工具和“hot_standby_delay”操作来监视备用数据库上的复制状态。 这似乎通过计算主站和备用站上xlog位置之间的字节差异来起作用。 在许多在线示例中,我已经看到了这个在<1MB范围内的警告和关键阈值。 我们在Nagios中使用的确切命令是: /usr/local/bin/check_postgres.pl –action=hot_standby_delay –host=$HOSTNOTES$,$HOSTADDRESS$ –port=5432 –dbname=monitoring –dbuser=monitoring –dbpass=monitoring –warning=1000000 –critical=5000000 这应该设置一个大约1MB的警告和大约5MB的中断。 但是,在我们的服务器上,我们经常会看到它的高峰,如下所示: [1417719713] SERVICE ALERT: host;PostgreSQL: Replication Delay;CRITICAL;SOFT;1;POSTGRES_HOT_STANDBY_DELAY CRITICAL: DB "monitoring" (host:host.example.com) 121175880 [1417719773] SERVICE ALERT: host;PostgreSQL: Replication Delay;CRITICAL;SOFT;2;POSTGRES_HOT_STANDBY_DELAY CRITICAL: DB "monitoring" (host:host.example.com) 132780968 [1417719833] SERVICE ALERT: host;PostgreSQL: Replication Delay;CRITICAL;SOFT;3;POSTGRES_HOT_STANDBY_DELAY CRITICAL: DB "monitoring" (host:host.example.com) 21412936 随后在下一个Nagios检查与: [1417719893] SERVICE ALERT: host;PostgreSQL: Replication […]
我目前有一个Web应用程序和数据库在同一台服务器上。 我正在将数据库移动到一个指定为数据库的新服务器上。 现在,我已经在Web应用程序上运行了每晚脚本,这些脚本为我们的ERP系统中的应用程序插入和更新数据。 执行此导入的脚本是否应该从数据库服务器或应用程序服务器运行? 把所有的应用程序逻辑放在一起是合理的,但是从性能的angular度来看,更有意义(我认为)让每晚更新数据库的脚本从实际的数据库服务器运行。 可能或不需要的问题,但我有一个网站,3个Web应用程序,都是从本地数据库安装转换到新的中央数据库。 最后一个问题应该是数据库服务器在DMZ中,但被locking为仅接受应用程序服务IP的连接,还是应该在防火墙之后? 其他信息,如果有帮助的话:Python应用程序(TG和Flask)全部使用postgresql 9运行 编辑:如果这是这个错误的地方,请让我知道它应该发布。 我原本是在程序员那里,但没有得到任何答复,在重新阅读我的问题后,这个网站感觉“更好”。
当我连接到远程服务器上的psql >psql -h {hostname} psql: could not connect to server: Connection timed out (0x0000274C/10060). Is the server running on host "{hostname}" (194.58.98.133) and accepting TCP/IP connections on port 5432? 在服务器上: netstat -nlp | grep 5432 tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 29609/postmaster tcp 0 0 :::5432 :::* LISTEN 29609/postmaster unix 2 [ ACC ] STREAM […]