我坚持如何最好地configuration磁盘arrays。 我们有Hp P2000 G3磁盘arrays和24个SAS物理磁盘,每个300Gb 。 我们需要configuration这个数组得到2个PostgreSQL 9.2副本,因为两个不同的系统。 正如我们所知,build议将数据库和事务日志(pg_xlog)文件存储在不同的磁盘上。 所以我们必须设置4个逻辑磁盘: 2 for transaction logs with RAID 1 2 for database with RAID 10 这是正确的分配scheme吗? 或者,最好只用4个逻辑磁盘做一个大的RAID 10?
首先,我跑了: sudo su postgres createuser -U postgres foouser -P 哪些工作得很好,我跑了: createdb -U foouser -E utf8 -O foouser foodatabase -T template0 并得到“权限被拒绝:无法创build数据库” 首先,我甚至应该像postgres一样做第一个操作(假设我的postgres数据目录由postgres拥有),或者是来自任何用户的-U postgres (假设trust在pg_hba.conf )是否足够? 其次,为什么我会遇到这个错误? 这是因为用户foouser是一个非超级用户? 我应该使用postgres用户创buildfoodatabase ,并简单地-O foouser ?
我试图连接到本地IP上的Postgres实例,我可以连接到使用psql -h localhost命令没有问题。 然而,试图通过rails运行,我得到这个: $ rails c production /home/avishai/.rvm/gems/ruby-1.9.3-p125/gems/activerecord-3.2.9/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `initialize': could not connect to server: Connection refused (PG::Error) Is the server running on host "10.61.99.194" and accepting TCP/IP connections on port 5432? 这是我的/etc/postgresql/9.1/main/pg_hba.conf : # DO NOT DISABLE! # If you change this first entry you will need to make sure that the # database […]
好的,所以我对linux比较陌生。 几个月前,我设法build立了一个使用亚马逊构build的CentOS,PHP和Postgres 9.1的网站。 我在/ pgdata上完成了一个initdb,它安装在我为此创build的Amazon卷上。 这个网站自那以后一直在哼唱,而且我觉得这毕竟不是那么辛苦! 🙂 但现在,我的网站已经closures了。 这是发生了什么… 昨天我login开始一些网站的变化。 我看到的第一件事是有一些更新可用(自然),所以我跑了“百胜更新”。 它做了一堆事情,并报告成功。 凉! 一切都很顺利我的网站上的变化,直到我执行一个Postgres函数的变化。 我得到一个错误: 错误:无法加载库“/usr/lib64/pgsql/plpgsql.so”:“/usr/lib64/pgsql/plpgsql.so”:未定义符号:SPI_plan_get_cached_plan (我在我的函数中使用plpgsql) 谷歌带我到各地,似乎只是需要重新启动Postgresql。 我尝试了各种方法。 Postgres会停下来,但不会重新开始。 在这个过程中的某个时候,我得到了另一个(更有帮助的)错误信息: “数据目录是由PostgreSQL 9.1版本初始化的,它与9.2.3版本不兼容。” 什么? 如果我的yum更新安装了Postgres的一个新的,不兼容的版本? 这是我们如何在Linux世界中滚动? 主要升级没有警告什么是需要或要求我的许可? Foowee,下次我会更加小心。 顺便说一句,如果我再次有空,我该怎么办? 无论如何,这导致我这些 链接 ,当然还有postgres文档。 我现在坚持运行pg_upgrade。 这是我的命令到目前为止: pg_upgrade -d / pgdata_temp -D / pgdata -b /usr/lib64/pgsql/postgresql-9.1/bin/ -B / ?? / -v 如何找出新的Postgres bin目录(/ B参数)? 这似乎并没有在任何地方。 然而,当我跑了 su – […]
从postgres 9.1到9.2,它说数据库需要升级,所以给我的升级命令,并得到以下 $ sudo service postgresql upgrade Stopping postgresql service: [ OK ] Upgrading database: [FAILED] See /var/lib/pgsql9/pgupgrade.log for details. 日志文件/var/lib/pgsql9/pgupgrade.log的内容是 Performing Consistency Checks —————————– Checking current, bin, and data directories ok Checking cluster versions ok connection to database failed: fe_sendauth: no password supplied could not connect to old postmaster started with the command: "/usr/lib64/pgsql/postgresql-9.1/bin/pg_ctl" […]
我正在使用PostgreSQL 9.1进行故障转移的stream式复制和WAL归档。 如果我在备用服务器上使用archive_commandconfiguration指令,它将总是失败(因为它正在尝试归档的WAL段已被master存档),所以我在备用服务器上使用了一个空的archive_command 。 问题是当我的主服务器closures,备用服务器成为新的主存档停止。 如果服务器在主模式下运行,有没有办法在archive_command脚本中知道? 我可以做一个archive_command脚本返回0,如果文件名段我试图归档已经存在,但我不知道这是否正确的行为为archive_command 。
我在Ubuntu 12.04上使用gammu-smsd作为我的短信网关。 它从我的调制解调器扫描信息并将其插入到postgresql数据库中。 显然,它试图根据/ var / log / syslog插入一些无效字符的收件箱: Oct 28 16:22:15 porkypig gammu-smsd[14936]: SQL failed: INSERT INTO inbox (ReceivingDateTime, Text, SenderNumber, Coding, SMSCNumber, UDH, Class, TextDecoded, RecipientID) VALUES ('2013-10-24 20:03:19', 'D83DDC4D','+13053057707','Unicode_No_Compression','+14044550007','','-1','<d83d><dc4d>','') Oct 28 16:22:15 porkypig gammu-smsd[14936]: Error: ERROR: invalid byte sequence for encoding "UTF8": 0xeda0bd#012HINT: This error can also happen if the byte sequence […]
我目前有一个Python脚本,需要从PostgreSQL数据库中获取一些数据。 它目前工作正常,但我必须将脚本移动到另一台服务器B PostgreSQL数据库将保留在服务器A 。 所以我的Python脚本需要从连接到服务器A服务器B访问PostgreSQL数据库。 我已经尝试添加host=servera.my.url.de但给了我 could not connect to server: Connection refused Is the server running on host "servera.my.url.de" (141.X.YZ.AB) and accepting TCP/IP connections on port 5432? 那里的服务器? ping servera.my.url.de PING servera.my.url.de (141.X.YZ.AB) 56(84) bytes of data. 64 bytes from XXXXX (141.X.YZ.AB): icmp_req=1 ttl=58 time=3.76 ms 64 bytes from XXXXX (141.X.YZ.AB): icmp_req=2 ttl=58 time=4.07 […]
我从osX二进制文件安装了Postgres 9.3。 当我尝试使用pg_ctl restart重新启动时,我收到以下错误: $ pg_ctl restart pg_ctl: could not open PID file "/Library/PostgreSQL/9.3/data/postmaster.pid": Permission denied Bryan@bryans-mbp Fri Jun 13 13:41:24 ~ $ sudo ls -la /Library/PostgreSQL/9.3/data/postmaster.pid Password: -rw——- 1 postgres daemon 75 Jun 11 10:36 /Library/PostgreSQL/9.3/data/postmaster.pid 谁应该拥有这个文件,权限是什么?
我有一个关于停止数据库容器的问题。 我有一个运行postgresql的docker镜像 。 当我用这个图像创build一个容器时: sudo docker run –name db -d asg1612 / postgresql 它运行命令: /usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file = / etc / postgresql / 9.3 / main / postgresql.conf 并将目录/ var / lib / pgdata创build为容器卷 我停止与容器: sudodocker停止分贝 数据库会优雅地停止吗? 我会有损坏的数据吗?