Updated on 2025-04-14 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 in the cluster, check the mapred-site.xml configuration file before running the sample. (Obtained from the conf configuration file directory of the sample project in the Preparing an Operating Environment) Check whether the configuration items mapreduce.admin.map.child.java.opts and mapreduce.admin.reduce.child.java.opts of the contain the following information:

     -Dzookeeper.client.secure=true -Dzookeeper.clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty

    If no, add the preceding content to the end of the configuration item.