致命:bucardo添加表时的密码认证

时间:2016-08-29 13:16:45

标签: postgresql postgresql-9.3 database-replication bucardo

系统规范:

  • Ubuntu 14.04
  • bucardo版本4.99.10
  • psql(PostgreSQL)9.3.14

到目前为止我尝试了什么?

我用openerp postgres用户创建了master数据库。

- Setup Source Database

    export SOURCE_HOST=localhost
    export SOURCE_PORT=5432  
    export SOURCE_DATABASE=master
    export SOURCE_USERNAME=openerp  
    export SOURCE_PASSWORD=openerp

- Setup Destination Database

    export DEST_HOST=localhost 
    export DEST_PORT=5432  
    export DEST_DATABASE=slave  
    export DEST_USERNAME=openerp  
    export DEST_PASSWORD=openerp    

- Finally, the tables to be migrated

    export TABLES="-t res_partner"

    export TABLES_WITH_SPACES="res_partner"

- Set up the Destination Database

    cat >> $HOME/.pgpass <<EOL  
    $DEST_HOST:$DEST_PORT:$DEST_DATABASE:$DEST_USERNAME:$DEST_PASSWORD
    $SOURCE_HOST:$SOURCE_PORT:$SOURCE_DATABASE:$SOURCE_USERNAME:$SOURCE_PASSWORD
    EOL  

- Create schema.sql 

- Create Slave database

- Load schema into Slave

- Setting up Bucardo Sync (Source Database and  Destination Database) 

- Now I am trying to add the tables we want to migrate and add them to a "copying herd"

    ./bucardo add tables res_partner db=master

我收到了以下错误:

  

openerp @ odedra-Lenovo-Z50-70:/ usr / local / src / bucardo $ ./bucardo add tables res_partner db = master   DBI connect(&#39; dbname = master; host = localhost; port = 5432&#39;,&#39; openerp&#39;,...)失败:致命:用户密码验证失败&#34; openerp&# 34;   致命:用户&#34; openerp&#34;密码验证失败在./bucardo line 8632。

我有分析脚本bucardo。我对在行号84,85声明的dbuser和dbpass变量感到困惑。

(I have tried with dbuser = 'openerp' and dbpass='openerp' but result same)

我的 pg_hba.conf

# Database administrative login by Unix domain socket
local   all             postgres                                ident

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

数据库清单:

                                   List of databases
    Name     |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
-------------+----------+----------+-------------+-------------+-----------------------
 bucardo     | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 master      | openerp  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 postgres    | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 slave       | openerp  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 slave_copy  | openerp  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 slave_copy1 | openerp  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 slave_copy2 | openerp  | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
 template0   | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
             |          |          |             |             | postgres=CTc/postgres
 template1   | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
             |          |          |             |             | postgres=CTc/postgres

您可以指导我应该更改以修复上述错误或有用的相关链接吗?

如何使用Bucardo实现主从功能?

1 个答案:

答案 0 :(得分:1)

我发现 pg_hba.conf 文件存在问题。为了解决错误,我在该文件中添加了以下行。

local   all             openerp                                ident