Blog Archives

Tungsten Replicator setting up and Gotchas

Tungsten Replicator site Clicky

So we have a big MYSQL server with mission critical data on it.

I want to replicate it accross to another MYSQL database, they are both ubuntu servers with Percona MYSQL database.

1. Preparation

Master – Install RUBY, JAVA,

Slave – Install RUBY, JAVA

edit the hosts files on both machines in etc/hosts and add the other servers in each one and reference the IP address – just makes things easier.

2. SSH

Make sure you set up SSH so that you can ssh from one server to the other WITHOUT using passwords.

3. PORTS

make sure all ports required 10000,10001 are available (particularly problematical PLESK, WEBMIN a whole host of things like these ports) on all machines. One server actually had a PLESK tool on it even though plesk was not installed!!

4. MYSQL

make sure everything is set up and restore a backup of the database before you start.

5. Helper scripts

Set up your tungsten. You’ll need to edit NODES_MASTER_SLAVE.sh to make sure your nodes are correct and USER_CONFIG as per the tungsten documentation.

install.sh – put in the tungsten folder e.g. tungsten-replicator-2.1.0-343

VERBOSE=1 ./cookbook/install_master_slave ./cookbook/NODES_MASTER_SLAVE.sh

tungsten.sh (actually I renamed this to tungsten and did a chmod +x tungsten)

if [ "$1" == "help" ] || [ "$1" == "" ]; then
 echo "Commands"
 ls installs/cookbook/tungsten/tungsten-replicator/bin/
else
installs/cookbook/tungsten/tungsten-replicator/bin/$1 $2 $3 $4 $5
fi

So you can type

./tungsten replicator status

To run commands.

Advertisements

Connecting a Netbeans EE application to a glassfish server.

Ok I pulled my hair out doing this – it seemed whatever I did I got a Null Pointer Exception when I ran the client, so here’s the solution. Sorry Sun, but I couldn’t get it working using the menu in the IDE that created this code:-

@EJB
IntelligenceRemote intelligenceremote;

In this case my remote class is called IntelligenceRemote and I have a method called TransferJob(Jobnumber,Depot); 

        try{
         InitialContext ctx = new InitialContext();        
         IntelligenceRemote  test = (IntelligenceRemote ) ctx.lookup(IntelligenceRemote.class.getName());        
       
        
        System.out.println(test.TransferJob("12303", "OHH"));
        } catch (Exception e) {
        System.out.println("Could not transfer job");
    }

Ofcourse Netbeans being wonderful it will already give you the option to add the import.

import javax.naming.InitialContext;