jboos(wildfly)安装
在Linux
下搭建中间件Wildfly
原名Jboss
一: 实验平台:CentOS 6.5 (命令查看系统版本cat /etc/issue)
二:Java版本:jdk-8u111-linux-x64.tar.gz
三:maven版本:apache-maven-3.3.9-bin.tar.gz
四:wildfly版本:wildfly-10.0.0.Final.tar.gz
五:wildfly 10的运行依赖于Java运行环境, wildfly 10 需要在jdk 8 以上才能运行。
六:jboss版本:jboss-eap-quickstarts-7.1.x-develop.zip
七:jboos更名为wildfly
八:所用IP地址为:192.168.7.222
步骤:
一、环境搭建
1.jdk
环境的搭建
$ mkdir /ane/jdk
$ tar -xzvf jdk-8u111-linux-x64.tar.gz -C /ane/java
#解压缩
添加Java环境变量。编辑/etc/profile/jdk.sh
$ vim /etc/profile/jdk.sh
#!/bin/bash
JAVA_HOME=/ane/java/jdk1.8.0_67
JAVA_BIN=$JAVA_HOME/bin
PATH=$PATH:$JAVA_BIN
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
$ source /etc/profile
#使环境变量立即生效
$ java -version #查看jdk版本
java version "1.8.0_67"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
2.在wildfly
社区下载最新版wildfly
。
http://wildfly.org/
二、wildfly安装及配置
1.解压
为wildfly
创建目录并解压
$ mkdir /ane/wildfly #为wildfly创建目录
$ tar -zxvf wildfly-10.1.0.Final.tar.gz -C /ane/wildfly #解压缩
2.添加系统管理用户
$ pwd
/ane/wildfly/wildfly-10.1.0.Final/bin
$ ./add-user.sh #执行添加用户脚本
What type of user do you wish to add?
a) Management User (mgmt-users.properties) //管理员账户
b) Application User (application-users.properties) //应用账户
(a): a
Enter the details of the new user to add.
Using realm 'ManagementRealm' as discovered from the existing property files.
Username : jarbo
Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
The password should be different from the username
The password should not be one of the following restricted values {root, admin, administrator}
The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password : redhat
WFLYDM0099: Password should have at least 8 characters!
Are you sure you want to use the password entered yes/no? yes
Re-enter Password : redhat
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]: 回车
About to add user 'jarbo' for realm 'ManagementRealm'
Is this correct yes/no?yes
Added user 'jarbo' to file '/ane/wildfly/wildfly-10.1.0.Final/standalone/configuration/mgmt-users.properties'
Added user 'jarbo' to file '/ane/wildfly/wildfly-10.1.0.Final/domain/configuration/mgmt-users.properties'
Added user 'jarbo' with groups to file '/ane/wildfly/wildfly-10.1.0.Final/standalone/configuration/mgmt-groups.properties'
Added user 'jarbo' with groups to file '/ane/wildfly/wildfly-10.1.0.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no?yes
To represent the user add the following to the server-identities definition <secret value="cmVkaGF0" />
3.修改配置文件
$ pwd
/ane/wildfly/wildfly-10.1.0.Final/standalone/configuration
编辑standalone.xml
$ vim /ane/wildfly/wildfly-10.1.0.Final/standalone/configuration/standalone.xml
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
</interface>
</interfaces>
修改为:
<interfaces>
<interface name="management">
<any-address/>
</interface>
<interface name="public">
<any-address />
</interface>
</interfaces>
三、测试
1.重启服务
$ pwd
/ane/wildfly/wildfly-10.1.0.Final/bin
$ ./standalone.sh & #启用服务并后台运行
$ netstat -tln #查看端口
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:9990 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:25 :::* LISTEN
端口都开启后便可使用浏览器访问wildfly
:
192.168.7.222:8080 //主页面
192.168.7.222:9990 //管理页面
四、maven
1.下载maven
http://maven.apache.org/
2.解压安装
$ mkdir /ane/maven
$ tar -zxvf apache-maven-3.3.9-bin.tar.gz -C /ane/maven
添加maven的环境变量,编辑/etc/profile/mvn.sh
$ vim /etc/profile/mvn.sh
#!/bin/bash
export MAVEN_HOME=/ane/maven/apache-maven-3.3.9
PATH=$PATH:$MAVEN_HOME/bin
$ source /etc/profile #是环境变量立刻生效
$ mvn -v #查看maven的版本
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-11T00:41:47+08:00)
Maven home: /ane/maven/apache-maven-3.3.9
Java version: 1.8.0_111, vendor: Oracle Corporation
Java home: /usr/java/jdk1.8.0_111/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "2.6.32-431.el6.x86_64", arch: "amd64", family: "unix"
五、部署应用
1.快速部署应用(确保wildfly已经启动)
下载quickstart
.
https://github.com/jboss-developer/jboss-eap-quickstarts
$ mkdir /ane/quickstart
$ unzip jboss-eap-quickstarts-7.1.x-develop.zip /ane/quickstart
#(若没有unzip命令,使用yum安装一个) #解压缩
$ pwd
/ane/quickstart/jboss-eap-quickstarts-7.1.x-develop/helloworld
$ mvn clean package wildfly:deploy
#(需要一定时间下载~) #下载所需文件
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 09:58 min
[INFO] Finished at: 2017-01-09T11:31:24+08:00
[INFO] Final Memory: 25M/176M
[INFO] ------------------------------------------------------------------------
2.验证是否部署成功:
http://192.168.7.222:8080//jboss-helloworld/
3、命令部署(Jenkins)
A:
下载jenkins
.
https://jenkins.io/index.html
$ pwd
/ane/wildfly/wildfly-10.1.0.Final/bin
$ ./jboss-cli.sh
#进入命令开始部署
You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supportecommands.
[disconnected /] connect (默认连接localhost如果在配置文件中修改了坚挺端口就要在后面跟监听IP地址)
[standalone@localhost:9990 /] deploy ~/jenkins.war
[standalone@localhost:9990 /] help
cn (or cd) - change the current node path to the argument; //切换目录
connect - connect to the server or domain controller; //连接
deploy - deploy an application; //部署应用
help (or h) - print this message; //帮助信息
history - print or disable/enable/clear the history expansion; //历史
ls - list the contents of the node path; //查看目录
pwn (or pwd) - prints the current working node; //查看路径
quit (or q) - quit the command line interface; //退出
undeploy - undeploy an application; //卸载部署应用
version - prints the version and environment information. //查看版本
B:(网页添加)
4.测试Jenkins应用
http://192.168.7.222:8080/jenkins/
Over~
版权协议须知!
本篇文章来源于 Uambiguous ,如本文章侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意
1338 0 2017-02-01
博主卡片
运维时间
搭建这个平台,只为分享及记载自己所遇之事和难题。
现在时间 2024-12-28
今日天气
站点统计
- 文章总数:241篇
- 分类总数:29个
- 评论总数:12条
- 本站总访问量 353713 次
@xiaozi 最后的分享的镜像下载地址打不开 服务器没有开机吗?
@yuanyuan 为什么我的4b安装centos7.9 插上tf卡 显示不兼...
@Wong arrhenius 牛比
@MakerFace 厉害了!
@TongSir 老哥 更新下我的友链链接 https://blog.ton...