公司的一个项目,使用的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. Enable a SQL Server Trace Flag Globally on Linux

    https://www.mssqltips.com/sql-server-tip-category/226/sql-server-on-linux// Microsoft has recently r ...

  2. 再谈 Promise

    读完这篇文章,预计会消耗你 40 分钟的时间. Ajax 出现的时候,刮来了一阵异步之风,现在 Nodejs 火爆,又一阵异步狂风刮了过来.需求是越来越苛刻,用户对性能的要求也是越来越高,随之而来的是 ...

  3. Telnet环境变量

    转:http://www.cnpaf.net/Class/Telnet/200408/2.html 当前位置: 网站首页>>协议大全>>TELNET协议>> Tel ...

  4. Shiro 设置session超时时间

    通过api:Shiro的Session接口有一个setTimeout()方法 //登录后,可以用如下方式取得session SecurityUtils.getSubject().getSession( ...

  5. nodeJs建立简单的服务器

    var http = require('http');//http依赖 var hostname = '127.0.0.1';//本地 var port = 3000;//端口 var server ...

  6. javascript快速入门12--函数式与面向对象

    函数 函数是一组可以随时随地运行的语句. 函数是 ECMAScript 的核心. 创建函数 function fnOne() {//具有名称的函数,函数名必须符合变量名命名规范 //可以没有符何语句 ...

  7. profiler

    推荐C++ 的profiler 用于GPU CPU 综合测试 FramePro http://www.puredevsoftware.com/ 可以在进度条上拉时间 查看GPU CPU bound

  8. 使用tornado实现用户认证

    关于用户的登录状态,一部分的应用程序是采用session实现的. HTTP是一个无状态协议,用户的每次请求都是相互独立的,HTTP本身意识不到用户是否登录. 很多web框架选择将session存放在c ...

  9. lodash pick

    (1) _.pick(object, [props]) 创建一个从 object 中选中的属性的对象. var object = { 'a': 1, 'b': '2', 'c': 3 }; _.pic ...

  10. Maven入门学习

    1 Maven的安装 maven下载路径:http://maven.apache.org/download.cgi 我是在win7上安装了,安装后在cmd输入 mvn -v: C:\Users\*** ...