简体   繁体   English

Wildfly,重新启动服务器组

[英]Wildfly, restart server group

I need to restart a server group, using the HTTP API. 我需要使用HTTP API重新启动服务器组。 I can't figure out what the correct syntax is. 我不知道什么是正确的语法。

I tried a lot of 我尝试了很多

HashMap<String, Object> requestMap = new HashMap<>();
requestMap.put("operation", "something-something");
requestMap.put("address", "something-something");

final Response response = managementContext
    .request()
    .header("X-Requested-By", WildflyUtils.class.getName())
    .post(Entity.json(requestMap));

or "by hand": 或“手动”:

{"operation":"something-something", "address":"something-something",  "json.pretty":1}

I'm guessing around. 我在猜。 Does someone know which command is best and what the correct syntax for the address is, or where a useful documentation for the HTTP API is? 有人知道哪个命令最好,地址的正确语法是什么,或者HTTP API的有用文档在哪里? The official documentation ( https://docs.jboss.org/author/display/WFLY10/The+HTTP+management+API ) is somewhat small. 官方文档( https://docs.jboss.org/author/display/WFLY10/The+HTTP+management+API )很小。

You should take a look at WildFly 11.0 Model Reference , but I am afraid this does not cover the domain mode. 您应该看一下WildFly 11.0模型参考 ,但是恐怕这并不涵盖域模式。

I had a small demo code here . 我在这里有一个小演示代码。 In your case you should do: 在您的情况下,您应该执行以下操作:

requestMap.put("address", "[\"server-group",\"myServerGroup\"]");
requestMap.put("operation", "restart-servers");
requestMap.put("blocking", "true/false");
requestMap.put("start-mode", "normal/suspend");

I do not know whether it help but I tried with the curl: 我不知道是否有帮助,但是我尝试了一下curl:

curl --digest -u "username:password" 'http://localhost:9990/management' --header "Content-Type: application/json" -d '{"operation":"restart-servers","address":[{"server-group":"your_server_group"}]}'

for standalone: 对于独立版本:

curl --digest -u "username:password" 'http://localhost:9990/management' --header "Content-Type: application/json" -d '{"operation":"reload","address":[]}'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 远程ejb请求到Wildfly服务器的回调时间 - Callback time of an remote ejb request to a wildfly server Wildfly服务器上的Java Spring项目无法访问RESTful服务 - Java Spring Project on a Wildfly Server can't access RESTful Services RestEasy Webservice 服务器教程 Baeldung 不工作 Wildfly 20 - RestEasy Webservice Server Tutorial Baeldung not working Wildfly 20 服务器重新启动后,WCF Rest Service损坏 - WCF Rest Service broken after server restart 如何在不重新启动应用程序服务器的情况下在春季重新初始化bean - How to re-initialize beans in spring without application server restart ContainerException:在Wildfly服务器上部署我的应用程序时,ResourceConfig实例不包含任何根资源类 - ContainerException: The ResourceConfig instance does not contain any root resource classes while deploying my app on Wildfly Server JAX-RS Web应用程序+ Wildfly 8 + ExtJS无法访问服务器方法 - JAX-RS Web application + Wildfly 8 + ExtJS cannot access server method 在 Azure DevOps Server 2022 中获取群组成员 - Get Members of a Group in Azure DevOps Server 2022 解析服务器 REST API - Group by 和 Sum - Parse Server REST API - Group by and Sum 在WildFly上的RESTful应用程序中进行身份验证 - Authentication in RESTful application on WildFly
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM