2016年1月9日星期六

JON_004:安装 JBoss Operations Network 3.3(四)

环境:RHEL 7.1 + Oracle JDK 1.7.0_80 + PostgreSQL 9.1

5. 安装与配置 JON 3.3
下载地址:https://access.redhat.com/jbossnetwork/restricted/listSoftware.html?product=em&downloadType=distributions
安装介质:jon-server-3.3.0.GA.zip
切换到 root 用户执行如下命令:
(1)cd /opt/jbshome
(2)unzip software/jon-server-3.3.0.GA.zip
(3)安装 JBoss EAP 插件,插件的 jar 包解压并拷贝到 jon-server-3.3.0.GA/plugins/ 目录
    cd /opt/jbshome/software
    unzip jon-plugin-pack-eap-3.3.0.GA.zip
    unzip jon-plugin-pack-eap-3.3.0.GA-update-01.zip
    unzip jon-plugin-pack-eap-3.3.0.GA-update-02.zip
    cp -f ./jon-plugin-pack-eap-3.3.0.GA/*.jar ../jon-server-3.3.0.GA/plugins/
    cp -f ./plugins/*.jar ../jon-server-3.3.0.GA/plugins/
    rm -rf jon-plugin-pack-eap-3.3.0.GA
    rm -rf plugins
(4)安装 JBoss Data Grid 插件,插件的 jar 包解压并拷贝到 jon-server-3.3.0.GA/plugins/ 目录
    cd /opt/jbshome/software
    unzip jon-plugin-pack-jdg-3.3.0.GA.zip
    unzip jon-plugin-pack-jdg-3.3.0.GA-update-01.zip
    unzip jon-plugin-pack-jdg-3.3.0.GA-update-02.zip
    unzip jon-plugin-pack-jdg-3.3.0.GA-update-03.zip
    unzip jon-plugin-pack-jdg-3.3.0.GA-update-04.zip
    cp -f ./jon-plugin-pack-jdg-3.3.0.GA/*.jar ../jon-server-3.3.0.GA/plugins/
    cp -f ./plugins/*.jar ../jon-server-3.3.0.GA/plugins/
    rm -rf jon-plugin-pack-jdg-3.3.0.GA
    rm -rf plugins
(5)cd /opt/jbshome/jon-server-3.3.0.GA/bin
(6)vim /opt/jbshome/jon-server-3.3.0.GA/bin/rhq-server.properties
找到 PostgreSQL 数据库配置部分,内容如下:

# PostgreSQL database
rhq.server.database.connection-url=jdbc:postgresql://127.0.0.1:5432/rhq
rhq.server.database.user-name=rhqadmin
rhq.server.database.password=1eeb2f255e832171df8592078de921bc
rhq.server.database.type-mapping=PostgreSQL
rhq.server.database.server-name=127.0.0.1
rhq.server.database.port=5432
rhq.server.database.db-name=rhq
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
rhq.server.quartz.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate

这里数据库的口令已经被加密。
如果修改了数据库密码,可以使用 ./rhq-encode-value.sh 生成加密后口令。
./rhq-encode-value.sh
00:03:25,925 INFO  [org.jboss.modules] JBoss Modules version 1.3.3.Final-redhat-1
Property rhq.autoinstall.server.admin.password [y/n]: n
Property rhq.server.database.password [y/n]: y
Password: rhqadmin

    
    
Encoded password for rhq-server.properties:
     rhq.server.database.password=1eeb2f255e832171df8592078de921bc
    
Please consult the documentation for additional help.


可以发现,目前在rhq-server.properties 文件中加密的口令就是之前输入的rhqadmin。
说明安装JON时,自动读取了PostgreSQL数据库设置,因此不用修改rhq-server.properties文件。   

(7)安装 JON 三大服务:Storage、Server、Agent,其中 Storage 用于存放所有监控指标数据。
  安装所有服务并启动:./rhqctl install --start

00:08:21,489 INFO  [org.jboss.modules] JBoss Modules version 1.3.3.Final-redhat-1

The [rhq.autoinstall.server.admin.password] property is required but not set in [rhq-server.properties].
Do you want to set [rhq.autoinstall.server.admin.password] value now?
yes|no: yes
rhq.autoinstall.server.admin.password (enter as plain text):
Confirm:
rhq.autoinstall.server.admin.password (enter as plain text):

The [jboss.bind.address] property is required but not set in [rhq-server.properties].
Do you want to set [jboss.bind.address] value now?
yes|no: yes
jboss.bind.address: 192.168.56.101
Is [0.0.0.0] correct?
yes|no: yes
……
输出很多信息后......
……

RHQ Agent (pid 7581 ) is ✔running

(6)启动 JON 服务器:./rhqctl start
00:18:18,396 INFO  [org.jboss.modules] JBoss Modules version 1.3.3.Final-redhat-1
RHQ storage node (pid 6167) is running
RHQ Server                     (pid 6427   ) is ✔running
RHQ Agent (pid 7581 ) is ✔running
(7)查看 JON 服务器状态:./rhqctl status
00:19:37,061 INFO  [org.jboss.modules] JBoss Modules version 1.3.3.Final-redhat-1
RHQ Storage Node               (pid 6167   ) is ✔running
RHQ Server                     (pid 6427   ) is ✔running
JBossAS Java VM child process  (pid 6542   ) is ✔running
RHQ Agent                      (pid 7581   ) is ✔running
 (8)访问 JON 控制台:http://192.168.56.101:7080
输入用户名/口令:rhqadmin/rhqadmin
如果没有出现登陆界面,耐心地等待一会儿,因为后台还在启动JBoss,查看日志获取详细信息:
tail -f ../logs/server.log


没有评论: