配置HAF应用服务
在卸载节点上,使用如下命令配置HAF应用服务:
su -s /bin/bash - haf -c "haf-tool service -j <jar_file> -f <main_func> -x <jvm_config> --timeout <timeout_value> --classpath <classpath_dir>"

- 第一次配置的时候,使用--start即可。OmniData算子下推场景下部署安装时已经进行了该配置和服务重启,具体见安装OmniData算子下推。
- jar_file&classpath_dir建议在“run/haf_user”路径下,若非该路径则由用户保证haf_user用户对相关文件有读取和执行权限。
- 执行完配置以后,需要执行restart操作使得配置生效su -s /bin/bash - haf -c "haf-tool service --restart"。
选项 |
内容 |
必选 |
---|---|---|
-j Executor file/--jar=Executor file |
应用服务执行文件路径,服务主JAR包的名称。 |
√(首次使用必选) |
-f Main function |
应用服务包内的主函数名,默认值:空。 |
x |
-x JVM extra options |
应用服务的JVM配置,默认值:空。 说明:
用户根据自身JVM的使用情况进行配置,未配置则采用JVM默认配置,例如JVM错误日志默认生成于运行目录。 |
x |
--timeout=Channel timeout |
应用服务和主节点通信通道的超时设置,默认为120。 |
x |
--classpath=Class path |
应用服务依赖的Class文件的路径。 |
x |
以OmniData为例,命令为:
su -s /bin/bash - haf -c "haf-tool service -j /opt/haf-install/haf-target/run/haf_user/omnidata/lib/boostkit-omnidata-server-1.2.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/"
- 选择“命令执行”,单击“添加”。
- 编辑任务内容,单击“保存”。
参数
内容
任务名称
配置应用服务
运行目录
/
执行命令
su -s /bin/bash - haf -c "haf-tool service -j main_jar -f main_func -x jvm_config --tag service_name --classpath classpath"