database replication errors

98 views
Skip to first unread message

Cristian cruz benel

unread,
Dec 29, 2015, 1:45:47 PM12/29/15
to rubyrep
I have this problem when i try run the command "rubyrep replicate -c myrubyrep.conf":

DEPRECATION WARNING: In the next release, this will return the same as `#connection_pool_list`. (An array of pools, rather than a hash mapping specs to pools.). (called from connection_pools at /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:528)
/usr/local/rvm/gems/ruby-1.9.3-p551/gems/rubyrep-1.2.0/lib/rubyrep/table_spec_resolver.rb:91: warning: encoding option is ignored - U
DEPRECATION WARNING: In the next release, this will return the same as `#connection_pool_list`. (An array of pools, rather than a hash mapping specs to pools.). (called from connection_pools at /usr/local/rvm/gems/ruby-1.9.3-p551/gems/activerecord-4.2.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:528)
Exception caught: PG::ConnectionBad: connection is closed:           SELECT tablename
            FROM pg_tables
           WHERE schemaname IN ('"$user"','public')


my archive configuration of tables or databases is this: myrubyrep.conf

RR::Initializer::run do |config|
  config.left = {
    :adapter  => 'postgresql', # or 'mysql'
    :database => 'leftdb',
    :username => 'postgres',
    :password => '123456',
    :host     => 'localhost'
  }

  config.right = {
    :adapter  => 'postgresql',
    :database => 'rightdb',
    :username => 'postgres',
    :password => '123456',
    :host     => 'localhost'
  }

  #config.include_tables 'dept'
  #config.include_tables /^e/ # regexp matching all tables starting with e
     config.include_tables /./ # regexp matching all tables in the database

# config.exclude_tables 'schema_migrations'
# config.exclude_tables 'plugin_schema_info'

# config.options[:auto_key_limit] = 2
end


please somebody help me with this problem.. 
Thanks

Shajimon Abraham

unread,
Dec 30, 2015, 4:37:04 AM12/30/15
to rub...@googlegroups.com
dear Mr.Cristian cruz bene



RR::Initializer::run do |config|
config.left = {
 :adapter  => 'postgresql', # or 'mysql'
 :database => 'abc',
  :username => 'xxxxx',
  :password => '****',
 :host     => '192.168.2.121',
  :schema_search_path=> 'abcd'
   }
config.right = {
 :adapter  => 'postgresql', 
 :database => 'abc',
  :username => 'xxxxx',
  :password => '****',
 :host     => '192.168.2.27',
  :schema_search_path=> 'abcd'
   }
config.options[:database_connection_timeout]=200 
config.options[:replicator] = :two_way 
config.options[:replication_interval] = 10
config.options[:initial_sync]= :True 
 
config.include_tables 'she1',:right_record_handling => :delete, :right_change_handling => :ignore, :replication_conflict_handling => :left_wins , :sync_conflict_handling => :left_wins;

 config.include_tables 'he01',:left_record_handling => :delete, :left_change_handling => :ignore, :replication_conflict_handling => :right_wins , :sync_conflict_handling => :right_wins;
config.options[:rep_prefix] = 'u1'
 config.options[:auto_key_limit] = 1 
 config.options[:after_infrastructure_setup] = lambda do |session|  [:left, :right].each do |database| 
session.send(database).execute("GRANT SELECT, UPDATE, INSERT ON u1_pending_changes TO public ")
session.send(database).execute("GRANT SELECT, UPDATE, INSERT ON u1_running_flags TO public ")
session.send(database).execute("GRANT ALL ON u1_pending_changes_id_seq TO public ")
  end
 end
end

I am unable to give you any solution for your problem. However, the above is the config i am using to replicate between two systems
On both the systems the Database name, Scheema name,table name etc are same.
I am sure you will come to a solution even with out this. However this may help you to do it faster.

Best of luck




--
You received this message because you are subscribed to the Google Groups "rubyrep" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyrep+u...@googlegroups.com.
To post to this group, send email to rub...@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyrep.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages