您当前的位置: 首页 >  docker

qq_34412985

暂无认证

  • 0浏览

    0关注

    1061博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

记录一次docker安装postgresql(pg)数据库容器后异常关机后启动异常问题

qq_34412985 发布时间:2020-12-26 22:25:00 ,浏览量:0

使用docker安装的pg9.5容器,突然云主机升级直接停机后pg数据库容器启动不了后查看容器日志提示以下内容,

解决:按提示将容器的配置文件复制出来后修改后再复制到容器中

 sudo docker cp pg_hba.conf 4d62f4628665:/var/lib/postgresql/data/pg_hba.conf  //将本地配置文件复制到容器中

sudo docker cp 4d62f4628665:/var/lib/postgresql/data/pg_hba.conf .    //将容器配置文件复制到当前目录中

 

LOG:  syntax error in file "/var/lib/postgresql/data/postgresql.conf" line 1, near token "*" FATAL:  configuration file "/var/lib/postgresql/data/postgresql.conf" contains errors

listen_addresses =¡¯*¡¯  改为  listen_addresses = "*"后报以下错误:

LOG:  syntax error in file "/var/lib/postgresql/data/postgresql.conf" line 1, near token """ FATAL:  configuration file "/var/lib/postgresql/data/postgresql.conf" contains errors

listen_addresses = "*"改为  listen_addresses = '*'后启动正常

LOG:  invalid connection type "*host" CONTEXT:  line 6 of configuration file "/var/lib/postgresql/data/pg_hba.conf" FATAL:  could not load pg_hba.conf

PostgreSQL Database directory appears to contain a database; Skipping initialization

# TYPE DATABASE  USER    CIDR-ADDRESS     METHOD  # "local" is for Unix domain socket connections only  local all    all               trust  # IPv4 local connections:  host  all    all    127.0.0.1/32     trust*host  all    all    0.0.0.1/0    md5*   # IPv6 local connections:  host  all    all    ::1/128       trust

LOG:  invalid authentication method "md5*" CONTEXT:  line 6 of configuration file "/var/lib/postgresql/data/pg_hba.conf"

*host  all    all    0.0.0.1/0    md5*  将这行的*都去掉就可以了

 

关注
打赏
1653291990
查看更多评论
立即登录/注册

微信扫码登录

0.0392s