Articles of postgresql

如何在CentOS 7上更改PostgreSQL 9.5使用的默认端口?

有人有关于如何更改PostgreSQL 9.5的默认端口的想法,我做了以前的版本和我只是修改以下文件相同: /var/lib/pgsql/9.5/data/postgresql.conf listen_addresses = '*' port = 4000 /etc/phpPgAdmin/config.inc.php $conf['servers'][0]['host'] = 'localhost'; $conf['servers'][0]['port'] = 4000; 我正在使用phpPgAdmin从网上检查数据库,它使用默认端口,但它不工作时不使用默认端口,也在terminal我重新启动postgresql服务后得到这个错误: [root@cos7psql01 system]# su – postgres Last login: Sun Jan 17 12:38:27 CST 2016 on pts/0 -bash-4.2$ psql psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix […]

Postgres服务器不是从drbd + pacemaker开始的

我试图通过drbd和fiesystem在Ubuntu 14.04上启动postgres服务器。 服务状态如下: Last updated: Mon Mar 14 01:16:45 2016 Last change: Mon Mar 14 01:05:53 2016 via cibadmin on node1 Stack: corosync Current DC: node2 (2) – partition with quorum Version: 1.1.10-42f2063 2 Nodes configured 5 Resources configured Online: [ node1 node2 ] Master/Slave Set: ms_drbd [drbd_postgres] Masters: [ node1 ] Stopped: [ node2 […]

zfs是否logging冲击压缩比率

我们在启用了lz4压缩的zfs上托pipe了一个postgresql95 OLAP数据库。 build议我们将zfs recordsize调整为8KB,因为这是postgres块的大小。 提前写入日志位于自己的数据集,其logging大小设置为1M: NAME PROPERTY VALUE SOURCE ssd recordsize 128K default ssd/pgdata recordsize 8K local ssd/pgdata/log recordsize 1M local 我注意到日志压缩比较好。 我不知道原因是它是更可压缩的,或者如果小logging真的伤害了压缩比。 NAME PROPERTY VALUE SOURCE ssd compressratio 1.84x – ssd/pgdata compressratio 1.84x – ssd/pgdata/log compressratio 2.64x –

PostgreSQL无法从本地主机进行身份validation,只能从远程进行身份validation

我有一个运行postgreSQL的服务器。 前几天我设置它,以便我可以从我的家用电脑远程访问数据库和工作(基于本指南: http : //www.cyberciti.biz/tips/postgres-allow-remote-access-tcp -connection.html )。 现在我注意到,无论什么原因,我无法通过本地主机或127.0.0.1访问数据库。 psql mydatabase工作没有任何问题。 psql -h myDomain.net mydatabase也可以。 psql -h localhost mydatabase告诉我 psql: FATAL: Ident authentication failed for user "smaug" 我尝试恢复我之前为了远程访问数据库而做出的更改,但都无济于事。 造成这个问题的原因是什么?

PostgreSQL 9.5通过puppet模块无法在Ubuntu Trusty上安装

尝试使用Puppet在Ubuntu Trusty上安装PostgreSQL 9.5,使用所有我能find的文档 ,使用以下简单的类结构: class { 'postgresql::globals': manage_package_repo => true, version => '9.5' } -> class { 'postgresql::server': ip_mask_allow_all_users => '0.0.0.0/0', listen_addresses => '*', postgres_password => '', encoding => 'UTF-8', locale => 'en_US.UTF-8', } 我遇到以下致命错误: ==> default: Debug: Automatically imported postgresql::server::database_grant from postgresql/server/database_grant into production ==> default: Error: validate_re(): "B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8" does not match ["\\A(0x)?[0-9a-fA-F]{8}\\Z", "\\A(0x)?[0-9a-fA-F]{16}\\Z"] […]

为什么不“psql -U”为我工作?

我只是从Postgres开始。 这是Ubuntu 14.04 LTS上的Postgres 9.5的全新安装。 我使用apt回购: http : //www.postgresql.org/download/linux/ubuntu/ 介绍页面http://www.postgresql.org/docs/9.5/static/tutorial-createdb.html说“-U”应该工作。 它不: chris@blue:~$ psql -U postgres psql: FATAL: Peer authentication failed for user "postgres" 然而,如果我“追求”后果,一切都很好: chris@blue:~$ sudo su – postgres postgres@blue:~$ psql psql (9.5.2) Type "help" for help. postgres=# 我误解了什么?

无法连接到服务器上的Postgresql

在数字海洋我能够连接到Postgresql: psql -d my_db -U my_name 为此我要求一个密码,并且我成功地进入了。 但从我的本地计算机,我无法: psql -d my_db -U my_name -h xxxx 什么也没有发生。 这是我的/etc/postgresql/9.4/main/pg_hba.conf # Database administrative login by Unix domain socket local all postgres peer # TYPE DATABASE USER ADDRESS METHOD # "local" is for Unix domain socket connections only local all all md5 # IPv4 local connections: host all all […]

ZFS:使用PostgreSQL的ARC和缓冲区caching

我正在使用Ubuntu Xenial,zfs和PostgreSQL 9.5以及所有可用的atm更新。 所有的testing都在EC2 m4.xlarge(8GB RAM)和表格大小〜4GB上完成。 PostgreSQL effective_cache_size = 6GB。 第一个版本:primarycache =元数据,arc_max_size = 1GB(testing4和6GB),arc_size =〜160mb,但Ubuntu不使用buff / cache进行顺序扫描(free -m表示buff / cache = 200MB,不增长)而是每次执行查询时从磁盘读取数据。 所以查询非常缓慢。 第二种情况:primarycache = all,arc_max_size = 4GB。 顺序读取被caching,但是无论何时更改数据库(Postgres从主服务器接收到更新),caching都将变为无效(我看到Postgres从磁盘读取数据)。 我做错了什么? PS cat /etc/modprobe.d/zfs.conf options zfs zfs_prefetch_disable=1 options zfs zfs_nocacheflush=1 options zfs zfs_arc_max=7073741824

PostgreSQL:启用pg_stat_statements而无需重新加载服务器

我想启用扩展pg_stat_statements 。 它作为扩展安装。 但是,直到服务器重新启动后才能看到它。 有什么办法可以避免重启? 我试过了: /etc/init.d/pg… reload SELECT pg_reload_conf()

postgresql无法分配请求的地址

我有一个网站与Nginx的,PHP的FMP,Postgresql和PGBouncer,它已经工作了一年多了。 昨天服务器进入不响应,重新启动后,它工作5或10分钟,之后没有响应和相同的错误信息: 2017/04/04 15:32:37 [error] 2532#0:* 31341 FastCGI在stderr中发送:“PHP消息:PHP警告:pg_connect():无法连接到PostgreSQL服务器:无法连接到服务器:无法分配请求的地址服务器是否在第21行的/usr/share/nginx/html/lib/postgresql.class.php中的主机“127.0.0.1”上运行,并接受端口6432上的TCP / IP连接? 我甚至恢复到上次工作configuration,它仍然是相同的(当我开始nginx,它的工作一两分钟,然后上面的错误)。 我检查了php-fpm日志,我遇到以下情况: [04-Apr-2017 14:48:50]警告:[池www]似乎很忙(你可能需要增加pm.start_servers或pm.min / max_spare_servers),产卵8个孩子,有0个空闲,共24个孩子 和 [04-Apr-2017 14:48:59]警告:[池www]服务器达到pm.max_children设置(50),考虑提高它 在postgresql日志中,我发现这个: 提示:考虑增加configuration参数“max_wal_size”。 到目前为止我已经改变了以下参数 在php-fpm中: pm.max_childeren from 50 to 100 pm.start_servers from 5 to 10 pm-min_spare_servers from 5 to 10 pm-max_spare_servers from 35 to 100 在Postgresql中: mac_wal_size from 1GB to 2GB 仍然没有运气! 我该怎么办?