Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Development Procedure

Updated on 2022-11-18 GMT+08:00
  1. Analyze the service.

    1. Analyze and process logs using Mapreduce in the client example directory.
    2. Move Mapreduce analysis results to the data analysis result directory, and set the data file access permission to 660.
    3. To analyze data every day, perform 1.a and 1.b every day.

  2. Implement the service.

    1. Log in to the node where the client is located, and create the dataLoad directory, for example, /opt/client/Oozie/oozie-client-*/examples/apps/dataLoad/. This directory is used as a program running directory to store files that are edited subsequently.
      NOTE:

      You can directly copy the content in the map-reduce directory of the example directory to the dataLoad directory and edit the content.

      Replace oozie-client-* in the directory with the actual version number.

    2. Compile a workflow job property file job.properties.

      For details, see job.properties.

    3. Compile a workflow job using workflow.xml.
      Table 1 Actions in a Workflow

      No.

      Procedure

      Description

      1

      Define the start action.

      For details, see Start Action

      2

      Define the MapReduce action.

      For details, see MapReduce Action

      3

      Define the FS action.

      For details, see FS Action

      4

      Define the end action.

      For details, see End Action

      5

      Define the kill action.

      For details, see Kill Action

      NOTE:

      Dependent or newly developed JAR packages must be saved in dataLoad/lib.

      The following provides an example workflow file:

      <workflow-app xmlns="uri:oozie:workflow:1.0" name="data_load"> 
         <start to="mr-dataLoad"/> 
         <action name="mr-dataLoad"> 
             <map-reduce> <resource-manager>${resourceManager}</resource-manager>  
                  <name-node>${nameNode}</name-node> 
                  <prepare> 
                      <delete path="${nameNode}/user/${wf:user()}/${dataLoadRoot}/output-data/map-reduce"/> 
                  </prepare> 
                  <configuration> 
                      <property> 
                          <name>mapred.job.queue.name</name> 
                          <value>${queueName}</value> 
                      </property> 
                      <property> 
                          <name>mapred.mapper.class</name> 
                          <value>org.apache.oozie.example.SampleMapper</value> 
                      </property> 
                      <property> 
                          <name>mapred.reducer.class</name> 
                          <value>org.apache.oozie.example.SampleReducer</value> 
                      </property> 
                      <property> 
                          <name>mapred.map.tasks</name> 
                          <value>1</value> 
                      </property> 
                      <property> 
                          <name>mapred.input.dir</name> 
                          <value>/user/oozie/${dataLoadRoot}/input-data/text</value> 
                      </property> 
                      <property> 
                          <name>mapred.output.dir</name> 
                          <value>/user/${wf:user()}/${dataLoadRoot}/output-data/map-reduce</value> 
                      </property> 
                  </configuration> 
              </map-reduce> 
              <ok to="copyData"/> 
              <error to="fail"/> 
          </action> 
       
          <action name="copyData"> 
               <fs> 
                   <delete path='${nameNode}/user/oozie/${dataLoadRoot}/result'/> 
                   <move source='${nameNode}/user/${wf:user()}/${dataLoadRoot}/output-data/map-reduce'  
                         target='${nameNode}/user/oozie/${dataLoadRoot}/result'/> 
                   <chmod path='${nameNode}/user/oozie/${dataLoadRoot}/result' permissions='-rwxrw-rw-' dir-files='true'></chmod> 
              </fs> 
              <ok to="end"/> 
              <error to="fail"/> 
          </action> 
       
          <kill name="fail"> 
              <message>This workflow failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message> 
          </kill> 
          <end name="end"/> 
      </workflow-app> 
    4. Compile a Coordinator job using coordinator.xml.

      The Coordinator job is used to analyze data every day. For details, see coordinator.xml.

  3. Upload the workflow file.

    1. Use or switch to the user account that is granted with rights to upload files to the HDFS. For details about developer account preparation, see Preparing Development and Operating Environment.
    2. Implement Kerberos authentication for the user account.
    3. Run the HDFS upload command to upload the dataLoad folder to a specified directory on the HDFS (user developuser must have the read/write permission for the directory).
      NOTE:

      The specified directory must be the same as oozie.coord.application.path and workflowAppUri defined in job.properties.

  4. Execute the workflow file.

    1. Log in to the client node, implement Kerberos authentication for user developuser.

      cd /opt/client

      source bigdata_env

      kinit developuser

    2. Run the following command to start the workflow:

    Command:

    oozie job -oozie https://oozie server hostname:port/oozie -config job.propertiesfile path -run

    Parameter list:

    Table 2 Parameters

    Parameter

    Description

    job

    Indicates that a job is to be executed.

    -oozie

    Indicates the (any instance) Oozie server address.

    -config

    Indicates the path of job.properties.

    -run

    Indicates the starts workflow.

    For example:

    oozie job -oozie https://10-1-130-10:21003/oozie -config job.properties -run

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback