Piyush dot Me
Piyush's thoughts | Technology | Open Source – OSS | hacks | /home/piyushk
Piyush's thoughts | Technology | Open Source – OSS | hacks | /home/piyushk
Jul 5th
rubyrep Database replication that doesn’t hurt.
Unlike Oracle & MySQL : PostgreSQL doesn’t’ have built in replication solutions but there are many other replication solutions available for PostgreSQL liked listed here :-
http://wiki.postgresql.org/wiki/Replication%2C_Clustering%2C_and_Connection_Pooling
and some additional proprietary solutions for the custom needs by different companies.
Mostly people use Slony : http://www.slony.info/ for master – slave replication solution – Slony is a “master to multiple slaves” replication system supporting cascading (e.g. – a node can feed another node which feeds another node…) and failover.
but Slony has limitations as mentioned here :
There are many new replication and clustering solutions being there but most of them in development phases only.
To provide mater-master replication in PostgreSQL – mostly used solutions are :-
- Bucardo
- RubyRep
and RubyRep is most easy to setup and configure.
RubyRep Mission:-
Development of an open-source solution for asynchronous, master-master replication of relational databases that is
It currently supports PostgreSQL and MySQL and is currently developed by Arndt Lehmann,. He also provides great support to the RubyRep mailing list, especially for adding new features or fixing bugs.
RubyRep always operates on two databases. To make it simple to understand, the databases are referred to as “left” and “right” database respectively.
RubyRep’s key features includes:
In addition to the above, RubyRep actually provides three tools in one; a Compare, Sync, and Replication tools.
This tool scans corresponding tables of left and right database, looking for diverging data. Key features of the comparison tool are:
The sync tool is used to synchronize data in corresponding tables of a left and right pair of databases. Key features of the sync tool are:
Of course RubyRep also provides a replication tool. Some of the key features of the replication tool include:
One of the problems common to replication solutions is that of setting up new nodes. With Slony, there are always some headaches caused by high load on master database server, as a result of the TRUNCATE/COPY cycle Slony goes through. In the case of RubyRep, most of the CPU load is on the slave server, and you can use the Sync command in advance before you start replicating database. RubyRep also provides some flexibility to ignore the Sync commands if you don’t want to sync the database again.
For installation refer to http://www.rubyrep.org/installation.html
Help
# rubyrep --help Usage: /usr/local/bin/rubyrep [general options] command [parameters, ...] Asynchronous master-master replication of relational databases. Available options: --verbose Show errors with full stack trace -v, --version Show version information. --help Show this message Available commands: generate Generates a configuration file template help Shows detailed help for the specified command proxy Proxies connections from rubyrep commands to the database replicate Starts a replication process scan Scans for differing records between databases sync Syncs records between databases uninstall Removes all rubyrep tables, triggers, etc. from "left" and "right" database
#rubyrep generate myrubyrep.conf
Checkout http://www.rubyrep.org/tutorial.html for scanning & sync & replication configs
Jun 27th
Apr 25th
jvisualvm - Java VisualVM is an intuitive graphical user interface that provides detailed information about Java technology-based applications (Java applications) while they are running on a given Java Virtual Machine (JVM*). The name Java VisualVM comes from the fact that Java VisualVM provides information about the JVM software visually.
Usage:-
- Java VisualVM is useful to Java application developers to troubleshoot applications and to monitor and improve the applications’ performance.
- Java VisualVM can allow developers to generate and analyse heap dumps, track down memory leaks, perform and monitor garbage collection, and perform lightweight memory and CPU profiling.
- Plug-ins also exist that expand the functionality of Java VisualVM. For example, most of the functionality of the JConsole tool is available via the MBeans Tab and JConsole Plug-in Wrapper plug-ins.
You can choose from a catalog of standard Java VisualVM plug-ins by selecting ‘Tools’ | ‘Plugins’ in the Java VisualVM menus.
Start Java VisualVM with the following command:
# jvisualvm <options>
Ref: http://java.sun.com/javase/6/docs/technotes/tools/share/jvisualvm.html
piyush.me Recent Comments