2017年1月23日 星期一

JBoss Wildfly 10 安裝 for CentOS 7

作業系統版本: CentOS 7

至官網下載jboss wildfly 10 安裝檔

此次安裝使用 : wildfly-10.0.0.Final.tar.gz

JAVA版本使用: jdk1.8.0_111


開啟防火牆 8080 & 9990
firewall-cmd --add-port=8080/tcp --permanent
firewall-cmd --add-port=9990/tcp --permanent
firewall-cmd --reload

解壓縮wildfly 10
tar -zxvf wildfly-10.0.0.Final.tar.gz

移動到目錄位置
mv wildfly-10.0.0.Final /usr/local/

解壓縮jdk 1.8
tar -zxvf jdk-8u111-linux-x64.tar.gz

建立java目錄並將java移動到指定位置
mkdir /usr/java
mv jdk1.8.0_111 /usr/java/

在wildfly 10 上新增java 位置
vim /usr/local/wildfly-10.0.0.Final/bin/standalone.sh

最上面新增以下
JAVA_HOME="/usr/java/jdk1.8.0_111"
export JAVA_HOME
JAVA_OPTS="-showversion -Xms256M -Xmx1024M -XX:MaxPermSize=256M -Xss256K -Doracle.jdbc.V8Compatible=true -Djava.awt.headless=true"
export JAVA_OPTS


新增mysql & oracle driver & 開放IP
vim /usr/local/wildfly-10.0.0.Final/standalone/configuration/standalone.xml

搜尋driver
加入以下資訊
<driver name="mysql" module="com.mysql.mysql">
    <xa-datasource-class>com.mysql.jdbc.Driver</xa-datasource-class>
</driver>
<driver name="oracle" module="com.oracle.oracle">
    <xa-datasource-class>oracle.jdbc.driver.OracleDriver</xa-datasource-class>
</driver>

搜尋127.0.0.1
<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">
            <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>
    </interfaces>




建立目錄並將mysql & oracle driver 放到指定位置
MySQL driver 版本:
mkdir -p /usr/local/wildfly-10.0.0.Final/modules/system/layers/base/com/mysql/mysql/main
mv mysql5.1.37.jar /usr/local/wildfly-10.0.0.Final/modules/system/layers/base/com/mysql/mysql/main/

vim /usr/local/wildfly-10.0.0.Final/modules/system/layers/base/com/mysql/mysql/main/module.xml
新增以下資訊
<?xml version="1.0" encoding="UTF-8"?>

<module xmlns="urn:jboss:module:1.0" name="com.mysql.mysql">
  <resources>
    <resource-root path="mysql5.1.37.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
  </dependencies>
</module>


Oracle driver 版本:
mkdir -p /usr/local/wildfly-10.0.0.Final/modules/system/layers/base/com/oracle/oracle/main
mv ojdbc6.jar /usr/local/wildfly-10.0.0.Final/modules/system/layers/base/com/oracle/oracle/main/

vim /usr/local/wildfly-10.0.0.Final/modules/system/layers/base/com/oracle/oracle/main/module.xml
新增以下資訊
<?xml version="1.0" encoding="UTF-8"?>

<module xmlns="urn:jboss:module:1.0" name="com.oracle.oracle">
  <resources>
    <resource-root path="ojdbc6.jar"/>
  </resources>
  <dependencies>
    <module name="javax.api"/>
  </dependencies>
</module>

啟動jboss wildfly 10
/usr/local/wildfly-10.0.0.Final/bin/standalone.sh

至IP位置連接看是否會出現wildfly 10 畫面
http://192.168.0.191:9990
有出現以下畫面即為成功


因無管理帳號,需要新增使用者帳號
vim /usr/local/wildfly-10.0.0.Final/bin/add-user.sh

最上面加入以下
JAVA_HOME="/usr/java/jdk1.8.0_111"
export JAVA_HOME

執行:
/usr/local/wildfly-10.0.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 : root
The username 'root' is easy to guess
Are you sure you want to add user 'root' yes/no? yes
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 :(鍵入密碼)
WFLYDM0100: Password should have at least 1 alphanumeric character.
Are you sure you want to use the password entered yes/no? yes
Re-enter Password :(鍵入密碼)
What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[  ]:(Enter)
About to add user 'root' for realm 'ManagementRealm'
Is this correct yes/no? yes
Added user 'root' to file '/usr/local/wildfly-10.0.0.Final/standalone/configuration/mgmt-users.properties'
Added user 'root' to file '/usr/local/wildfly-10.0.0.Final/domain/configuration/mgmt-users.properties'
Added user 'root' with groups  to file '/usr/local/wildfly-10.0.0.Final/standalone/configuration/mgmt-groups.properties'
Added user 'root' with groups  to file '/usr/local/wildfly-10.0.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="MTIzMTIzMTIz" />


以下為看佈署程式需求
新增MySQL DataSource








新增Oracle DataSource



佈署程式










沒有留言:

張貼留言