您好,登錄后才能下訂單哦!
本篇文章給大家分享的是有關(guān)CronHub的安裝部署是怎樣的,小編覺(jué)得挺實(shí)用的,因此分享給大家學(xué)習(xí),希望大家閱讀完這篇文章后可以有所收獲,話不多說(shuō),跟著小編一起來(lái)看看吧。
一、基礎(chǔ)環(huán)境
IP:10.29.181.32
# mkdir -p /opt/software/tools
# ls /opt/software/tools
apache-ant-1.9.9-bin.tar.bz2 jdk-8u51-linux-x64.tar.gz
apache-tomcat-8.0.24.tar.gz master.zip
二、安裝MYSQL
(1)可以使用yum進(jìn)行安裝
# yum -y install mysql-server
# yum -y install php-mysql
(2)可以使用自己編寫(xiě)的源碼安裝腳本進(jìn)行安裝
# cd /opt/software/tools
# unzip mysql-install.zip
# cd mysql-install
# vim mysql_install.sh
更改package_dir為你存放腳本的正確路徑
# sh mysql_install.sh
# . /etc/profile
# vim /etc/my.cnf
更改:
innodb_buffer_pool_size = 2G
# /etc/init.d/mysqld start啟動(dòng)
# chkconfig mysqld on設(shè)置開(kāi)機(jī)自啟
# mysqladmin -u root password '1qaz@WSX?'設(shè)置登錄mysql的用戶密碼
# mysql -uroot -p登錄驗(yàn)證
> select user,host,password from mysql.user;
> delete from mysql.user where user='';刪除匿名用戶
> grant all privileges on cronhub_manage_system.* to 'cronhub'@'%' identified by '1qaz@WSX?';授權(quán)用戶可以連接cronhub使用的庫(kù)
建庫(kù)建表
# cd /opt/software/tools
# unzip master.zip
# mv CronHub-master/ /usr/local/
# cd /usr/local/CronHub-master/WebRoot/download
# mysql -uroot -p < cronhub_manage_system.sql
# mysql -uroot -p
> show databases;--> cronhub_manage_system
> use cronhub_manage_system
> show tables;查看庫(kù)中生成的表,并清空這些表
三、安裝JDK
# cd /opt/software/tools/
# tar zxvf jdk-8u51-linux-x64.tar.gz
# mkdir /usr/local/java
# mv jdk1.8.0_51/ /usr/local/java/
# vim /etc/profile
添加如下內(nèi)容:
#set JDK enviroment
JAVA_HOME=/usr/local/java/jdk1.8.0_51
JAVA_BIN=/usr/local/java/jdk1.8.0_51/bin
PATH=$PATH:$JAVA_BIN
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
# . /etc/profile
# java -version驗(yàn)證
java version "1.8.0_51"
四、修改JAVA WEB中央服務(wù)器配置文件,打包
(1)安裝ant
# cd /opt/software/tools/
# tar xvf apache-ant-1.9.9-bin.tar.bz2 -C /usr/local/
# vim /etc/profile
添加如下內(nèi)容:
#set Ant enviroment
export ANT_HOME=/usr/local/apache-ant-1.9.9
export PATH=$PATH:$ANT_HOME/bin
# . /etc/profile
(2)修改配置文件
# cd /usr/local/CronHub-master/ant
# vim 192.168.101.9.properties
包含application.properties和log4j.properties兩個(gè)文件的內(nèi)容。需要更改為自己的數(shù)據(jù)庫(kù),安裝路徑等信息。內(nèi)容如下:
db.jdbcurl=jdbc\:mysql\://10.29.181.32\:3306/cronhub_manage_system?useUnicode\=true&characterEncoding\=UTF-8
db.username=cronhub
db.password=1qaz@WSX?
undoReportHttpUrl=http\://10.29.181.32\:8085/record_undo/report.action
serverRootUrl=http\://10.29.181.32\:8085
alertFromUserMail=monitor@66rpg.com
alertFromPassword=YjImayomdhk55nQq
alertHostMail=smtp.exmail.qq.com
alertDestMail={"3004947672@qq.com"\:""}
########################log4j
log4j.rootLogger=info, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %p\t| %m%n
log4j.logger.Validate=info, validate
log4j.appender.validate=org.apache.log4j.DailyRollingFileAppender
log4j.appender.validate.File=/usr/local/dispatch_system_tomcat/logs/dispatch_sys/service.log
log4j.appender.validate.DatePattern='.'yyyy-MM-dd'.bak'
log4j.appender.validate.layout=org.apache.log4j.PatternLayout
log4j.appender.validate.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %p\t| %m%n
log4j.logger.Error=error, err
log4j.appender.err=org.apache.log4j.DailyRollingFileAppender
log4j.appender.err.File=/usr/local/dispatch_system_tomcat/logs/dispatch_sys/error.log
log4j.appender.err.DatePattern='.'yyyy-MM-dd'.bak'
log4j.appender.err.layout=org.apache.log4j.PatternLayout
log4j.appender.err.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %p\t| %m%n
log4j.logger.DaemonError=error, daemonError
log4j.appender.daemonError=org.apache.log4j.DailyRollingFileAppender
log4j.appender.daemonError.File=/usr/local/dispatch_system_tomcat/logs/dispatch_sys/daemonError.log
log4j.appender.daemonError.DatePattern='.'yyyy-MM-dd'.bak'
log4j.appender.daemonError.layout=org.apache.log4j.PatternLayout
log4j.appender.daemonError.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %p\t| %m%n
log4j.logger.RecordUndoLogger=info, recordUndoLogger
log4j.appender.recordUndoLogger=org.apache.log4j.DailyRollingFileAppender
log4j.appender.recordUndoLogger.File=/usr/local/dispatch_system_tomcat/logs/dispatch_sys/recordUndoLogger.log
log4j.appender.recordUndoLogger.DatePattern='.'yyyy-MM-dd'.bak'
log4j.appender.recordUndoLogger.layout=org.apache.log4j.PatternLayout
log4j.appender.recordUndoLogger.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %p\t| %m%n
log4j.logger.RecordDoneLogger=info, recordDoneLogger
log4j.appender.recordDoneLogger=org.apache.log4j.DailyRollingFileAppender
log4j.appender.recordDoneLogger.File=/usr/local/dispatch_system_tomcat/logs/dispatch_sys/recordDoneLogger.log
log4j.appender.recordDoneLogger.DatePattern='.'yyyy-MM-dd'.bak'
log4j.appender.recordDoneLogger.layout=org.apache.log4j.PatternLayout
log4j.appender.recordDoneLogger.layout.ConversionPattern=[%d{yyyy-MM-dd HH\:mm\:ss}] %p\t| %m%n
log4j.logger.RecordDoneError=info, recordDoneError
log4j.appender.recordDoneError=org.apache.log4j.DailyRollingFileAppender
log4j.appender.recordDoneError.File=/usr/local/dispatch_system_tomcat/logs/dispatch_sys/recordDoneError.log
log4j.appender.recordDoneError.DatePattern='.'yyyy-MM-dd'.bak'
log4j.appender.recordDoneError.layout=org.apache.log4j.PatternLayout
(3)運(yùn)行build.xml進(jìn)行打包
# cd /usr/local/CronHub-master/ant
# ant -f build.xml
# ls /usr/local/CronHub-master/war/CronhubManageSystem_101.9.war
五、部署war包到tomcat,啟動(dòng)
(1)安裝tomcat
# cd /opt/software/tools/
# tar zxvf apache-tomcat-8.0.24.tar.gz -C /usr/local/
# cd /usr/local/
# mv apache-tomcat-8.0.24/ dispatch_system_tomcat
(2)部署tomcat及啟動(dòng)
一定將之前打好的war包放入webapp/ROOT/下
# rm -rf /usr/local/dispatch_system_tomcat/webapps/ROOT/*
# cp /usr/local/CronHub-master/war/CronhubManageSystem_101.9.war \
/usr/local/dispatch_system_tomcat/webapps/ROOT/
# cd /usr/local/dispatch_system_tomcat/webapps/ROOT/
# jar -xvf CronhubManageSystem_101.9.war解壓war包
# vim /usr/local/dispatch_system_tomcat/conf/server.xml
更改啟動(dòng)端口8080為8085
<Connector port="8085" protocol="HTTP/1.1"
# cd /usr/local/dispatch_system_tomcat/bin/
# sh startup.sh啟動(dòng)tomcat
# ps -ef | grep tomcat檢測(cè)是否啟動(dòng)
# lsof -i :8085
(3)訪問(wèn)測(cè)試
在瀏覽器中輸入CronHub-01機(jī)器的外網(wǎng)ip及應(yīng)用端口
http://101.37.21.22:8085/
(4)更改頁(yè)面logo
# cd /usr/local/dispatch_system_tomcat/webapps/ROOT/
# vim index.html
更改如下內(nèi)容:
......
#top-logo {
height: 50px;
line-height: 50px;
float: left;
text-align: center;
width: 279px; /*修改為logo圖片width*/
background: url() no-repeat; /*在這里添加logo圖片路徑*/
}
<td id="td-top">
<div id="top-logo"><big><font color=blue>橙光游戲 * CronHub時(shí)間調(diào)度系統(tǒng)</font></big></div>
<div id="top-right" >
<div><big><font color=green>運(yùn)維部</font></big></div>
</div>
......
在瀏覽器中輸入CronHub-01機(jī)器的外網(wǎng)ip及應(yīng)用端口
http://101.37.21.22:8085/
六、安裝daemon
拷貝daemon端安裝腳本/usr/local/CronHub-master/WebRoot/download下的
install_start.sh。默認(rèn)情況下這個(gè)腳本只支持安裝centos客戶端,經(jīng)過(guò)更改可
以支持ubuntu客戶端
# cp install_start.sh /home/scripts/拷貝到/home/scripts/下
對(duì)于除本機(jī)外的客戶端(10.26.200.227)可以使用如下命令進(jìn)行:
ansible分發(fā)cronhub客戶端程序
# ansible 10.26.200.227 -m copy -a 'src=/home/scripts/install_start.sh dest=/home/scripts/install_start.sh mode=644 owner=root'
# ansible 10.26.200.227 -m shell -a "bash /home/scripts/install_start.sh -d /usr/local/daemon -s 2017 -i 10.29.181.32 -p 8085"
注釋:
# bash /home/scripts/install_start.sh -d /usr/local/daemon -s 2017 -i 10.29.181.32 -p 8085
-d 安裝daemon客戶端的路徑
-s 本地啟動(dòng)的端口,用于與服務(wù)的通信
-i 服務(wù)端的ip地址
-p 服務(wù)端的端口,用于下載安裝包
# ps -ef | grep jsvc
執(zhí)行完腳本就會(huì)啟動(dòng),啟動(dòng)后在控制臺(tái)上查看進(jìn)程會(huì)發(fā)現(xiàn)2個(gè)jsvc進(jìn)程
安裝daemon腳本會(huì)對(duì)centos加入chkconfig到linux系統(tǒng)啟動(dòng)項(xiàng);對(duì)ununtu
會(huì)在/etc/rc.local中添加開(kāi)機(jī)啟動(dòng)項(xiàng)。
七、配置、添加計(jì)劃任務(wù)
(1)增加daemon執(zhí)行器
查看狀態(tài)
(2)添加新任務(wù)
添加任務(wù)的具體內(nèi)容:
以下是添加 每天凌晨2點(diǎn)重啟SVN程序的計(jì)劃任務(wù)
檢測(cè)添加的計(jì)劃任務(wù)
(3)執(zhí)行結(jié)果查詢
八、批量添加
(1)批量添加daemon執(zhí)行器
# cd /home/scripts/CronHub
# vim info.txt
填入信息如下:
10.27.13.71feed-redis-slave-02
10.26.234.157passport-redis-slave
10.47.134.28rc-rcc-redis-slave-01
# python insert_info.py執(zhí)行python腳本進(jìn)行批量添加
(2)批量添加調(diào)度任務(wù)
# cd /home/scripts/CronHub
# vim list.conf
填入信息如下:
passport-redis-slave redis
chengguang-web-03 web
# python insert_cron.py執(zhí)行python腳本進(jìn)行批量添加
以上就是CronHub的安裝部署是怎樣的,小編相信有部分知識(shí)點(diǎn)可能是我們?nèi)粘9ぷ鲿?huì)見(jiàn)到或用到的。希望你能通過(guò)這篇文章學(xué)到更多知識(shí)。更多詳情敬請(qǐng)關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。