Rate This Document
Findability
Accuracy
Completeness
Readability

Configuring the HAF Service

On an offload node, run the following command to configure the HAF service:

su -s /bin/bash - haf -c "haf-tool service -j <jar_file> -f <main_func> -x <jvm_config> --timeout <timeout_value> --classpath <classpath_dir>"

  1. For the first configuration, use --start. In the OmniData scenario, the configuration has been performed and the service has been restarted during the deployment and installation. For details, see Installing OmniData.
  2. It is recommended that the jar_file&classpath_dir directory be in run/haf_user. If the directory is not in run/haf_user, ensure that the haf_user user has the read and execute permissions on related files.
  3. After the configuration is complete, run su -s /bin/bash - haf -c "haf-tool service --restart" to restart the service for the configuration to take effect.
Table 1 Parameter description

Option

Description

Mandatory

-j Executor file/--jar=Executor file

Path of the application service execution file and name of the main JAR package of the service.

Yes (Mandatory for the first use)

-f Main function

Name of the main function in the application service package. The default value is null.

No

-x JVM extra options

JVM configuration of the application service. The default value is null.

NOTE:

Set this parameter based on the JVM usage. If this parameter is not set, the default JVM configuration is used. For example, JVM error logs are generated in the run directory by default.

No

--timeout=Channel timeout

Timeout interval of the communication channel between the application service and the active node. The default value is 120.

No

--classpath=Class path

Path of the class file on which the application service depends.

No

Use OmniData as an example:

su -s /bin/bash - haf -c "haf-tool service -j /opt/haf-install/haf-target/run/haf_user/omnidata/lib/boostkit-omnidata-server-1.1.0-aarch64.jar -f com.huawei.boostkit.omnidata.server.OmniDataServerMain.serverMain -x \"-DomnidataConfig=/opt/haf-install/haf-target/run/haf_user/omnidata/etc/config.properties -Dconfig=/opt/haf-install/haf-target/run/haf_user/omnidata/etc/airliftconfig.properties -Dlogback.configurationFile=/opt/haf-install/haf-target/run/haf_user/omnidata/etc/logback.xml\" --classpath /opt/haf-install/haf-target/run/haf_user/omnidata/lib/"

  1. Select Command Execution and click Add a Task.
  2. Edit the task content and click Save.

    Parameter

    Description

    Task Name

    Configure the application services

    Run Directory

    /

    Run Command

    su -s /bin/bash - haf -c "haf-tool service -j main_jar -f main_func -x jvm_config --tag service_name --classpath classpath"