Postgresql中的数据不保存

时间:2017-06-20 01:56:42

标签: django postgresql ubuntu ubuntu-16.04

Ubuntu 16.04,Postgres 9.5,django == 1.10.7

我的django项目中的数据不保存在数据库中。

我可以完全使用该应用程序。但数据未保存。

迁移正在运行,也创建了超级用户,但数据不保存。在当地的开发中,所有工作都很好,但在生产中没有。

在postgresql-9.5-main.log中看到了这个:

2017-06-16 18:26:42 MSK [1026-2] LOG:  received fast shutdown request
2017-06-16 18:26:42 MSK [1026-3] LOG:  aborting any active transactions
2017-06-16 18:26:42 MSK [1040-2] LOG:  autovacuum launcher shutting down
2017-06-16 18:26:42 MSK [1037-1] LOG:  shutting down
2017-06-16 18:26:42 MSK [1037-2] LOG:  database system is shut down
2017-06-16 18:26:57 MSK [1056-1] LOG:  database system was shut down at 2017-06-16 18:26:42 MSK
2017-06-16 18:26:57 MSK [1056-2] LOG:  MultiXact member wraparound protections are now enabled
2017-06-16 18:26:57 MSK [1038-1] LOG:  database system is ready to accept connections
2017-06-16 18:26:57 MSK [1061-1] LOG:  autovacuum launcher started
2017-06-16 18:26:57 MSK [1273-1] [unknown]@[unknown] LOG:  incomplete startup packet
2017-06-16 21:35:42 MSK [5836-1] user@user LOG:  could not receive data from client: Connection reset by peer
2017-06-17 17:37:27 MSK [26684-1] user@user LOG:  could not receive data from client: Connection reset by peer
2017-06-17 17:37:27 MSK [26678-1] user@user LOG:  could not receive data from client: Connection reset by peer
2017-06-17 17:37:27 MSK [26676-1] user@user LOG:  could not receive data from client: Connection reset by peer

请帮帮我。我真的需要帮助。我独自理解。我在谷歌阅读了5页。

1 个答案:

答案 0 :(得分:0)

经过多次尝试找出问题的原因,重新安装postgresql和日期转储的实验,甚至重新安装操作系统,重新部署完整的应用程序,我发现了原因击穿。

整个问题是我的nginx配置包含以下行:

proxy_cache_methods GET HEAD POST;

这是由该指令缓存的POST请求:

proxy_cache_valid 200 302 1m;