做网站内容来源,网站的前端和后端,百度商家平台,wordpress 迷文章目录 设置方法配置文件设置Custom xxx配置文件详细的配置方法.xml文件的整体格式基础参数格式value-attributes配置介绍设置属性在服务安装后不可修改设置允许字段为空是否显示配置名称参数类型设置字符串类型PasswordBooleanIntFloatDirectoryDirectoriesContent-多行文本… 文章目录 设置方法配置文件设置Custom xxx配置文件详细的配置方法.xml文件的整体格式基础参数格式value-attributes配置介绍设置属性在服务安装后不可修改设置允许字段为空是否显示配置名称参数类型设置字符串类型PasswordBooleanIntFloatDirectoryDirectoriesContent-多行文本user-自动创建用户和用户组 官网说明:
https://cwiki.apache.org/confluence/display/AMBARI/ConfigurationsupportinAmbari 设置方法
服务需要配置的参数统一都是由.xml格式文件进行配置默认会读取configuration/目录下的.xml文件。可以通过配置metainfo.xml中的configuration-dir/configuration-dir参数修改读取的目录。
在configuration/目录下的.xml文件都会在WebUI显示如下图所示 配置文件设置Custom xxx
默认配置文件在WebUI可以配置两种一种是我们在.xml文件中指定的配置对应Advanced xxx另外一种是自定义配置对应上面页面中Custom xxx自定义配置主要应对我们没有提前设置的参数可以自定义补充。可以通过在.xml文件中参数supports_adding_forbiddentrue来控制是否需要Custom xxx设置为false或者不添加该参数是需要Custom xxx。
配置方法
configuration supports_adding_forbiddentrue...
/configuration详细配置Custom xxx的方法见05.Ambari自定义服务开发-自定义服务配置文件生成
配置文件详细的配置方法
.xml文件的整体格式
?xml version1.0?
?xml-stylesheet typetext/xsl hrefconfiguration.xsl?
configuration
....
/configuration在configuration下可以设置我们需要配置的具体配置参数了
基础参数格式
propertynamedoris_pid_dir/namedisplay-nameDoris pid directory/display-namevalue/var/run/doris/valuedescriptionDoris pid directory/description
/property说明
name属性名称display-nameWebUI中显示的属性名称如未设置display-name前端页面显示name值value属性具体值在WebUI中显示的值可修改description描述信息在WebUI中显示。
在页面中如下图所示 value-attributes配置介绍 参考https://blog.csdn.net/qq_44226094/article/details/130210270 用于设置参数的类型、是否为空等等
样例
!-- 这里规定了属性值的类型为int最小值为0最大值为48000 --
value-attributes!-- 值类型boolean/ int/ float/ directory/ directories/ content/value-list/ user/ password --typeint/type!--是否可复写 true/ false --overridabletrue/overridable!-- 空值是否有效 true/ false --empty-value-validtrue/empty-value-valid!-- property是否 ui true/ false --ui-only-propertytrue/ui-only-property!-- 不可编辑 true / false --read-onlytrue/read-only!--值是否在安装时可编辑 true/ false --editable-only-at-install/editable-only-at-install!-- property 显示值 true/ false --show-property-name/show-property-name!-- 步长 --increment-step100/increment-step!-- 可选值 --selection-cardinality2/selection-cardinality!-- property 文件名 --property-file-name/property-file-name!-- property文件类型 --property-file-type/property-file-type!-- 条目 --entriesentryvalue2/value/entry!-- ... --/entries!-- 隐藏 --hidden/hidden!--条目是否可编辑 true/ false --entries-editable/entries-editable!-- 用户组 --user-groups/user-groups!-- 密钥库是否启用 true/ false --keystore/keystore!-- 最小值 --minimum0/minimum!-- 最大值 --maximum48000/maximum!-- 值单位 B/ MB/ ms/ Bytes/ milliseconds --unit/unit!--可见 --visible/visible!-- 复制 --copy/copy
/value-attributes设置属性在服务安装后不可修改
在property标签内添加
value-attributeseditable-only-at-installtrue/editable-only-at-install
/value-attributes使用样例
propertynametest_editable-only-at-install/namedisplay-name测试服务安装后不可编辑/display-namevalue123456/valuedescription测试服务安装后不可编辑描述/descriptionvalue-attributeseditable-only-at-installtrue/editable-only-at-install/value-attributes
/property效果 设置允许字段为空
在property标签内添加
value-attributesempty-value-validtrue/empty-value-valid
/value-attributes使用样例 propertynametest_empty-value-valid/namedisplay-name测试字段允许为空/display-namevalue123456/valuedescription测试字段允许为空描述/descriptionvalue-attributesempty-value-validtrue/empty-value-valid/value-attributes/propertytip: empty-value-valid参数为true代表可以为空不设置或者为false是不能为空 如果不设置empty-value-validtrue/empty-value-valid参数不填写内容会提示需要填写 效果 是否显示配置名称
在property标签内添加
value-attributes!-- 默认为input输入框当type为content时即为文本框 --typecontent/type!-- 是否显示配置名称 --show-property-namefalse/show-property-name
/value-attributes使用样例 propertynametest_show-property-name/namedisplay-name测试是否显示配置名称/display-namevalue123456/valuedescription测试是否显示配置名称描述/descriptionvalue-attributes!-- 默认为input输入框当type为content时即为文本框 --typecontent/type!-- 是否显示配置名称 --show-property-namefalse/show-property-name/value-attributes/property效果 参数类型设置
字符串类型 propertynamefe_passwd/namedisplay-nameFrontend密码/display-namevalue /valuedescription默认无密码,用来添加节点、检查节点连接客户端使用/description/propertyPassword propertynamefe_passwd/namedisplay-nameFrontend密码/display-namevalue /valuevalue-attributestypepassword/type/value-attributesdescription默认无密码,用来添加节点、检查节点连接客户端使用/description/property样例 Boolean propertynametest_type_boolean/namedisplay-name测试类型-boolean/display-namevalue/valuevalue-attributestypeboolean/type/value-attributes/property样例 Int propertynametest_type_int/namedisplay-name测试类型-int/display-namevalue/valuevalue-attributestypeint/type/value-attributes/property样例 Float propertynametest_type_float/namedisplay-name测试类型-float/display-namevalue/valuevalue-attributestypefloat/type/value-attributes/property样例 Directory
填写目录格式数据非目录格式无法填写 propertynametest_type_directory/namedisplay-name测试类型-directory/display-namevalue/valuevalue-attributestypedirectory/type/value-attributes/property样例 Directories
填写多个目录格式数据多个目录采用逗号分隔或者换行分隔换行分隔保存后会自动转换成逗号分隔 propertynametest_type_directories/namedisplay-name测试类型-directories/display-namevalue/valuevalue-attributestypedirectories/type/value-attributes/property样例 Content-多行文本 propertynametest_type_content/namedisplay-name测试类型-content/display-namevalue/valuevalue-attributestypecontent/type/value-attributes/property样例 user-自动创建用户和用户组
配置后会自动创建用户和用户组并将用户设置到某个组下doris-env.xml文件部分内容如下 propertynamedoris_user/namedisplay-nameDoris user/display-namevaluedoris/valuedescriptionDoris user/description!--选择配置的属性为用户设置成用户则会自动创建该用户--property-typeUSER/property-typevalue-attributestypeuser/typeoverridablefalse/overridable!--设置用户所属用户组--user-groups!--设置用户组属于cluster-env-user_group的配置--!--读取的配置最终会统一汇总到/var/lib/ambari-agent/data/command-xxx.json这个文件可以在这里直接查询验证--propertytypecluster-env/typenameuser_group/name/property!--设置用户组属于doris-env-doris_group的配置这里doris-env就是当前文件的配置--propertytypedoris-env/typenamedoris_group/name/property/user-groups/value-attributes/propertyproperty!--创建用户组组名为doris_group--namedoris_group/namedisplay-namedoris User Group/display-namevaluedoris_group/valueproperty-typeGROUP/property-typedescriptiondoris user group./description/property上面配置实现了创建一个名为doris的用户并将其分配到特定的用户组doris_group和hadoop tipcluster-env-user_group获取到的值就是hadoop