ber*_*ami 15 configuration jboss7.x
我可以通过CLI界面读取系统属性
/system-property=propertyname:read-attribute(name="value")
有没有一种简单的方法可以通过CLI界面更新属性?
Jam*_*ins 14
您可以使用该write-attribute
操作更改系统属性值.
/system-property=propertyname:write-attribute(name="value", value="newValue")
Run Code Online (Sandbox Code Playgroud)
请参阅下面的答案以获得更好的描述.
ddr*_*dri 14
您只需使用write-attribute操作即可.
管理CLI的健康工作流是公开,读取和写入资源属性.举一个这个工作流程的例子,我们将在JBoss Application Server 7.1.0Beta1的全新默认安装上执行以下步骤.
我们并不总是知道我们正在寻找的确切名称.我们可以使用选项卡完成和通配符搜索的混合,以便轻松公开资源和属性.该write-attribute
操作是任何工作流程的良好开端,因为它公开了所有当前实体.
[domain@localhost:9999 /] /system-property=*:read-resource
{
"outcome" => "success",
"result" => [{
"address" => [("system-property" => "java.net.preferIPv4Stack")],
"outcome" => "success",
"result" => {
"boot-time" => true,
"value" => "true"
}
}]
}
Run Code Online (Sandbox Code Playgroud)
该read-resource
行动暴露了该read-resource
财产.我们可以通过使用该java.net.preferIPv4Stack
操作进一步查询.
[domain@localhost:9999 /] /system-property=java.net.preferIPv4Stack:read-resource-description
{
"outcome" => "success",
"result" => {
"description" => "A system property to set on all servers in the domain.",
"head-comment-allowed" => true,
"tail-comment-allowed" => false,
"attributes" => {
"value" => {
"type" => STRING,
"description" => "The value of the system property.",
"required" => false,
"access-type" => "read-write",
"storage" => "configuration",
"restart-required" => "no-services"
},
"boot-time" => {
"type" => BOOLEAN,
"description" => "If true the system property is passed on the command-line to the started server jvm. If false, it will be pushed to the server as part of the startup sequence.",
"required" => false,
"default" => true,
"access-type" => "read-write",
"storage" => "configuration",
"restart-required" => "no-services"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)
该read-resource-description
操作打印有关资源的信息,包括其属性.我们可以通过read-resource-description
操作专门查询这些属性.再次,选项卡完成使您可以在开始键入时轻松编写这些操作字符串,然后单击选项卡以完成字符串或建议可用的添加项.
[domain @ localhost:9999 /] /system-property=java.net.preferIPv4Stack:read-attribute(name=boot-time)
{"outcome"=>"success","result"=> true}
与我们查询属性的方式相同,我们可以更改它.在这种情况下,我们可以使用该read-attribute
操作,记住write-attribute
操作报告的预期值类型.此操作声明属性为BOOLEAN,但您应该能够通过查看read-resource-description
命令中的现有值(定义它的位置)来解决此问题.
[domain@localhost:9999 /] /system-property=java.net.preferIPv4Stack:write-attribute(name=boot-time, value=false)
{
"outcome" => "success",
"result" => {
"domain-results" => {"step-1" => undefined},
"server-operations" => undefined
}
}
Run Code Online (Sandbox Code Playgroud)
我们可以read-attribute
再次运行操作来显示值的变化.
[domain@localhost:9999 /] /system-property=java.net.preferIPv4Stack:read-attribute(name=boot-time)
{
"outcome" => "success",
"result" => false
}
Run Code Online (Sandbox Code Playgroud)
只是为了优雅地结束示例,让我们将值更改回原始状态.
[domain@localhost:9999 /] /system-property=java.net.preferIPv4Stack:write-attribute(name=boot-time, value=true)
{
"outcome" => "success",
"result" => {
"domain-results" => {"step-1" => undefined},
"server-operations" => undefined
}
}
Run Code Online (Sandbox Code Playgroud)
是的,您可以编写属性值.为了简化过程,暴露属性值和文件类型定义的工作流习惯是一种很好的做法,应该使过程更加清晰.
归档时间: |
|
查看次数: |
15171 次 |
最近记录: |