Updated on 2023-08-31 GMT+08:00

Compiling and Running Applications

Scenario

You can run applications in the Windows environment after application code development is complete. If the local and cluster service planes can communicate with each other, you can perform the commissioning on the local host.

  • If the IBM JDK is used in the windows OS, applications cannot be directly run in the windows OS.
  • Do not restart the HDFS service during the running of MapReduce jobs. Otherwise, the jobs may fail.

Prerequisites

Running the Statistics Sample Program

  1. Ensure that all JAR packages on which the sample project depends have been obtained.
  2. In the IntelliJ IDEA development environment, open the LocalRunner.java project in the sample project, right-click the project, and choose Run LocalRunner.main() from the shortcut menu to run the application project.

Running Sample Applications About Multi-Components

  1. Create the jaas_mr.conf file in the ../src/mapreduce-example-security/conf directory where the MapReduce project example is stored and add the following content to the file:

    Client {
    com.sun.security.auth.module.Krb5LoginModule required
    useKeyTab=true
    keyTab="user.keytab"
    principal="test@<System domain name>"
    useTicketCache=false
    storeKey=true
    debug=true;
    };
    • test: indicates the name of the user created in User Information for Cluster Authentication, for example, developuser.
    • System domain name: Log in to FusionInsight Manager, choose System > Permission > Domain and Mutual Trust, and view the value of Local Domain, which is the current system domain name.

  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, select the MultiComponentLocalRunner.java project and click to run the corresponding application project. Alternatively, right-click the project and choose Run MultiComponentLocalRunner.main() from the shortcut menu to run the application project.

    If ZooKeeper SSL is enabled in 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.