公司的一个项目,使用的nodejs做服务端,数据库是postgresql,在本地时一切ok,放在centos时,postgresql配置ok,可以远程访问,但是nodejs在centos启动时,就会报错,找不到postgresql服务,Error Msg如下:

09/14 10:00:27 - info: Error: Failed to find PostgresSQL server. Please double check your settings.
at connectCallback (/home/sm_dir/CenterAPI/node_modules/sequelize/lib/dialects/postgres/connector-manager.js:112:35)
at /home/sm_dir/CenterAPI/node_modules/pg/lib/pool.js:54:25
at /home/sm_dir/CenterAPI/node_modules/pg/node_modules/generic-pool/lib/generic-pool.js:271:11
at /home/sm_dir/CenterAPI/node_modules/pg/lib/pool.js:27:26
at null.<anonymous> (/home/sm_dir/CenterAPI/node_modules/pg/lib/client.js:172:5)
at emit (events.js:95:17)
at Socket.<anonymous> (/home/sm_dir/CenterAPI/node_modules/pg/lib/connection.js:56:10)
at Socket.emit (events.js:95:17)
at net.js:834:16
at process._tickDomainCallback (node.js:502:13)

  远程访问都可以,结果本地却不行,一直没有头绪。几经周折,在一个stack overflow的帖子中找到了灵感,帖子的链接如下:http://stackoverflow.com/questions/21740560/node-server-cant-connect-to-postgres-db

node-modules=>pg对password,不支持一些特殊字符,其中就有#,而我的数据库密码是:local#123. 于是,移除#,改为local123,之后=》“Init => db success...”,终于成功连接上了。

总结:事后分析,远程连接ok,是postgresql配置的问题,远程和本地连接走的验证方式不一样.

postgresql on centos (sequelize+pg+nodejs):Failed to find PostgresSQL server.Pleast double check your settings的更多相关文章

  1. CentOS编译安装NodeJS+Express

    NodeJS是基于Chrome’s Javascript runtime,也就是Google V8引擎执行Javascript的快速构建网络服务及应用的平台,其优点有: 在CentOS编译安装Node ...

  2. CentOS 编译安装 Nodejs (实测 笔记 Centos 7.3 + node 6.9.5)

    环境: 系统硬件:vmware vsphere (CPU:2*4核,内存2G,双网卡) 系统版本:CentOS-7.0-1406-x86_64-DVD.iso 安装步骤: 1.准备 1.1 显示系统版 ...

  3. centos下安装nodejs及websocket

    软件环境: VMware Workstation CentOS 6.5 NodeJS v0.12.5 安装过程: Step 1.确认服务器有nodejs编译及依赖相关软件,如果没有可通过运行以下命令安 ...

  4. phpmailer的SMTP ERROR: Failed to connect to server: 10

    请问,我在win7上学习使用phpmailer时,出现这种错误怎么处理啊? SMTP ERROR: Failed to connect to server: (0) SMTP connect() fa ...

  5. (onlyoffice)在CentOS及其衍生产品上安装Linux的Document Server

    介绍 Document Server是一个在线办公套件,包括用于文本,电子表格和演示文稿的查看器和编辑器,与Office Open XML格式完全兼容:.docx,.xlsx,.pptx,并支持实时协 ...

  6. GConf error:Failed to contact configuration server

    Linux系统运行一直正常,但是图形界面使用root账号登录时遇到下面错误,第一次遇到这么怪异的状况 具体错误信息如下所示: GConf error:Failed to contact configu ...

  7. SSH登录之后运行命令报错的解决办法-- Failed to connect to Mir: Failed to connect to server socket: No such file or directory

    问题描述: Failed to connect to Mir: Failed to connect to server socket: No such file or directory 解决方案: ...

  8. LoadRunner执行过程报错“Failed to connect to server "xxx.xxx.xxx.xxx:xx":[10060] connetion time out”

    执行性能测试过程中,LR报错: Action.c(6):Error -27796: Failed to connect to server "xxx.xxx.xxx.xxx:xx" ...

  9. 【LR11】Error -27796: Failed to connect to server"server:port": [10060] Connection timed out错误解决办法

      场景描述:被测系统是发布在远程服务器上的,假设IP是10.10.10.10,端口是8066,那么访问地址是http://10.10.10.10:8066/,在control机器上我设置了IP欺骗. ...

随机推荐

  1. Klaus Aschenbrenner--windbg

    http://www.sqlservercentral.com/blogs/aschenbrenner/?page=1

  2. Spring的学习(IoC,AOP)等

    下面这个系列是非常好的例子: http://www.yiibai.com/spring/spring-3-hello-world-example.html 正在看,把一些基础夯实. IoC可以从下面一 ...

  3. linux过滤ip地址

    一.系统版本 [root@zabbix-server tmp]# cat /etc/redhat-release CentOS Linux release 7.2.1511 (Core) 二.用awk ...

  4. onvif 协议

    1.ONVIF 协议解读 https://www.onvif.org 一.什么是ONVIF? 1.1形成 2008年5月,由安讯士(AXIS)联合博世(BOSCH)及索尼(SONY)公司三方宣布携手共 ...

  5. Mybatis学习记录(一)---- 简单的CRUD

    1 mybatis是什么? mybatis是一个持久层的框架,是apache下的顶级项目. mybatis托管到googlecode下,再后来托管到github下(https://github.com ...

  6. 倍福TwinCAT(贝福Beckhoff)应用教程11.1 TwinCAT应用小程序1 贝福IO模块介绍

    EL1002,EL1004,EL1008都是数字输入模块(2个点,4个点,8个点),输入高的范围是15V到30V,低的范围是-3V到5V         EL2002,EL2004,EL2008都是数 ...

  7. hdu 1348 Wall (凸包模板)

    /* 题意: 求得n个点的凸包.然后求与凸包相距l的外圈的周长. 答案为n点的凸包周长加上半径为L的圆的周长 */ # include <stdio.h> # include <ma ...

  8. C中的C文件与h文件辨析(转)

    简单的说其实要理解C文件与头文件(即.h)有什么不同之处,首先需要弄明白编译器的工作过程,一般说来编译器会做以下几个过程:       1.预处理阶段 2.词法与语法分析阶段 3.编译阶段,首先编译成 ...

  9. lucene 搜索优化,个人实战经验总结

    1.IndexSearch.IndexReader等都是线程安全的类,多线程并发使用是没有问题的.不到忘不得以,尽量避免重新实例化,他们实例化是很花费时间的,看一下他们的构造原理你就知道了.   2. ...

  10. Log4j介绍,log4j.properties配置详解

    http://www.cnblogs.com/simle/archive/2011/09/29/2195341.html本文主要解释log4j的配置文件各个配置项的含义,内容是从网上转载的 1.Log ...