AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-584993

keramat's questions

Martin Hope
keramat
Asked: 2023-04-23 18:51:08 +0800 CST

重启服务器后 Postgres 不启动

  • 3

我在 Windows Server 2022 Standard 上运行 Postgres 14。当数据库操作正在运行时,例如插入,我的服务器重新启动,现在 Postgres 没有启动。我查看了配置文件,最后几行如下:

2023-04-23 01:43:36.913 PDT [123528] LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.

    
2023-04-23 01:52:04.222 PDT [105764] LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.

    
2023-04-23 01:52:04.223 PDT [118464] LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.

    
2023-04-23 01:54:38.568 PDT [121492] LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.

    
2023-04-23 01:54:38.569 PDT [123696] LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.

    
2023-04-23 01:59:51.982 PDT [124252] LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.

    
2023-04-23 01:59:51.983 PDT [122440] LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.

    
2023-04-23 01:59:51.983 PDT [116252] LOG:  could not receive data from client: An existing connection was forcibly closed by the remote host.

    
2023-04-23 02:00:52.468 PDT [4988] LOG:  received fast shutdown request
2023-04-23 02:00:52.572 PDT [4988] LOG:  aborting any active transactions
2023-04-23 02:00:52.611 PDT [6172] FATAL:  terminating connection due to administrator command
2023-04-23 02:00:52.683 PDT [5984] ERROR:  canceling statement due to user request
2023-04-23 02:00:52.716 PDT [4988] LOG:  background worker "logical replication launcher" (PID 5984) exited with exit code 1
2023-04-23 02:00:52.903 PDT [5916] LOG:  shutting down
2023-04-23 02:00:55.161 PDT [4988] LOG:  database system is shut down

另外,正如其他人所建议的,我检查事件查看器并查看:

2023-04-23 03:33:39.610 PDT [5804] FATAL:  configuration file "C:/Program Files/PostgreSQL/14/data/postgresql.conf" contains errors

由于我使用 psycopg 来处理 db,因此出现以下错误:

File "C:\Python310\lib\site-packages\psycopg2\__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (::1), port 5432 failed: Connection refused (0x0000274D/10061)      
        Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused (0x0000274D/10061)
        Is the server running on that host and accepting TCP/IP connections?

配置文件

对于大小限制,我删除了所有评论:

listen_addresses = '*'      # what IP address(es) to listen on;
port = 5432         # (change requires restart)
max_connections = 100           # (change requires restart)
shared_buffers = 4096MB         # min 128kB
work_mem = 2000MB               # min 64kB
maintenance_work_mem = 3000MB       # min 1MB
dynamic_shared_memory_type = windows    # the default is the first option
max_wal_size = 1GB
min_wal_size = 80MB
effective_cache_size = 4GB
log_destination = 'stderr'
logging_collector = on      # Enable capturing of stderr and csvlog
log_timezone = 'America/Los_Angeles'
datestyle = 'iso, mdy'
timezone = 'America/Los_Angeles'
lc_messages = 'English_United States.1252'          # locale for system error message
                    # strings
lc_monetary = 'English_United States.1252'          # locale for monetary formatting
lc_numeric = 'English_United States.1252'           # locale for number formatting
lc_time = 'English_United States.1252'              # locale for time formatting
default_text_search_config = 'pg_catalog.english'

我没有最近的数据库备份。我应该如何克服这个问题?

postgresql
  • 1 个回答
  • 29 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve