playframework 2.0 - 在数据库发展上超过了max_user_connections(使用本地postgres服务器) [英] playframework 2.0 - exceeded max_user_connections on database evolutions (with local postgres server)

查看:200
本文介绍了playframework 2.0 - 在数据库发展上超过了max_user_connections(使用本地postgres服务器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题与( playframework 2.0 - 在数据库发展上超出max_user_connections?)只有这次是使用本地postgres安装。我有一个示例应用程序,我在hub @ http://git.io/CdEntA 上抛出。



我试图在本地运行它,使用

  sbt阶段
target / start -DapplyEvolutions.default = true -Ddb.default.driver = org.postgresql.Driver - Ddb.default.url =jdbc:postgresql:// localhost:5432 / test?user = myuser

当我启动 http:/ / localhost:9000 ,我在控制台上看到的是...

  [error] cjbhAbstractConnectionHook  -  Failed获取连接睡眠1000毫秒并再次尝试。尝试离开:10.异常:null [错误] c.j.b.h.Abs​​tractConnectionHook  - 获取连接失败睡眠1000毫秒并再次尝试。尝试离开:10.例外:空[信息]播放 - 应用程序启动(产品)[信息]播放 - 监听端口9000上的HTTP ... [错误] c.j.b.h.Abs​​tractConnectionHook  - 获取连接失败睡眠1000毫秒并再次尝试。尝试离开:9.异常:null [错误] c.j.b.h.Abs​​tractConnectionHook  - 获取连接失败睡眠1000毫秒并再次尝试。尝试离开:8.异常:null [错误] c.j.b.h.Abs​​tractConnectionHook  - 获取连接失败睡眠1000毫秒并再次尝试。尝试离开:7.异常:null [错误] c.j.b.h.Abs​​tractConnectionHook  - 获取连接失败睡眠1000毫秒并再次尝试。尝试离开:6.异常:null [错误] c.j.b.h.Abs​​tractConnectionHook  - 无法获取连接睡眠1000毫秒并再次尝试。尝试离开:5.异常:null [错误] c.j.b.h.Abs​​tractConnectionHook  - 无法获取连接睡眠1000毫秒并再次尝试。尝试离开:4.异常:null [错误] c.j.b.h.Abs​​tractConnectionHook  - 获取连接失败睡眠1000毫秒并再次尝试。尝试离开:3.异常:null [错误] c.j.b.h.Abs​​tractConnectionHook  - 获取连接失败睡眠1000毫秒并再次尝试。尝试离开:2.异常:null [错误] c.j.b.h.Abs​​tractConnectionHook  - 获取连接失败睡眠1000毫秒并再次尝试。尝试离开:1.异常:null [错误] c.j.b.PoolWatchThread  - 尝试获取连接时出错。重试1000毫秒org.postgresql.util.PSQLException:致命:对不起,已有太多客户端已在org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:293)〜[postgresql-9.1-901-1.jdbc4。 jar:na] 

当我查看数据库时,我发现实际上使用了所有连接

任何帮助都不胜感激。



谢谢。

解决方案

我相信你的问题是你不覆盖 db.default.user 配置参数所以它使用 sa 值。只需在 conf / application.conf 文件中注释以下行:

  db.default.user = sa 

一旦我完成并重新运行 sbt stage 那么它对我来说工作得很好。


I am having the same exact issue as (playframework 2.0 - exceeded max_user_connections on database evolutions?) only this time it is with a local postgres install. I have a sample application I threw up on hub @ http://git.io/CdEntA.

I attempt to run it locally, using

sbt stage
target/start -DapplyEvolutions.default=true -Ddb.default.driver=org.postgresql.Driver -  Ddb.default.url="jdbc:postgresql://localhost:5432/test?user=myuser"

When I launch http://localhost:9000, all I see on the console is...

[error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 10. Exception: null [error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 10. Exception: null [info] play - Application started (Prod) [info] play - Listening for HTTP on port 9000... [error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 9. Exception: null [error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 8. Exception: null [error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 7. Exception: null [error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 6. Exception: null [error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 5. Exception: null [error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 4. Exception: null [error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 3. Exception: null [error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 2. Exception: null [error] c.j.b.h.AbstractConnectionHook - Failed to acquire connection Sleeping for 1000ms and trying again. Attempts left: 1. Exception: null [error] c.j.b.PoolWatchThread - Error in trying to obtain a connection. Retrying in 1000ms org.postgresql.util.PSQLException: FATAL: sorry, too many clients already at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:293) ~[postgresql-9.1-901-1.jdbc4.jar:na]

When I take a peek into the database, I see all connections are in fact used up by the process.

Any help with be greatly appreciated.

Thanks.

解决方案

I believe your problem is that you are not overriding the db.default.user config parameter so it's using the sa value. Just comment out the following line in your conf/application.conf file:

db.default.user=sa

Once I did that and re-ran sbt stage then it worked fine for me.

这篇关于playframework 2.0 - 在数据库发展上超过了max_user_connections(使用本地postgres服务器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆