首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >厨师-solo+ postgres导致无效的pg_hba.conf

厨师-solo+ postgres导致无效的pg_hba.conf
EN

Stack Overflow用户
提问于 2013-11-10 08:21:55
回答 1查看 2.9K关注 0票数 3

我想和流浪汉+主厨单挑。

我用的是正式收据:http://community.opscode.com/cookbooks/postgresql

因为我的Berksfile包含:

代码语言:javascript
复制
site :opscode

cookbook "postgresql"

我的Vagrantfile块是:

代码语言:javascript
复制
config.berkshelf.enabled = true

config.vm.provision "chef_solo" do |chef|

chef.add_recipe "postgresql::server"

  chef.json = {

  "postgresql" => {
      "version" => "9.2",
      "password" => { "postgres" => "123" },
      config: { 
      "ssl" => "false" 
  },
      pg_hba: [  
          { type: 'local', db: 'all', user: 'all', addr: '', method: 'trust' },
          { type: 'local', db: 'all', user: 'all', addr: '127.0.0.1/32', method: 'trust' },
          { type: 'local', db: 'all', user: 'all', addr: '::1/128 ', method: 'trust' } 
  ]
  }
end

/etc/postgresql/9.2/main/pg_hba.conf的生成内容如下所示:

代码语言:javascript
复制
# This file was automatically generated and dropped off by Chef!

# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file.

# TYPE  DATABASE        USER            ADDRESS                 METHOD

###########
# Other authentication configurations taken from chef node defaults:
###########

local   all             all                                     trust

local   all             all             127.0.0.1/32            trust

local   all             all             ::1/128                 trust

# "local" is for Unix domain socket connections only
local   all             all                                     peer

但是,如果我运行sudo service postgresql restart,它会出现错误:

代码语言:javascript
复制
The PostgreSQL server failed to start. Please check the log output:
2013-11-10 08:12:05 GMT LOG:  invalid authentication method "127.0.0.1/32"
2013-11-10 08:12:05 GMT CONTEXT:  line 17 of configuration file "/etc/postgresql/9.2/main/pg_hba.conf"
2013-11-10 08:12:05 GMT LOG:  invalid authentication method "::1/128"
2013-11-10 08:12:05 GMT CONTEXT:  line 19 of configuration file "/etc/postgresql/9.2/main/pg_hba.conf"
2013-11-10 08:12:05 GMT FATAL:  could not load pg_hba.conf

有问题的条目是那些持有地址的条目。知道我的用例有什么问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-11-10 16:39:41

第一行是好的,实际上这是唯一可以的行。提到地址的应该是“主机”,而不是“本地的”。最后一个现在是没用的。

更多信息在Postgres的文档- hba.conf文件“

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/19887665

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档