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.
Do not restart HDFS service while MapReduce application is in running status, otherwise the application will fail.
Running MapReduce Statistics Sample Project
- Ensure that all JAR packages on which the sample project depends have been obtained.
- In the IntelliJ IDEA development environment, select the LocalRunner.java project. Right-click the project and choose Run MultiComponentLocalRunner.main() from the shortcut menu to run the project. Click to run the related application project.
Running Sample Applications About Multi-Components
- Save the hive-site.xml, hbase-site.xml, and hiveclient.properties files to the conf directory of the project.
- Ensure that all Hive and HBase JAR packages on which the sample project depends have been obtained.
- In the MultiComponentLocalRunner.java code, System.setProperty("HADOOP_USER_NAME", "root"); specifies that user root is used. Ensure that user root is used for uploading data, or change user root in the code to the username used for uploading data.
- 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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot