wildfly 实践2 --分布式服务配置(客户端角色)
注:在本实践中,客户端角色主要部署web服务
(转载请注明来源:cnblogs coder-fang)
- 打开50.253机器上的standalone.xml,找到<management> 》<security-realms>结点,增加如下配置:
<security-realm name="ejb-security-realm"> <server-identities> <secret value="MTIz"/> </server-identities> </security-realm>
注:上述配置中的secret value="MTIz",“MTIz” 是"123"的base64编码,因为在上一节中,我们服务端配置的用户为ejbuser,密码为123
- 在<socket-binding-group>节点下增加如下配置:
<outbound-socket-binding name="remote-ejb"> <remote-destination host="192.168.50.123" port="8080"/> </outbound-socket-binding>
- 在<subsystem xmlns="urn:jboss:domain:remoting:3.0">节点下增加如下配置:
<outbound-connections> <remote-outbound-connection name="remote-ejb-connection" outbound-socket-binding-ref="remote-ejb" username="ejbuser" security-realm="ejb-security-realm" protocol="http-remoting"> <properties> <property name="SASL_POLICY_NOANONYMOUS" value="false"/> <property name="SSL_ENABLED" value="false"/> </properties> </remote-outbound-connection> </outbound-connections>
- 修改<interfaces>节点,配置如下:
<interfaces> <interface name="management"> <inet-address value="${jboss.bind.address.management:0.0.0.0}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:0.0.0.0}"/> </interface> <interface name="unsecure"> <inet-address value="${jboss.bind.address.unsecure:0.0.0.0}"/> </interface> </interfaces>
注:此配置目的是使用ip地址可访问服务,配置之前只能使用localhost或127.0.0.1访问。
- 运行wildfly/bin下的standalone.sh或standalone.bat,本例服务正常开启。
- 至此,客户端服务器配置完成