public static void main(String[] args) {
		String name = args[0];
		String dir = args[1];
		int port = new Integer(args[2]);
		String masterServerName = args[3];
		String masterServerAdd = args[4];
		int masterServerPort = new Integer(args[5]);

		try {
			File dir1 = new File(dir);
			if (!dir1.exists())
				dir1.mkdir();
			File subDir = new File(dir + "/" + name);
			if (!subDir.exists())
				subDir.mkdir();
			Registry registry = null;
			try {
				registry = LocateRegistry.createRegistry(port);
				System.out.println("hasdaj");
			} catch (Exception e) {
				registry = LocateRegistry.getRegistry(port);
			}

			Registry reg2 = LocateRegistry.getRegistry(masterServerAdd,
					masterServerPort);
			MasterServerClientInterface masterServer = (MasterServerClientInterface) reg2
					.lookup(masterServerName);

			ReplicaServerImpl replicaServerObj = new ReplicaServerImpl(dir
					+ "/" + name, name, masterServer);
			ReplicaServerClientInterface replicaServerStub = (ReplicaServerClientInterface) UnicastRemoteObject
					.exportObject(replicaServerObj, 0);
			System.out.println("here!!");
			registry.bind(name, replicaServerStub);

			// System.out.println("----" +
			// masterServer.read("file1.txt").length);

			System.out.println("here also!!");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}