Updated on 2022-07-11 GMT+08:00

Compiling and Running the Application

Scenario

After the code development is complete, you can run an application in the Windows development environment. If the network between the local and the cluster service plane is normal, you can perform the commissioning on the local host.

  • If IBM JDK is used in the Windows environment, the application cannot be run in the Windows environment.
  • Do not restart HDFS service while MapReduce application is in running status, otherwise the application will fail.

Running MapReduce Statistics Sample Project

  1. Ensure that all JAR packages on which the sample project depends have been obtained.
  2. In the IntelliJ IDEA development environment, select the LocalRunner.java project.

    Right-click the project and choose Run > LocalRunner.main() from the shortcut menu to run the project. Click to run the related application project.

Running MapReduce Accessing Multi-Component Example Project

  1. Save the user.keytab, hive-site.xml, hbase-site.xml, and hiveclient.properties files to the conf directory of the project.

    Create the jaas_mr.conf file in the conf directory and add the following content (test is the user corresponding to user.keytab):
    Client {
    com.sun.security.auth.module.Krb5LoginModule required
    useKeyTab=true
    keyTab="user.keytab"
    principal="test@<system domain name>"
    useTicketCache=false
    storeKey=true
    debug=true;
    };

  2. Ensure that all Hive and HBase JAR packages on which the sample project depends have been obtained.
  3. In the IntelliJ IDEA development environment, click MultiComponentLocalRunner.java to run the application project. You can also right-click the project and choose Run MultiComponentLocalRunner.main() from the shortcut menu to run the project.

    If ZooKeeper SSL is enabled for the cluster, add the -Dzookeeper.client.secure=true -Dzookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty parameter to the position shown in the following figure before running this example.