-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Hello,
I've been trying to start up kodama using the simple client code from your README:
require 'kodama'
class KodamaService
Kodama::Client.start(:host => '127.0.0.1', :username => 'root', :port => 3306) do |c|
c.binlog_position_file = '/usr/local/var/mysql/mysql-binlog.index'
c.log_level = :debug # [:debug|:info|:warn|:error|:fatal]
c.connection_retry_limit = 3 # times
c.connection_retry_wait = 1 # second
# Exit gracefully when kodama receives specified signals
c.gracefully_stop_on :QUIT, :INT
c.on_query_event do |event|
p event.query
end
c.on_row_event do |event|
p event.rows
end
end
endI get the following error:
D, [2014-02-24T15:35:26.623775 #60639] DEBUG -- : An unspecified error occurred (2) (Binlog::Error)
/usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kodama-0.1.1/lib/kodama/client.rb:108:in `set_position'
/usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kodama-0.1.1/lib/kodama/client.rb:108:in `start'
/usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kodama-0.1.1/lib/kodama/client.rb:20:in `start'
kodama-client.rb:3:in `<main>'
D, [2014-02-24T15:35:29.636154 #60639] DEBUG -- : An unspecified error occurred (2) (Binlog::Error)
/usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kodama-0.1.1/lib/kodama/client.rb:108:in `set_position'
/usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kodama-0.1.1/lib/kodama/client.rb:108:in `start'
/usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kodama-0.1.1/lib/kodama/client.rb:20:in `start'
kodama-client.rb:3:in `<main>'
/usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kodama-0.1.1/lib/kodama/client.rb:108:in `set_position': An unspecified error occurred (2) (Binlog::Error)
from /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kodama-0.1.1/lib/kodama/client.rb:108:in `start'
from /usr/local/Cellar/ruby/2.1.0/lib/ruby/gems/2.1.0/gems/kodama-0.1.1/lib/kodama/client.rb:20:in `start'
from kodama-client.rb:3:in `<main>'
I am using winebarrel's mysql-replication-listener as you suggested. I've tried both versions 0.0.47-10 and 0.0.47-11. I started up mysql with the following commands:
mysqld --log-bin='mysql-binlog' --bind-address='127.0.0.1'Once mysql is started, I ran the command
SET GLOBAL binlog_format = 'ROW';The binlogs are written out to /usr/local/var/mysql by default. I tested out the actual replication part with mysql - when I update/write something to a table, the mysql-binlog.000001 file grows. I've been going through every line of code with a debugger, and here are some things I've found when I put a breakpoint in line 107 in lib/kodama/client.rb:
- @binlog_info.filename = './mysql-binlog.000001'
- @binlog_info.position = 0
Both seem valid and it goes into the if @binlog_info.valid? block. NOW here the problem starts - it seems to throw errors during the ``client.set_position(@binlog_info.filename, @binlog_info.position)` method call.
Can you help? I've been bashing my head against this trying to get it to work to no avail :( Please let me know! Thanks!!