Wildfly8 domain模式搭建
来源:互联网 发布:变形金刚 能量矩阵 编辑:程序博客网 时间:2024/06/06 11:43
1.wildfly下载
http://wildfly.org/downloads/
2.domain方式搭建集群
ps:基于8.2.0.Final做测试
2.0机器列表
192.168.236.101 (master+domain controller)
192.168.236.102(slave)
2.1新增用户名
新增仅需在master机器上完成;
2.1.1.解压:tar-zxvf wildfly-8.2.0.Final.tar.gz
2.1.2 重命名:mv wildfly-8.2.0.Final wildfly8
2.1.2 增加用户 ./wildfly8/bin/add-user.sh
新增管理员用户 a) Management User (mgmt-users.properties)
最后记录下该用户名的加密密码:(引号内容)用于后面的配置
To represent the user add the following to the server-identities definition <secret value="c2FsdmU=" />
3.master配置
所在目录:/usr/local/wildfly8/domain/configuration/
host.xml配置(注意与slave的host.xml作对比)
<?xml version='1.0' encoding='UTF-8'?><host name="master" xmlns="urn:jboss:domain:2.2"> <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" relative-to="jboss.domain.data.dir" path="audit-log.log"/> <file-handler name="server-file" formatter="json-formatter" relative-to="jboss.server.data.dir" path="audit-log.log"/> </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"> <inet-address value="${jboss.bind.address.management:192.168.236.101}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:192.168.236.101}"/> </interface> <interface name="unsecure"> <!-- Used for IIOP sockets in the standard configuration. To secure JacORB you need to setup SSL --> <inet-address value="${jboss.bind.address.unsecure:192.168.236.101}"/> </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="server-one" group="main-server-group"> </server> </servers></host>
4.slave配置
将slave机器下 /usr/local/wildfly8/domain/configuration/domain.xml重命名,既slave不需要该文件
#mv domain.xml domain.xml_back
然后就是修改host.xml配置文件
host.xml
<?xml version='1.0' encoding='UTF-8'?><host name="slave" xmlns="urn:jboss:domain:2.2"> <management> <security-realms> <security-realm name="ManagementRealm"> <server-identities> #前面master增加的用户加密密码 <secret value="YWRtaW4="/> </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" relative-to="jboss.domain.data.dir" path="audit-log.log"/> <file-handler name="server-file" formatter="json-formatter" relative-to="jboss.server.data.dir" path="audit-log.log"/> </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> # master主机地址 和前面新增的用户名 <remote host="192.168.236.101" port="9999" security-realm="ManagementRealm" username="admin"/> </domain-controller> <interfaces> <interface name="management"> #本机地址 <inet-address value="${jboss.bind.address.management:192.168.236.102}"/> </interface> <interface name="public"> <inet-address value="${jboss.bind.address:192.168.236.102}"/> </interface> <interface name="unsecure"> <inet-address value="${jboss.bind.address.unsecure:192.168.236.102}"/> </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="server-one" group="main-server-group"/> </servers></host>
5.将wildfly配置系统服务
vi /etc/default/wildfly.conf
## JDK目录JAVA_HOME="/usr/local/jdk"## JBOSS_HOME是Wildfly的安装根目录JBOSS_HOME="/usr/local/wildfly8"## 这里需要改为执行wildfly的用户JBOSS_USER=root## 指定运行模式为domainJBOSS_MODE=domain## 指定domain的配置文件为domain.xml,slave的配置文件为host.xmlJBOSS_DOMAIN_CONFIG=domain.xmlJBOSS_HOST_CONFIG=host.xml
设置为系统服务
##将.sh启动命令放到系统目录下cp wildfly8/bin/init.d/wildfly-init-redhat.sh /etc/init.d/wildfly##增加执行权限chmod +x /etc/init.d/wildfly##增加系统服务chkconfig --add wildfly##设置开机启动chkconfig wildfly on##启动wildfly,记得先启动master,再启动salveservice wildfly start
6.验证
更多精彩内容请继续关注我的博客:http://blog.csdn.net/caicongyang
如果你觉得本文对你有帮助,可以扫描下面的微信二维码,请我喝杯水咯!
- Wildfly8 domain模式搭建
- JBoss AS domain模式配置
- setup wildfly8.0
- win7安装wildfly8.1
- wildfly8.1部署注意事项
- wildfly8.1部署注意事项
- Wildfly domain多机多节点集群方式搭建
- domain
- domain
- jboss eap 6.3 域(Domain)模式配置
- jboss eap 6.3 域(Domain)模式配置
- jboss eap 6.3 域(Domain)模式配置
- Wildfly8如何开启access_log的功能
- 图解WildFly8.x配置JNDI数据源
- 图解WildFly8.x模块化加载数据库驱动
- 图解WildFly8之Servlet容器Undertow剖析
- Drools部署(JBOSS8--wildfly8下的部署)
- 企业应用架构模式读书笔记(二) Domain Model
- 增加操作测试用例
- Python解析xml文件(一)
- 监听音量键事件
- freeswitch 高级主题之 jitter buffer
- Android Launcher3 修改双层桌面为单层
- Wildfly8 domain模式搭建
- Bitmap,byte[],Drawable相互转化及拍照保存
- Android GoogleMap 谷歌地图从零开始
- 利用SecureCRT上传、下载文件(使用sz与rz命令),超实用!
- 解决mysql不能模糊查询\的问题
- sklearn 模型持久化,save和load
- 删除操作测试用例
- SpringMVC Controller 介绍
- lua获取get或post参数