private void retrievePrimary() {
		logger.info("Retrieving primary information from discovery server!");

		try {
			Socket registerSocket = new Socket(ds_addr, ds_port);

			BufferedWriter wr = new BufferedWriter(new OutputStreamWriter(
					registerSocket.getOutputStream()));

			String path = "/retrievePrimary";
			wr.write("GET " + path + " HTTP/1.1\r\n");
			wr.write("\r\n");
			wr.flush();

			// Receive primary information from discovery server
			BufferedReader recerive_br = new BufferedReader(
					new InputStreamReader(registerSocket.getInputStream()));

			while (!(recerive_br.readLine().trim()).equals("")) {
			}

			char[] bodyChars = new char[1000];
			recerive_br.read(bodyChars);
			StringBuffer sb = new StringBuffer();
			sb.append(bodyChars);
			String receive_body = sb.toString().trim();

			JSONParser jp = new JSONParser();
			try {
				JSONObject currentPrimary = (JSONObject) jp.parse(receive_body);
				currentPrimary_ipAddrs = currentPrimary.get("ipAddrs")
						.toString();
				currentPrimary_portNum = Integer.valueOf(currentPrimary.get(
						"portNum").toString());
				;
			} catch (ParseException e) {
				logger.debug(e.getMessage(), e);
			}
			logger.info("I'm frontend, the current primary is: "
					+ currentPrimary_ipAddrs + "  " + currentPrimary_portNum);
			registerSocket.close();
		} catch (IOException e) {
			logger.debug(e.getMessage(), e);
		}
	}