public void init() {
        /* read configuration file */
        System.out.println("[LOG] Loading DataNode configuration data ...");
        try {
            FileIO.readConf(Common.HDFSConfPath, this);
            System.out.println("[^_^] DataNode configured successfully");
        } 
        catch (IOException e1) {
            e1.printStackTrace();
            System.out.println("[Error**] Configuration failed");
            System.exit(-1);
        }

        /* Initialize DataNode RMI service */
        try {
            System.out.println("[LOG] Setting up DataNode RMI service on port " + dataNodeRegPort);
            DataNodeInterface dataNodeStub = (DataNodeInterface) UnicastRemoteObject.exportObject(this, 0);
            Registry dataNodeRegistry = LocateRegistry.createRegistry(dataNodeRegPort);
            /* rebind  RMi service */
            dataNodeRegistry.rebind(dataNodeService, dataNodeStub);
            System.out.println("[^_^] RMI service set up successfully");
        }
        catch (RemoteException e) {
            e.printStackTrace();
            System.out.println("[Error**] DataNode server init failed. Shutting down ...");
            System.exit(-1);
        }

        /* connect to NameNode and register it */
        try {
            /* connect to NameNode */
            System.out.println("[LOG] Connecting to name node...");
            Registry nameNodeRegistry = LocateRegistry.getRegistry(this.nameNodeIP, nameNodeRegPort);
            nameNodeStub = (NameNodeInterface) nameNodeRegistry.lookup(nameNodeService);

            /* register DataNode on NameNode by calling NameNode RMI "registerDataNode"*/
            nameNodeStub.registerDataNode(InetAddress.getLocalHost().getHostAddress(), dataNodeRegPort, dataNodeService);
        }
        catch (RemoteException | NotBoundException | UnknownHostException e1) {
            e1.printStackTrace();
            System.err.println("[Error]: Connecting to NameNode " + nameNodeIP + ":" + nameNodeRegPort + " failed");
            System.exit(-1);
        }

        /* set dataNode storage path */
        dataNodePath = "./DataNode-" + dataNodeRegPort;

        /* enable running */
        isRunning = true;
    }