我设法在域模式下在Wildfly上运行Ubuntu,但是在Windows中遇到了麻烦。下面是我的设置和步骤:
S1和S2),Wildfly将作为Windows service在其上运行domain.xml、host-master.xml和host-slave.xml文件。在Linux上,我更新/etc/default/wildfly文件,告诉S1服务器它将是master,S2将是slave。主从配置在host-master.xml和host-slave.xml文件中。因此,基本上,我告诉S1使用主机-主人和S2的主机-从。如果我添加S3服务器,我告诉它使用具有适当配置的主机-从服务器。wildfly\bin\service目录service install /controller S1:9990 /host master /user user /password passservice install /controller S1:9990 /host slave /user user /password pass但是您可以猜到,虽然我可以登录到管理控制台,但我看不到从服务器。只有师父在场。此外,当我尝试登录到S2上的管理控制台时,我仍然可以看到带有主配置的控制台。
我确实遗漏了一些东西,但我不知道它是什么。你能帮忙吗?
我的主机-master.xml.xml文件:
<?xml version='1.0' encoding='UTF-8'?>
<host name="S1" xmlns="urn:jboss:domain:3.0">
<extensions>
<extension module="org.jboss.as.jmx"/>
</extensions>
<management>
<security-realms>
<security-realm name="ManagementRealm">
<authentication>
<local default-user="$local" skip-group-loading="true"/>
<properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>
</authentication>
<authorization map-groups-to-roles="false">
<properties path="mgmt-groups.properties" relative-to="jboss.domain.config.dir"/>
</authorization>
</security-realm>
<security-realm name="ApplicationRealm">
<authentication>
<local default-user="$local" allowed-users="*" skip-group-loading="true"/>
<properties path="application-users.properties" relative-to="jboss.domain.config.dir"/>
</authentication>
<authorization>
<properties path="application-roles.properties" relative-to="jboss.domain.config.dir"/>
</authorization>
</security-realm>
</security-realms>
<audit-log>
<formatters>
<json-formatter name="json-formatter"/>
</formatters>
<handlers>
<file-handler name="host-file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.domain.data.dir"/>
<file-handler name="server-file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/>
</handlers>
<logger log-boot="true" log-read-only="false" enabled="false">
<handlers>
<handler name="host-file"/>
</handlers>
</logger>
<server-logger log-boot="true" log-read-only="false" enabled="false">
<handlers>
<handler name="server-file"/>
</handlers>
</server-logger>
</audit-log>
<management-interfaces>
<native-interface security-realm="ManagementRealm">
<socket interface="management" port="${jboss.management.native.port:9999}"/>
</native-interface>
<http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
<socket interface="management" port="${jboss.management.http.port:9990}"/>
</http-interface>
</management-interfaces>
</management>
<domain-controller>
<local/>
</domain-controller>
<interfaces>
<interface name="management">
<any-address/>
</interface>
</interfaces>
<jvms>
<jvm name="default">
<heap size="64m" max-size="256m"/>
<permgen size="256m" max-size="256m"/>
<jvm-options>
<option value="-server"/>
</jvm-options>
</jvm>
</jvms>
<servers>
<server name="solr-server" group="solr_server" auto-start="false">
<socket-bindings socket-binding-group="full-sockets" port-offset="983"/>
</server>
<server name="80-8200" group="edys-web-servers" auto-start="false">
<socket-bindings socket-binding-group="full-sockets" port-offset="199"/>
</server>
</servers>
<profile>
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector/>
</subsystem>
</profile>
</host>我的主机-slve.xml文件:
<?xml version='1.0' encoding='UTF-8'?>
<host name="S2" xmlns="urn:jboss:domain:3.0">
<extensions>
<extension module="org.jboss.as.jmx"/>
</extensions>
<management>
<security-realms>
<security-realm name="ManagementRealm">
<server-identities>
<secret value="UGFzc3cwcmQ="/>
</server-identities>
<authentication>
<local default-user="$local" skip-group-loading="true"/>
<properties path="mgmt-users.properties" relative-to="jboss.domain.config.dir"/>
</authentication>
<authorization map-groups-to-roles="false">
<properties path="mgmt-groups.properties" relative-to="jboss.domain.config.dir"/>
</authorization>
</security-realm>
<security-realm name="ApplicationRealm">
<authentication>
<local default-user="$local" allowed-users="*" skip-group-loading="true"/>
<properties path="application-users.properties" relative-to="jboss.domain.config.dir"/>
</authentication>
<authorization>
<properties path="application-roles.properties" relative-to="jboss.domain.config.dir"/>
</authorization>
</security-realm>
</security-realms>
<audit-log>
<formatters>
<json-formatter name="json-formatter"/>
</formatters>
<handlers>
<file-handler name="host-file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.domain.data.dir"/>
<file-handler name="server-file" formatter="json-formatter" path="audit-log.log" relative-to="jboss.server.data.dir"/>
</handlers>
<logger log-boot="true" log-read-only="false" enabled="false">
<handlers>
<handler name="host-file"/>
</handlers>
</logger>
<server-logger log-boot="true" log-read-only="false" enabled="false">
<handlers>
<handler name="server-file"/>
</handlers>
</server-logger>
</audit-log>
<management-interfaces>
<native-interface security-realm="ManagementRealm">
<socket interface="management" port="${jboss.management.native.port:9999}"/>
</native-interface>
</management-interfaces>
</management>
<domain-controller>
<remote security-realm="ManagementRealm" username="ebys">
<discovery-options>
<static-discovery name="primary" protocol="${jboss.domain.master.protocol:remote}" host="${jboss.domain.master.address:S1}"
port="${jboss.domain.master.port:9999}"/>
</discovery-options>
</remote>
</domain-controller>
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:S2}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:S2}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:S2}"/>
</interface>
</interfaces>
<jvms>
<jvm name="default">
<heap size="64m" max-size="256m"/>
<permgen size="256m" max-size="256m"/>
<jvm-options>
<option value="-server"/>
</jvm-options>
</jvm>
</jvms>
<profile>
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector/>
</subsystem>
</profile>
</host>PS: Windows上有一个错误,我无法停止Wildfly服务。我必须重新启动服务器(服务处于手动模式),然后卸载该服务。因此,如果不首先重新启动服务器,我就不能卸载和安装服务。有一个错误报告了,但不幸的是,这些建议不适用于我。
发布于 2016-02-29 06:08:44
在将WildFly设置为服务之前,应该定义一个环境变量:
JAVA_OPTS=-Djboss.bind.address=<local bind address> -Djboss.bind.address.management=<management bind address> -Djboss.domain.master.address=<address of the domain controller>注意!对于WildFly,10需要添加附加变量:集群中服务器的jboss.bind.address.private=<地址>
Powershell:
[Environment]::SetEnvironmentVariable("JAVA_OPTS", "-Djboss.bind.address=<local bind address> -Djboss.bind.address.management=<management bind address> -Djboss.domain.master.address=<address of the domain controller>", "Machine")最后一个参数"jboss.domain.master.address“-只需要从节点。
Windows服务可以通过< wildfly_home_dir >/bin/ service中的脚本安装:
主节点
service.bat install /host master从节点
service.bat install /controller <domain_conroller_address>:9990 /host <slave_host_name> /user <admin_user_to_domain_controller> /password <admin_password_to_domain_controller>对于从节点需要更改系统注册表项(激活从模式配置):
regedit
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\Wildfly\Parameters\Start
Params:REG_MULTI_SZ
/c "set NOPAUSE=Y && domain.bat --host-config=host-slave.xml"在域-控制器节点上,为从节点添加一个新用户(可以是所有节点的一个用户)。交互式命令行脚本- add_user.bat。
完成后,它将在控制台上打印带有密码的XML标记(<保密值.)。应该将其复制并插入从节点上的host-slve.xml文件中(应将用户名作为属性“username”添加到标记主机/域控制器/remote中:
host-slave.xml
<host xmlns="urn:jboss:domain:3.0" name="slave">
<management>
<security-realms>
<security-realm name="ManagementRealm">
<server-identities>
<secret value="MQ=="/>
</server-identities>
</security-realm>
</security-realms>
</management>
<domain-controller>
<remote security-realm="ManagementRealm" username="slave">
<discovery-options>
<static-discovery name="primary" protocol="${jboss.domain.master.protocol:remote}" host="${jboss.domain.master.address}" port="${jboss.domain.master.port:9999}"/>
</discovery-options>
</remote>
</domain-controller>
</host>乔斯克利
/profile=full-ha/subsystem=messaging/hornetq-server=default:write-attribute(name=cluster-password,value="${jboss.messaging.cluster.password:CHANGE ME!!}")另一种方法是为所有WildFly节点定义一个全ha配置的系统环境变量: jboss.messaging.cluster.password (可以在启动域控制器后在管理UI集成中完成)。
5.启动从节点
发布于 2015-11-13 10:51:15
我建议您为EAP6 6/ as 7/WildFly8+使用https://github.com/tfonteyn/jboss7service.bat服务脚本,因为它也支持域模式。
您所需要的是apache prunsrv.exe,您可以从它获得:http://commons.apache.org/proper/commons-daemon/binaries.html。
我建议阅读service.bat中的评论,以了解哪些选项以及如何使用它。
https://stackoverflow.com/questions/33632701
复制相似问题