FATAL: the database system is starting up
来源:互联网 发布:土豆视频mac版 编辑:程序博客网 时间:2024/05/29 16:17
详细的报错信息如下:
LOG: database system is ready to accept connectionsLOG: database system was interrupted;LOG: database system was not properly shut down; automatic recovery in progressLOG: invalid record length at 0/2EA3830: wanted 24, got 0LOG: redo is not requiredLOG: MultiXact member wraparound protections are now enabledLOG: database system is ready to accept connectionsLOG: autovacuum launcher startedLOG: database system was interrupted; last known up at 2017-03-02 00:32:34 UTCLOG: received smart shutdown request
因为项目集成了docker,docker里又有postgresql数据库,所以在调试程序的时候,经常会有重启项目的时候(一般修改代码,会自动重启服务的,特殊情况除外),因为是刚结束服务,有立马启动服务,所以会经常启动不了,报错如上。
网上也查了一下,最后确定问题的原因:
postgresql数据库里有一个文件“postmaster.pid”,它是记录postgresql启动时的pid信息的,理论上在停止服务的时候,此文件会被删除掉的,但由于我操作频繁,导致它还没有被删除,在启动postgresql服务的时候,postgresql查询到pid文件的存在,以为服务已经启动起来了,为了不重新加载就不再启动服务了…
所以就直接 把那个pid文件删除掉…之后再启动服务,果然就正常咯
sorry, 我又反复测试了几次后还是有问题的,我出现这个问题是因为项目里使用的docker,在启动项目是,数据库的服务有可能还没有启动,这个时候项目的服务就要去访问数据库,导致无法连接(我目前猜测的最有可能的原因),所以呢,我现在的处理是,先后台启动数据库服务,然后,在启动项目,这样就没有问题了
# 以下 "ss" 代表项目名称# 后台启动所有服务docker-compose up -d# 查看服务运行情况docker-compose psss_celery_1 bash -c celery worker -A S ... Up ss_db_1 /docker-entrypoint.sh postgres Up 5432/tcp ss_redis_1 docker-entrypoint.sh redis ... Up 6379/tcp ss_ss_1 bash -c python manage.py m ... Exit 0.0.0.0:8501->8501/tcp # 这是可以看到 项目的服务 ss_ss_1 并没有启动起来,那么单独启动项目服务docker-compose start ss# 再查看各个服务情况ss_celery_1 bash -c celery worker -A S ... Up ss_db_1 /docker-entrypoint.sh postgres Up 5432/tcp ss_redis_1 docker-entrypoint.sh redis ... Up 6379/tcp ss_ss_1 bash -c python manage.py m ... Up 0.0.0.0:8501->8501/tcp# 已经全起来了,查看项目的实时日志docker-compose logs -f ss
所以,这个问题的解决 就是先启动数据库服务,然后在启动项目,这时就可以连接数据库了,问题分解来搞,就解决了
0 0
- FATAL: the database system is starting up
- psql: FATAL: the database system is starting up
- postgres 备库遇到 FATAL: the database system is starting up问题
- postgresql主备之the database system is starting up
- FATAL ERROR STARTING UP STRUTS-SPRING INTEGRATION
- vagrant up error: Valid states are 'starting, running'. The machine is in the 'poweroff' state 解决
- Fatal: the Postfix mail system is already running 的解决方案
- the path to become a better android developer is starting up
- struts2.1.8启动 FATAL ERROR STARTING UP STRUTS-SPRING INTEGRATION
- 133.Your database is open and the LISTENER listener is running. The new DBA of the system stops the
- fatal: the remote end hung up unexpectedly
- fatal: the remote end hung up unexpectedly
- fatal: the remote end hung up unexpectedly
- fatal: the remote end hung up unexpectedly
- fatal: The remote end hung up unexpectedly
- fatal: The remote end hung up unexpectedly
- fatal: the remote end hung up unexpectedly
- fatal: The remote end hung up unexpectedly
- 数据结构学习笔记--树
- 自定义转场动画(二)
- 1002. 写出这个数 (20)
- bootstrap排版
- git学习
- FATAL: the database system is starting up
- win7/win10 64位 常见收费软件安装教程
- digraph
- sql 语句拼接 游标遍历和函数遍历
- 初识Mongodb
- android权限大全
- Groovy 闭包
- 1003. 我要通过!(20)
- Ugly Number