No commit activity in last 3 years
No release in over 3 years
This gem allows you to find replication position with Octopus
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 12.3
~> 3
~> 0.49.0

Runtime

~> 0.8.6
 Project Readme

Octopus Replication Tracking

This Gem is extension of ar-octopus to help to find replication file and position number for each shard.

Notes

  • Currently only working for mysql2 adapter
  • DB user requires to have access show master status; and show slave status;
  • This statement provides status information about the binary log files of the master or slave. It requires either the SUPER or REPLICATION CLIENT privilege.

Install

Add this line to Gemfile:

gem 'ar-octopus-replication-tracking'

How to Use

Setup shards.yml and ready to use.

octopus:
  environments:
    - development
  development:
    earth:
      captain_america:
        adapter: mysql2
        database: captain_america_db
      hulk:
        adapter: mysql2
        database: hulk_db
      ironman:
        adapter: mysql2
        database: ironman_db
    galaxy:
      i_am_groot:
        adapter: mysql2
        database: i_am_grout_db

Syntax

Replication status from captain_america shard

> Octopus.replication_position(:captain_america)
=> {:file_name=>"mysql-bin.000001", :position=>36668586}

Replication status from ironman shard

Octopus.replication_position(:ironman)
=> {:file_name=>"mysql-bin.000001", :position=>36668583}

Replication status from slave group

Octopus.replication_position(slave_group: :galaxy)
=> {:file_name=>"mysql-bin.000001", :position=>36668586}