对 Azure HDInsight 中的 Apache Oozie 进行故障排查Troubleshoot Apache Oozie in Azure HDInsight

使用 Apache Oozie UI 可查看 Oozie 日志。With the Apache Oozie UI, you can view Oozie logs. Oozie UI 还包含一些链接,指向工作流启动的 MapReduce 任务的 JobTracker 日志。The Oozie UI also contains links to the JobTracker logs for the MapReduce tasks that were started by the workflow. 故障排除的模式应为:The pattern for troubleshooting should be:

  1. 在 Oozie Web UI 中查看作业。View the job in Oozie web UI.

  2. 如果特定的操作出错或失败,请选择该操作,以查看“错误消息”字段是否提供了有关失败的详细信息。If there's an error or failure for a specific action, select the action to see if the Error Message field provides more information on the failure.

  3. 如果已提供,请使用操作中的 URL 查看该操作的更多详细信息(例如 JobTracker 日志)。If available, use the URL from the action to view more details, such as the JobTracker logs, for the action.

下面是可能会遇到的特定错误及其解决方法。The following are specific errors you might come across and how to resolve them.

JA009:无法初始化群集JA009: Can't initialize cluster

问题Issue

作业状态变为“SUSPENDED”。The job status changes to SUSPENDED. 作业详细信息中的 RunHiveScript 状态显示为“START_MANUAL”。Details for the job show the RunHiveScript status as START_MANUAL. 选择该操作会显示以下错误消息:Selecting the action displays the following error message:

JA009: Cannot initialize Cluster. Please check your configuration for map

原因Cause

job.xml 文件中使用的 Azure Blob 存储地址不包含存储容器或存储帐户名。The Azure Blob storage addresses used in the job.xml file doesn't contain the storage container or storage account name. Blob 存储地址格式必须是 wasbs://containername@storageaccountname.blob.core.chinacloudapi.cnThe Blob storage address format must be wasbs://containername@storageaccountname.blob.core.chinacloudapi.cn.

解决方法Resolution

更改作业使用的 Blob 存储地址。Change the Blob storage addresses that the job uses.


JA002:不允许 Oozie 模拟 <USER>JA002: Oozie isn't allowed to impersonate <USER>

问题Issue

作业状态变为“SUSPENDED”。The job status changes to SUSPENDED. 作业详细信息中的 RunHiveScript 状态显示为“START_MANUAL”。Details for the job show the RunHiveScript status as START_MANUAL. 选择操作会显示以下错误消息:If you select the action, it shows the following error message:

JA002: User: oozie is not allowed to impersonate <USER>

原因Cause

当前的权限设置不允许 Oozie 模拟指定的用户帐户。The current permission settings don't allow Oozie to impersonate the specified user account.

解决方法Resolution

允许 Oozie 模拟 users 组中的用户。Oozie can impersonate users in the users group. 使用 groups USERNAME 查看用户帐户所属的组。Use the groups USERNAME to see the groups that the user account is a member of. 如果该用户不是 users 组的成员,请使用以下命令将该用户添加到该组:If the user isn't a member of the users group, use the following command to add the user to the group:

sudo adduser USERNAME users

备注

可能需要几分钟,HDInsight 才能识别用户已添加到该组。It can take several minutes before HDInsight recognizes that the user has been added to the group.


启动器错误 (Sqoop)Launcher ERROR (Sqoop)

问题Issue

作业状态变为“KILLED”。The job status changes to KILLED. 作业详细信息中的 RunSqoopExport 状态显示为“ERROR”。Details for the job show the RunSqoopExport status as ERROR. 选择操作会显示以下错误消息:If you select the action, it shows the following error message:

Launcher ERROR, reason: Main class [org.apache.oozie.action.hadoop.SqoopMain], exit code [1]

原因Cause

Sqoop 无法加载访问数据库时所需的数据库驱动程序。Sqoop is unable to load the database driver required to access the database.

解决方法Resolution

从 Oozie 作业使用 Sqoop 时,必须同时包含数据库驱动程序和作业使用的其他资源(例如 workflow.xml)。When you use Sqoop from an Oozie job, you must include the database driver with the other resources, such as the workflow.xml, the job uses. 此外,通过 workflow.xml 的 <sqoop>...</sqoop> 节引用包含数据库驱动程序的存档。Also, reference the archive that contains the database driver from the <sqoop>...</sqoop> section of the workflow.xml.

例如,对于使用 Hadoop Oozie 工作流中的作业示例,使用以下步骤:For example, for the job example from Use Hadoop Oozie workflows, you would use the following steps:

  1. mssql-jdbc-7.0.0.jre8.jar 文件复制到 /tutorials/useoozie 目录:Copy the mssql-jdbc-7.0.0.jre8.jar file to the /tutorials/useoozie directory:

    hdfs dfs -put /usr/share/java/sqljdbc_7.0/enu/mssql-jdbc-7.0.0.jre8.jar /tutorials/useoozie/mssql-jdbc-7.0.0.jre8.jar
    
  2. 修改 workflow.xml,在 </sqoop> 上方的新行中添加以下 XML:Modify the workflow.xml to add the following XML on a new line above </sqoop>:

    <archive>mssql-jdbc-7.0.0.jre8.jar</archive>
    

后续步骤Next steps

如果你的问题未在本文中列出,或者无法解决问题,请访问以下渠道以获取更多支持:If you didn't see your problem or are unable to solve your issue, visit the following channel for more support: