opencron

时间:2021-12-30 21:41:15

opencron 是强大的管理linux crontab任务的系统,基于JAVA开发 http://github.com/wolfboys/opencron

一个功能完善真正通用的linux定时任务调度定系统,满足多种场景下各种复杂的定时任务调度,同时集成了linux实时监控,webssh,提供一个方便管理定时任务的平台.

你是否有定时执行任务计划的需求,需要在linux的crontab里一一定义任务?

需要在每台linux服务器的crontab里一一定义任务
任务的执行监控太不方便了
得登录到每台机器查看定时任务的运行结果,机器一多简直是一种灾难
对于多台机器协同处理一个任务很麻烦,如何保证多台机器上的任务按顺序依次执行?
当任务运行失败,要重新执行,还得重新定义下执行时间,让其重跑,重跑完成了还得改回正常时间
正在运行的任务要kill掉很麻烦,查看进程然后才能kill ......

opencron的出现将彻底的解决上面所有问题.功能如下:

自动化管理任务,提供可操作的web图形化管理
要当场执行只需点击执行即可,非常方便
时间规则支持quartz和crontab,更强大更灵活
非常方便的修改任务的执行时间
任务的运行状态实时查看
支持任务kill(包括由当前任务调起的其他子任务链,彻底kill)
支持重新执行正在运行的任务
出错后实时通知给任务人(超过重跑次数自动发送邮件,短信)
支持任务超时设置,一旦超过预定运行时长自动kill,任务结束,防止僵尸任务
支持流程任务(多台机器上协同完成一个大的任务,按任务分配的顺序依次执行每台机器上的任务)
记录任务的运行日志,非常方便查看
多用户多角色
现场执行(选择N台机器同时执行一个命令或任务)
webssh,在浏览器一键ssh登录到linux服务器
提供服务器的性能实时监控 ......

运行环境

Java JDK 1.7 or greater http://www.oracle.com/technetwork/java/javase/overview/index.html
Tomcat server 7.0 or greater https://tomcat.apache.org
Browser IE10+

  1. 安装好了CentOS 7的Linux
  2. 安装好了GIT:如果没有【yum install -y git】

环境检查:

支持:Java,1.7以上:

[root@dg12c2 ~]# java -version
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
[root@dg12c2 ~]# 

支持:Tomcat
下载页面:https://tomcat.apache.org/download-90.cgi#9.0.1

URL:http://mirror.bit.edu.cn/apache/tomcat/tomcat-9/v9.0.7/bin/

解压到目标路径:

[root@dg12c2 tomcat]# mkdir /usr/local/tomcat
[root@dg12c2 tomcat]# cd /usr/local/tomcat/
[root@dg12c2 tomcat]#
[root@dg12c2 tomcat]# unzip /software/tomcat/apache-tomcat-9.0.1.zip 

(... ... 过多的输出)

[root@dg12c2 tomcat]#
[root@dg12c2 tomcat]# du -sh apache-tomcat-9.0.1/
15M     apache-tomcat-9.0.1/
[root@dg12c2 tomcat]#
[root@dg12c2 tomcat]# cd apache-tomcat-9.0.1/
[root@dg12c2 apache-tomcat-9.0.1]# ls -ltr
total 4
drwxr-xr-x. 9 root root 4096 Mar 20 22:14 apache-tomcat-9.0.6
You have mail in /var/spool/mail/root
[root@dg12c2 apache-tomcat-9.0.1]#
[root@dg12c2 apache-tomcat-9.0.1]# chmod -R 755 /usr/local/tomcat/
[root@dg12c2 apache-tomcat-9.0.1]# 

配置环境变量:

[root@dg12c2 apache-tomcat-9.0.1]#
[root@dg12c2 apache-tomcat-9.0.1]#vi /etc/profile
# add 内容
# TOMCAT
export PATH=$PATH:/usr/local/tomcat/apache-tomcat-9.0.1/bin
[root@dg12c2 apache-tomcat-9.0.1]# source /etc/profile
[root@dg12c2 apache-tomcat-9.0.1]# 

启动TOMCAT:

[root@dg12c2 apache-tomcat-9.0.1]# ps -ef | grep tomcat
root     27524 20296  0 17:54 pts/0    00:00:00 grep --color=auto tomcat
[root@dg12c2 apache-tomcat-9.0.1]#
[root@dg12c2 apache-tomcat-9.0.1]# netstat -tupln | grep 80
[root@dg12c2 apache-tomcat-9.0.1]# 

[root@dg12c2 apache-tomcat-9.0.1]# catalina.sh start
Using CATALINA_BASE:   /usr/local/tomcat/apache-tomcat-9.0.1
Using CATALINA_HOME:   /usr/local/tomcat/apache-tomcat-9.0.1
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-9.0.1/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/tomcat/apache-tomcat-9.0.1/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-9.0.1/bin/tomcat-juli.jar
Tomcat started.
[root@dg12c2 apache-tomcat-9.0.1]#
[root@dg12c2 apache-tomcat-9.0.1]# ps -ef | grep tomcat
root     27837     1 99 17:56 pts/0    00:00:08 /usr/bin/java -Djava.util.logging.config.file=/usr/local/tomcat/apache-tomcat-9.0.1/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -classpath /usr/local/tomcat/apache-tomcat-9.0.1/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-9.0.1/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat/apache-tomcat-9.0.1 -Dcatalina.home=/usr/local/tomcat/apache-tomcat-9.0.1 -Djava.io.tmpdir=/usr/local/tomcat/apache-tomcat-9.0.1/temp org.apache.catalina.startup.Bootstrap start
root     27863 20296 13 17:56 pts/0    00:00:00 grep --color=auto tomcat
[root@dg12c2 apache-tomcat-9.0.1]#
[root@dg12c2 apache-tomcat-9.0.1]# netstat -tupln | grep 80
tcp6       0      0 :::8080                 :::*                    LISTEN      27837/java
tcp6       0      0 :::8009                 :::*                    LISTEN      27837/java
[root@dg12c2 apache-tomcat-9.0.1]# 

这个过程中的日志:
目录:/usr/local/tomcat/apache-tomcat-9.0.1/logs

[root@dg12c2 logs]# ls -ltr
total 16
-rw-r----- 1 root root    0 Nov 28 17:57 localhost.2017-11-28.log
-rw-r----- 1 root root    0 Nov 28 17:57 manager.2017-11-28.log
-rw-r----- 1 root root    0 Nov 28 17:57 host-manager.2017-11-28.log
-rw-r----- 1 root root    0 Nov 28 17:59 localhost_access_log.2017-11-28.txt
-rw-r----- 1 root root 4130 Nov 28 17:59 catalina.out
-rw-r----- 1 root root 4130 Nov 28 17:59 catalina.2017-11-28.log
[root@dg12c2 logs]#
[root@dg12c2 logs]# tail -f catalina.2017-11-28.log
28-Nov-2017 17:59:06.362 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/apache-tomcat-9.0.1/temp
28-Nov-2017 17:59:06.362 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
28-Nov-2017 17:59:15.532 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
28-Nov-2017 17:59:17.682 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Nov-2017 17:59:20.258 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
28-Nov-2017 17:59:20.367 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Nov-2017 17:59:20.381 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 107886 ms
28-Nov-2017 17:59:24.156 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
28-Nov-2017 17:59:24.157 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.1
28-Nov-2017 17:59:24.553 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/apache-tomcat-9.0.1/webapps/ROOT]
浏览器查看:ip地址:8080
 
opencron
 

接下来开始正式安装OpenCron。

下载源码:

[root@dg12c2 git_data]# git --version
git version 1.8.3.1
[root@dg12c2 git_data]#
[root@dg12c2 git_data]# git clone https://github.com/wolfboys/opencron.git
Cloning into 'opencron'...
remote: Counting objects: 4841, done.
remote: Compressing objects: 100% (69/69), done.
remote: Total 4841 (delta 39), reused 118 (delta 31), pack-reused 4700
Receiving objects: 100% (4841/4841), 6.72 MiB | 459.00 KiB/s, done.
Resolving deltas: 100% (2219/2219), done.
Checking out files: 100% (479/479), done.
[root@dg12c2 git_data]#
[root@dg12c2 git_data]# ll
total 0
drwxr-xr-x 6 root root 250 Nov 28 18:34 opencron
[root@dg12c2 git_data]#
[root@dg12c2 git_data]# ll opencron/
total 80
-rw-r--r-- 1 root root  4342 Nov 28 18:34 build.sh
-rw-r--r-- 1 root root  8304 Nov 28 18:34 checkstyle.xml
-rw-r--r-- 1 root root   777 Nov 28 18:34 header.txt
-rw-r--r-- 1 root root 11358 Nov 28 18:34 LICENSE.txt
drwxr-xr-x 3 root root    52 Nov 28 18:34 opencron-agent
drwxr-xr-x 3 root root    32 Nov 28 18:34 opencron-common
drwxr-xr-x 3 root root    32 Nov 28 18:34 opencron-server
-rw-r--r-- 1 root root 20668 Nov 28 18:34 pom.xml
-rwxr-xr-x 1 root root 11641 Nov 28 18:34 README.md
-rw-r--r-- 1 root root  5237 Nov 28 18:34 server.sh
[root@dg12c2 git_data]# 

一:安装Agent:

创建数据库(Server端数据库):

[root@dg12c2 ~]# netstat -tupln | grep 3306
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      11612/mysqld
[root@dg12c2 ~]#
[root@dg12c2 ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 834821
Server version: 5.5.56-MariaDB MariaDB Server

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show databases;
+-----------------------------+
| Database                    |
+-----------------------------+
| information_schema          |
| #mysql50#.oracle_jre_usage  |
| mysql                       |
| mysql_enterprise_monitor_db |
| performance_schema          |
| test                        |
| you                         |
+-----------------------------+
7 rows in set (0.00 sec)

MariaDB [(none)]>
MariaDB [(none)]> create database opencron;
Query OK, 1 row affected (0.16 sec)

MariaDB [(none)]> grant all privileges on *.* to 'opencronme'@'10.158.1.97' identified by 'Abcd1@34';
Query OK, 0 rows affected (0.05 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.05 sec)

MariaDB [(none)]> exit
Bye
[root@dg12c2 ~]# 

OpenCron配置:

[root@dg12c2 opencron]# pwd
/software/git_data/opencron
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# cd opencron-server/src/main/resources/
[root@dg12c2 resources]# ls -ltr
total 20
-rwxr-xr-x 1 root root 8741 Nov 28 18:34 opencron.xml
-rw-r--r-- 1 root root 1656 Nov 28 18:34 log4j.properties
-rwxr-xr-x 1 root root 1040 Nov 28 18:34 config.properties
[root@dg12c2 resources]#
[root@dg12c2 resources]# cat config.properties | head -n 6
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://10.158.1.97:3306/opencron?useUnicode=true&characterEncoding=utf8&useCursorFetch=true&autoReconnect=true&failOverReadOnly=false
#这里要改成你自己安装的mysql的用户名和密码
jdbc.username=root
jdbc.password=****

#hibernate
[root@dg12c2 resources]#
[root@dg12c2 resources]# 

这里的MySQL登录最好在命令行中测试一下。

进入源码目录,做编译:

[root@dg12c2 resources]# cd /software/git_data/opencron/
[root@dg12c2 opencron]# ls -ltr
total 80
-rw-r--r-- 1 root root 11358 Nov 28 18:34 LICENSE.txt
-rwxr-xr-x 1 root root 11641 Nov 28 18:34 README.md
-rw-r--r-- 1 root root   777 Nov 28 18:34 header.txt
-rw-r--r-- 1 root root  8304 Nov 28 18:34 checkstyle.xml
-rw-r--r-- 1 root root  4342 Nov 28 18:34 build.sh
drwxr-xr-x 3 root root    52 Nov 28 18:34 opencron-agent
drwxr-xr-x 3 root root    32 Nov 28 18:34 opencron-common
drwxr-xr-x 3 root root    32 Nov 28 18:34 opencron-server
-rw-r--r-- 1 root root  5237 Nov 28 18:34 server.sh
-rw-r--r-- 1 root root 20668 Nov 28 18:34 pom.xml
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# ls -ltr | grep build
-rw-r--r-- 1 root root  4342 Nov 28 18:34 build.sh
[root@dg12c2 opencron]# 

[root@dg12c2 opencron]# sh build.sh 

      --------------------------------------------
    /                                              \
   /   ___  _ __   ___ _ __   ___ _ __ ___  _ __    \
  /   / _ \| '_ \ / _ \ '_ \ / __| '__/ _ \| '_ \    \
 /   | (_) | |_) |  __/ | | | (__| | | (_) | | | |    \
 \    \___/| .__/ \___|_| |_|\___|_|  \___/|_| |_|    /
  \        |_|                                       /
   \                                                /
    \       --opencron,Let's crontab easy!         /
      --------------------------------------------

[opencron] WARNING:maven is not install!
[opencron] download maven Starting...
[opencron] checking network connectivity ...
[opencron] network is connectioned,download maven Starting...
--2017-11-28 18:53:41--  http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz
Resolving mirror.bit.edu.cn (mirror.bit.edu.cn)... 114.247.56.117
Connecting to mirror.bit.edu.cn (mirror.bit.edu.cn)|114.247.56.117|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8738691 (8.3M) [application/octet-stream]
Saving to: ‘/software/git_data/opencron/build/apache-maven-3.5.2-bin.tar.gz’

100%[===============================================================================>] 8,738,691   2.11MB/s   in 4.3s   

2017-11-28 18:53:46 (1.94 MB/s) - ‘/software/git_data/opencron/build/apache-maven-3.5.2-bin.tar.gz’ saved [8738691/8738691]

[opencron] download maven successful!
[opencron] install maven Starting
apache-maven-3.5.2/README.txt
apache-maven-3.5.2/LICENSE
apache-maven-3.5.2/NOTICE
apache-maven-3.5.2/lib/
apache-maven-3.5.2/lib/cdi-api.license
apache-maven-3.5.2/lib/commons-cli.license
apache-maven-3.5.2/lib/commons-io.license
apache-maven-3.5.2/lib/commons-lang3.license
apache-maven-3.5.2/lib/jcl-over-slf4j.license
apache-maven-3.5.2/lib/jsr250-api.license
apache-maven-3.5.2/lib/maven-artifact.license
apache-maven-3.5.2/lib/maven-builder-support.license
apache-maven-3.5.2/lib/maven-compat.license
apache-maven-3.5.2/lib/maven-core.license
apache-maven-3.5.2/lib/maven-embedder.license
apache-maven-3.5.2/lib/maven-model-builder.license
apache-maven-3.5.2/lib/maven-model.license
apache-maven-3.5.2/lib/maven-plugin-api.license
apache-maven-3.5.2/lib/maven-repository-metadata.license
apache-maven-3.5.2/lib/maven-resolver-api.license
apache-maven-3.5.2/lib/maven-resolver-connector-basic.license
apache-maven-3.5.2/lib/maven-resolver-impl.license
apache-maven-3.5.2/lib/maven-resolver-provider.license
apache-maven-3.5.2/lib/maven-resolver-spi.license
apache-maven-3.5.2/lib/maven-resolver-transport-wagon.license
apache-maven-3.5.2/lib/maven-resolver-util.license
apache-maven-3.5.2/lib/maven-settings-builder.license
apache-maven-3.5.2/lib/maven-settings.license
apache-maven-3.5.2/lib/maven-shared-utils.license
apache-maven-3.5.2/lib/maven-slf4j-provider.license
apache-maven-3.5.2/lib/org.eclipse.sisu.inject.license
apache-maven-3.5.2/lib/org.eclipse.sisu.plexus.license
apache-maven-3.5.2/lib/plexus-cipher.license
apache-maven-3.5.2/lib/plexus-component-annotations.license
apache-maven-3.5.2/lib/plexus-interpolation.license
apache-maven-3.5.2/lib/plexus-sec-dispatcher.license
apache-maven-3.5.2/lib/plexus-utils.license
apache-maven-3.5.2/lib/slf4j-api.license
apache-maven-3.5.2/lib/wagon-file.license
apache-maven-3.5.2/lib/wagon-http.license
apache-maven-3.5.2/lib/wagon-provider-api.license
apache-maven-3.5.2/lib/jansi-native/
apache-maven-3.5.2/lib/jansi-native/freebsd32/
apache-maven-3.5.2/lib/jansi-native/freebsd64/
apache-maven-3.5.2/lib/jansi-native/linux32/
apache-maven-3.5.2/lib/jansi-native/linux64/
apache-maven-3.5.2/lib/jansi-native/osx/
apache-maven-3.5.2/lib/jansi-native/windows32/
apache-maven-3.5.2/lib/jansi-native/windows64/
apache-maven-3.5.2/lib/jansi-native/freebsd32/libjansi.so
apache-maven-3.5.2/lib/jansi-native/freebsd64/libjansi.so
apache-maven-3.5.2/lib/jansi-native/linux32/libjansi.so
apache-maven-3.5.2/lib/jansi-native/linux64/libjansi.so
apache-maven-3.5.2/lib/jansi-native/osx/libjansi.jnilib
apache-maven-3.5.2/lib/jansi-native/windows32/jansi.dll
apache-maven-3.5.2/lib/jansi-native/windows64/jansi.dll
apache-maven-3.5.2/bin/m2.conf
apache-maven-3.5.2/bin/mvn.cmd
apache-maven-3.5.2/bin/mvnDebug.cmd
apache-maven-3.5.2/bin/mvn
apache-maven-3.5.2/bin/mvnDebug
apache-maven-3.5.2/bin/mvnyjp
apache-maven-3.5.2/conf/
apache-maven-3.5.2/conf/logging/
apache-maven-3.5.2/conf/logging/simplelogger.properties
apache-maven-3.5.2/conf/settings.xml
apache-maven-3.5.2/conf/toolchains.xml
apache-maven-3.5.2/lib/ext/
apache-maven-3.5.2/lib/jansi-native/
apache-maven-3.5.2/lib/ext/README.txt
apache-maven-3.5.2/lib/jansi-native/README.txt
apache-maven-3.5.2/boot/plexus-classworlds-2.5.2.jar
apache-maven-3.5.2/lib/maven-embedder-3.5.2.jar
apache-maven-3.5.2/lib/maven-settings-3.5.2.jar
apache-maven-3.5.2/lib/plexus-utils-3.1.0.jar
apache-maven-3.5.2/lib/maven-settings-builder-3.5.2.jar
apache-maven-3.5.2/lib/maven-builder-support-3.5.2.jar
apache-maven-3.5.2/lib/commons-lang3-3.5.jar
apache-maven-3.5.2/lib/plexus-interpolation-1.24.jar
apache-maven-3.5.2/lib/plexus-component-annotations-1.7.1.jar
apache-maven-3.5.2/lib/plexus-sec-dispatcher-1.4.jar
apache-maven-3.5.2/lib/plexus-cipher-1.7.jar
apache-maven-3.5.2/lib/maven-core-3.5.2.jar
apache-maven-3.5.2/lib/maven-model-3.5.2.jar
apache-maven-3.5.2/lib/maven-repository-metadata-3.5.2.jar
apache-maven-3.5.2/lib/maven-artifact-3.5.2.jar
apache-maven-3.5.2/lib/maven-plugin-api-3.5.2.jar
apache-maven-3.5.2/lib/org.eclipse.sisu.plexus-0.3.3.jar
apache-maven-3.5.2/lib/cdi-api-1.0.jar
apache-maven-3.5.2/lib/jsr250-api-1.0.jar
apache-maven-3.5.2/lib/javax.inject-1.jar
apache-maven-3.5.2/lib/org.eclipse.sisu.inject-0.3.3.jar
apache-maven-3.5.2/lib/maven-model-builder-3.5.2.jar
apache-maven-3.5.2/lib/guava-20.0.jar
apache-maven-3.5.2/lib/maven-resolver-provider-3.5.2.jar
apache-maven-3.5.2/lib/maven-resolver-api-1.1.0.jar
apache-maven-3.5.2/lib/maven-resolver-spi-1.1.0.jar
apache-maven-3.5.2/lib/maven-resolver-util-1.1.0.jar
apache-maven-3.5.2/lib/maven-resolver-impl-1.1.0.jar
apache-maven-3.5.2/lib/maven-shared-utils-3.1.0.jar
apache-maven-3.5.2/lib/commons-io-2.5.jar
apache-maven-3.5.2/lib/guice-4.0-no_aop.jar
apache-maven-3.5.2/lib/aopalliance-1.0.jar
apache-maven-3.5.2/lib/slf4j-api-1.7.25.jar
apache-maven-3.5.2/lib/commons-cli-1.4.jar
apache-maven-3.5.2/lib/maven-compat-3.5.2.jar
apache-maven-3.5.2/lib/wagon-provider-api-2.12.jar
apache-maven-3.5.2/lib/wagon-http-2.12-shaded.jar
apache-maven-3.5.2/lib/jcl-over-slf4j-1.7.25.jar
apache-maven-3.5.2/lib/wagon-file-2.12.jar
apache-maven-3.5.2/lib/maven-resolver-connector-basic-1.1.0.jar
apache-maven-3.5.2/lib/maven-resolver-transport-wagon-1.1.0.jar
apache-maven-3.5.2/lib/maven-slf4j-provider-3.5.2.jar
apache-maven-3.5.2/lib/jansi-1.16.jar
[opencron] build opencron Starting...

(... 过多的输出)

[opencron] build opencron Starting...
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] opencron
[INFO] opencron-common
[INFO] opencron-agent
[INFO] opencron-server
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building opencron 1.1.0-RELEASE
[INFO] ------------------------------------------------------------------------
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-source-plugin/2.2.1/maven-source-plugin-2.2.1.pom

(... 过多的输出)

/software/git_data/opencron/opencron-server/src/main/java/org/opencron/server/websocket/TerminalHandler.java:123:1: Line contains a tab character.
/software/git_data/opencron/opencron-server/src/main/java/org/opencron/server/websocket/TerminalHandler.java:124:1: Line contains a tab character.
/software/git_data/opencron/opencron-server/src/main/java/org/opencron/server/websocket/TerminalHandler.java:125:1: Line contains a tab character.
/software/git_data/opencron/opencron-server/src/main/java/org/opencron/server/websocket/TerminalHandler.java:126:1: Line contains a tab character.
Audit done.

[INFO] There are 796 checkstyle errors.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ opencron-server ---
[INFO] Installing /software/git_data/opencron/opencron-server/target/opencron-server.war to /root/.m2/repository/org/opencron/opencron-server/1.1.0-RELEASE/opencron-server-1.1.0-RELEASE.war
[INFO] Installing /software/git_data/opencron/opencron-server/pom.xml to /root/.m2/repository/org/opencron/opencron-server/1.1.0-RELEASE/opencron-server-1.1.0-RELEASE.pom
[INFO] Installing /software/git_data/opencron/opencron-server/target/opencron-server-1.1.0-RELEASE-sources.jar to /root/.m2/repository/org/opencron/opencron-server/1.1.0-RELEASE/opencron-server-1.1.0-RELEASE-sources.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] opencron ........................................... SUCCESS [  2.928 s]
[INFO] opencron-common .................................... SUCCESS [02:57 min]
[INFO] opencron-agent ..................................... SUCCESS [02:31 min]
[INFO] opencron-server .................................... SUCCESS [04:38 min]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10:10 min
[INFO] Finished at: 2017-11-29T09:58:37+08:00
[INFO] Final Memory: 60M/780M
[INFO] ------------------------------------------------------------------------
[opencron] build opencron @ Version 1.1.0-RELEASE successfully! please goto /software/git_data/opencron/build/dist
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# 

这个过程会非常长,可以通过下面的方法丢到后台执行:

  1. nohup sh build.sh &
  2. 通过查看nohup.out,确定当前进展: tail -f nohup.out

上面的过程,其实不总是会一帆风顺的,还有可能还会遇到问题:

Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.5.1/plexus-utils-1.5.1.jar (211 kB at 5.8 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/junit/junit/3.8.2/junit-3.8.2.jar
Downloaded from central: https://repo.maven.apache.org/maven2/commons-logging/commons-logging-api/1.1/commons-logging-api-1.1.jar (45 kB at 949 B/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/xbean/xbean-reflect/3.4/xbean-reflect-3.4.jar (134 kB at 2.8 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-container-default/1.5.5/plexus-container-default-1.5.5.jar (217 kB at 4.3 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/junit/junit/3.8.2/junit-3.8.2.jar (121 kB at 1.8 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/log4j/log4j/1.2.12/log4j-1.2.12.jar (358 kB at 4.0 kB/s)
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 40 source files to /software/git_data/opencron/opencron-common/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] opencron ........................................... SUCCESS [27:25 min]
[INFO] opencron-common .................................... FAILURE [56:50 min]
[INFO] opencron-agent ..................................... SKIPPED
[INFO] opencron-server .................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:24 h
[INFO] Finished at: 2017-11-28T20:18:43+08:00
[INFO] Final Memory: 22M/368M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project opencron-common: Compilation failure
[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :opencron-common
[opencron] build opencron failed! please try again
[root@dg12c2 opencron]# 

Linux中默认会有一个OpenJDK的Java支持,如果你选择了它,那么你很可能会遇到上面这个错误。

解决方法:
从Oracle官网下载最新版本的Java JDK程序,安装,然后重新GIT源码包,重新编译,就能解决。

还可能存在的问题:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /software/git_data/opencron/opencron-common/src/main/java/org/opencron/common/utils/DigestUtils.java:[25,16] cannot find symbol
  symbol:   class BASE64Decoder
  location: package sun.misc
[ERROR] /software/git_data/opencron/opencron-common/src/main/java/org/opencron/common/utils/DigestUtils.java:[26,16] cannot find symbol
  symbol:   class BASE64Encoder
  location: package sun.misc
[ERROR] /software/git_data/opencron/opencron-common/src/main/java/org/opencron/common/utils/DigestUtils.java:[150,27] cannot find symbol
  symbol:   class BASE64Encoder
  location: class org.opencron.common.utils.DigestUtils

原因:

java.util.Base64 is available since Java 8

解决方法:
将JDK版本换成:1.8

[root@dg12c2 software]# java -version
java version "9.0.1"
Java(TM) SE Runtime Environment (build 9.0.1+11)
Java HotSpot(TM) 64-Bit Server VM (build 9.0.1+11, mixed mode)
[root@dg12c2 software]#
[root@dg12c2 software]# rpm -qa | grep jdk
java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64
java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64
jdk1.8-1.8.0_152-fcs.x86_64
java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64
java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64
jdk-9.0.1-9.0.1-ga.x86_64
copy-jdk-configs-1.2-1.el7.noarch
[root@dg12c2 software]#
[root@dg12c2 software]# rpm -e jdk-9.0.1-9.0.1-ga.x86_64
[root@dg12c2 software]#
[root@dg12c2 software]# rpm -qa | grep jdk
java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64
java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64
jdk1.8-1.8.0_152-fcs.x86_64
java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64
java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64
copy-jdk-configs-1.2-1.el7.noarch
[root@dg12c2 software]# 

[root@dg12c2 software]# cat ~/.bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

# Prometheus - mysqld
export PATH=$PATH:/usr/local/prometheus/mysqld/mysqld_exporter-0.10.0.linux-amd64

# Prometheus - node
export PATH=$PATH:/usr/local/prometheus/node/node_exporter-0.15.1.linux-amd64

# TOMCAT
export PATH=$PATH:/usr/local/tomcat/apache-tomcat-9.0.1/bin

# Java 8
export PATH=/usr/java/jdk1.8.0_152/bin:$PATH
[root@dg12c2 software]#
[root@dg12c2 software]# source ~/.bash_profile
[root@dg12c2 software]#
[root@dg12c2 software]# java -version
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
[root@dg12c2 software]#
[root@dg12c2 software]# javac -version
javac 1.8.0_152
[root@dg12c2 software]# 

然后重新执行【sh build.sh】。

如果一切顺利,你会得到OpenCRON对应Server与Agent的tar.gz包:

[root@dg12c2 opencron]# ls -ltr /software/git_data/opencron/build/dist
total 49832
-rw-r--r-- 1 root root 11092786 Nov 29 09:58 opencron-agent-1.1.0-RELEASE.tar.gz
-rw-r--r-- 1 root root 39928144 Nov 29 09:58 opencron-server.war
[root@dg12c2 opencron]# 

将Agent传到需要接管的服务器,并解压:

目标,创建存放目录:

[root@dg12c1 ~]# mkdir /software/opencron
[root@dg12c1 ~]# 

传输:

[root@dg12c2 opencron]# scp /software/git_data/opencron/build/dist/opencron-agent-1.1.0-RELEASE.tar.gz dg12c1:/software/opencron
The authenticity of host 'dg12c1 (10.158.1.96)' can't be established.
ECDSA key fingerprint is 48:b8:fc:e2:4b:a3:d7:76:5c:e0:05:43:87:b6:e3:01.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'dg12c1,10.158.1.96' (ECDSA) to the list of known hosts.
root@dg12c1's password:
opencron-agent-1.1.0-RELEASE.tar.gz                                                                                        100%   11MB  10.6MB/s   00:00
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# 

目标端,解压到指定目录:

[root@dg12c1 ~]# cd /software/opencron/
[root@dg12c1 opencron]# ls -ltr
total 10836
-rw-r--r-- 1 root root 11092786 Nov 29 10:29 opencron-agent-1.1.0-RELEASE.tar.gz
[root@dg12c1 opencron]#
[root@dg12c1 opencron]# du -sh *
11M     opencron-agent-1.1.0-RELEASE.tar.gz
[root@dg12c1 opencron]#
[root@dg12c1 opencron]# mkdir -p /usr/local/opencron/agent
[root@dg12c1 opencron]#
[root@dg12c1 opencron]# tar -xzf opencron-agent-1.1.0-RELEASE.tar.gz -C /usr/local/opencron/agent
[root@dg12c1 opencron]#
[root@dg12c1 opencron]# ls -ltr /usr/local/opencron/agent/
total 0
drwxr-xr-x 7 root root 64 Nov 29 10:30 opencron-agent
[root@dg12c1 opencron]# ls -ltr /usr/local/opencron/agent/opencron-agent/
total 4
drwxr-xr-x 2 root root   19 Nov 29 09:45 temp
drwxr-xr-x 2 root root   19 Nov 29 09:45 logs
drwxr-xr-x 2 root root   53 Nov 29 09:45 conf
drwxr-xr-x 2 root root  118 Nov 29 09:45 bin
drwxr-xr-x 2 root root 4096 Nov 29 10:30 lib
[root@dg12c1 opencron]# 

看看配置文件的内容:

[root@dg12c1 opencron-agent]# pwd
/usr/local/opencron/agent/opencron-agent
[root@dg12c1 opencron-agent]#
[root@dg12c1 opencron-agent]# ls -ltr
total 4
drwxr-xr-x 2 root root   19 Nov 29 09:45 temp
drwxr-xr-x 2 root root   19 Nov 29 09:45 logs
drwxr-xr-x 2 root root  118 Nov 29 09:45 bin
drwxr-xr-x 2 root root 4096 Nov 29 10:30 lib
drwxr-xr-x 2 root root   53 Nov 29 10:31 conf
[root@dg12c1 opencron-agent]#
[root@dg12c1 opencron-agent]# ls -ltr conf/
total 8
-rw-r--r-- 1 root root 2530 Nov 29 09:45 log4j.properties
-rw-r--r-- 1 root root  481 Nov 29 09:45 conf.properties
[root@dg12c1 opencron-agent]#
[root@dg12c1 opencron-agent]# cat conf/conf.properties
#agent停止的socket请求端口(该端口不用特别配置,只是系统自己依赖的一个端口,不对server和其他地方暴露)
opencron.shutdown=1529

#agent监控服务端口(实时监控的端口,需要对外暴露.可以根据需求改这里的端口,这里如果改动了server端的配置里也得改成一致)
opencorn.monitorPort=17502

#agent默认连接密码(启动agent时如果没输连接密码则取改密码为默认连接密码)
opencorn.password=opencron
[root@dg12c1 opencron-agent]# 

日志目录:

[root@dg12c1 opencron-agent]# ls -ltr logs/
total 0
[root@dg12c1 opencron-agent]# 

Agent:启动

[root@dg12c1 opencron-agent]# ls -ltr bin/
total 36
-rw-r--r-- 1 root root  1905 Nov 29 09:45 startup.sh
-rw-r--r-- 1 root root  1903 Nov 29 09:45 shutdown.sh
-rwxr-xr-x 1 root root  3546 Nov 29 09:45 setclasspath.sh
-rwxr-xr-x 1 root root 16034 Nov 29 09:45 opencron.sh
-rw-r--r-- 1 root root  3130 Nov 29 09:45 monitor.sh
-rw-r--r-- 1 root root  1923 Nov 29 09:45 kill.sh
[root@dg12c1 opencron-agent]#
[root@dg12c1 opencron-agent]# sh bin/startup.sh  

      --------------------------------------------
    /                                              \
   /   ___  _ __   ___ _ __   ___ _ __ ___  _ __    \
  /   / _ \| '_ \ / _ \ '_ \ / __| '__/ _ \| '_ \    \
 /   | (_) | |_) |  __/ | | | (__| | | (_) | | | |    \
 \    \___/| .__/ \___|_| |_|\___|_|  \___/|_| |_|    /
  \        |_|                                       /
   \                                                /
    \       --opencron,Let's crontab easy!         /
      --------------------------------------------

Using OPENCRON_BASE:   /usr/local/opencron/agent/opencron-agent
Using OPENCRON_HOME:   /usr/local/opencron/agent/opencron-agent
Using OPENCRON_TMPDIR: /usr/local/opencron/agent/opencron-agent/temp
Using JRE_HOME:        /usr
Using CLASSPATH:       /usr/local/opencron/agent/opencron-agent/lib/opencron-agent-1.1.0-RELEASE.jar
Using OPENCRON_PID:    /var/run/opencron.pid
opencron port not input,will be used port:1577
opencron started.
[root@dg12c1 opencron-agent]# 

这个过程中的日志:

[root@dg12c1 opencron-agent]# tail -f logs/opencron.out 

log4j:WARN [/usr/local/opencron/agent/opencron-agent/logs/opencron.out] should be System.out or System.err.
log4j:WARN Using previously set target, System.out by default.
log4j:WARN [/usr/local/opencron/agent/opencron-agent/logs/opencron.out] should be System.out or System.err.
log4j:WARN Using previously set target, System.out by default.
log4j:WARN [/usr/local/opencron/agent/opencron-agent/logs/opencron.out] should be System.out or System.err.
log4j:WARN Using previously set target, System.out by default.
log4j:WARN [/usr/local/opencron/agent/opencron-agent/logs/opencron.out] should be System.out or System.err.
log4j:WARN Using previously set target, System.out by default.
[INFO ] 2017-11-29 10:35:53,596(0) --> [main] com.corundumstudio.socketio.SocketIOServer.startAsync(SocketIOServer.java:130): Session store / pubsub factory used: MemoryStoreFactory (local session store only)
2017-11-29 10:35:53,596  INFO (com.corundumstudio.socketio.SocketIOServer:130) - Session store / pubsub factory used: MemoryStoreFactory (local session store only)
[INFO ] 2017-11-29 10:35:53,951(355) --> [nioEventLoopGroup-2-1] com.corundumstudio.socketio.SocketIOServer$1.operationComplete(SocketIOServer.java:155): SocketIO server started at port: 17502
2017-11-29 10:35:53,951  INFO (com.corundumstudio.socketio.SocketIOServer:155) - SocketIO server started at port: 17502
[INFO ] 2017-11-29 10:35:53,967(371) --> [main] org.opencron.agent.Bootstrap.start(Bootstrap.java:215): [opencron]agent started @ port:1577,pid:24690
2017-11-29 10:35:53,967  INFO (org.opencron.agent.Bootstrap:215) - [opencron]agent started @ port:1577,pid:24690

查看端口与进程:

[root@dg12c1 opencron-agent]# ps -ef | grep opencron
root     24370 24166  0 10:34 pts/2    00:00:00 tail -f logs/opencron.out
root     24690     1  2 10:35 pts/1    00:00:02 /usr/bin/java -classpath /usr/local/opencron/agent/opencron-agent/lib/opencron-agent-1.1.0-RELEASE.jar -Dopencron.home=/usr/local/opencron/agent/opencron-agent -Dopencron.pid=/var/run/opencron.pid -Djava.io.tmpdir=/usr/local/opencron/agent/opencron-agent/temp -Dopencron.port=1577 -Dopencron.server= -Dopencron.regkey= -Dopencron.password= org.opencron.agent.Bootstrap start
root     25061 22450  0 10:37 pts/1    00:00:00 grep --color=auto opencron
[root@dg12c1 opencron-agent]#
[root@dg12c1 opencron-agent]# netstat -tupln | grep 17502
tcp6       0      0 :::17502                :::*                    LISTEN      24690/java
[root@dg12c1 opencron-agent]# 

Agent的默认口令:opencron。

停止: bin/shutdown.sh

一:部署Server:

Way – 1:Jetty

启动Jetty容器:

在源码目录下执行:server.sh

[root@dg12c2 opencron]# pwd
/software/git_data/opencron
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# ls -ltr
total 944
-rwxr-xr-x 1 root root  11641 Nov 29 09:45 README.md
-rw-r--r-- 1 root root  11358 Nov 29 09:45 LICENSE.txt
-rw-r--r-- 1 root root    777 Nov 29 09:45 header.txt
-rw-r--r-- 1 root root   8304 Nov 29 09:45 checkstyle.xml
-rw-r--r-- 1 root root   4349 Nov 29 09:45 build.sh
-rw-r--r-- 1 root root   5346 Nov 29 09:45 server.sh
-rw-r--r-- 1 root root  23439 Nov 29 09:45 pom.xml
drwxr-xr-x 4 root root     81 Nov 29 09:46 build
drwxr-xr-x 4 root root     46 Nov 29 09:48 opencron-common
drwxr-xr-x 4 root root     66 Nov 29 09:51 opencron-agent
drwxr-xr-x 4 root root     46 Nov 29 09:55 opencron-server
-rw------- 1 root root 881323 Nov 29 09:58 nohup.out
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# sh server.sh

      --------------------------------------------
    /                                              \
   /   ___  _ __   ___ _ __   ___ _ __ ___  _ __    \
  /   / _ \| '_ \ / _ \ '_ \ / __| '__/ _ \| '_ \    \
 /   | (_) | |_) |  __/ | | | (__| | | (_) | | | |    \
 \    \___/| .__/ \___|_| |_|\___|_|  \___/|_| |_|    /
  \        |_|                                       /
   \                                                /
    \       --opencron,Let's crontab easy!         /
      --------------------------------------------

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# export JAVA_HOME=/usr/java/jdk1.8.0_152
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# sh server.sh

      --------------------------------------------
    /                                              \
   /   ___  _ __   ___ _ __   ___ _ __ ___  _ __    \
  /   / _ \| '_ \ / _ \ '_ \ / __| '__/ _ \| '_ \    \
 /   | (_) | |_) |  __/ | | | (__| | | (_) | | | |    \
 \    \___/| .__/ \___|_| |_|\___|_|  \___/|_| |_|    /
  \        |_|                                       /
   \                                                /
    \       --opencron,Let's crontab easy!         /
      --------------------------------------------

[opencron] [opencron] server Starting....
[opencron] [opencron] please see log for more detail: /software/git_data/opencron/opencron-server/logs/opencron.out
[root@dg12c2 opencron]# 

在我的这个环境里,开始的时候,我启动了TOMCAT,这里,在运行JETTY之前,将前面的TOMCAT要先关掉。
因为它们的端口都是8080,否则,会在启动的时候有问题。

日志:

[root@dg12c2 opencron]# tail -f /software/git_data/opencron/opencron-server/logs/opencron.out
Caused by: java.sql.SQLException: Access denied for user 'root'@'dg12c2' (using password: YES)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1078)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:927)
        at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1709)
        at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1252)
        at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2486)
        at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2327)
        ... 15 more

2017-11-29 11:03:32 [INFO]-[org.opencron.server.bootstrap.Startup] [opencron]Server At default port 8080 Starting...
2017-11-29 11:03:32 [INFO]-[org.eclipse.jetty.util.log] Logging initialized @629ms to org.eclipse.jetty.util.log.Slf4jLog
2017-11-29 11:03:32 [INFO]-[org.eclipse.jetty.server.Server] jetty-9.4.7.v20170914
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [XMLSchema.dtd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [datatypes.dtd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [xml.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [web-app_2_2.dtd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [web-app_2_3.dtd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [j2ee_web_services_1_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [j2ee_web_services_client_1_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [web-app_2_4.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [j2ee_1_4.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [web-app_2_5.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [javaee_5.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [javaee_web_services_1_2.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [javaee_web_services_client_1_2.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [web-app_3_0.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [web-fragment_3_0.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [web-common_3_0.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [javaee_6.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [javaee_web_services_1_3.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [javaee_web_services_client_1_3.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [web-app_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [web-fragment_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [web-common_3_1.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [javaee_7.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [javaee_web_services_1_4.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.
2017-11-29 11:03:34 [WARN]-[org.apache.tomcat.util.descriptor.DigesterFactory] The XML schema [javaee_web_services_client_1_4.xsd] could not be found. This is very likely to break XML validation if XML validation is enabled.

2017-11-29 11:03:36 [INFO]-[org.eclipse.jetty.server.session] DefaultSessionIdManager workerName=node0
2017-11-29 11:03:36 [INFO]-[org.eclipse.jetty.server.session] No SessionScavenger set, using defaults
2017-11-29 11:03:36 [INFO]-[org.eclipse.jetty.server.session] Scavenging every 600000ms
2017-11-29 11:03:37 [INFO]-[org.eclipse.jetty.server.handler.ContextHandler.ROOT] Initializing Spring root WebApplicationContext
2017-11-29 11:03:37 [INFO]-[org.springframework.web.context.ContextLoader] Root WebApplicationContext: initialization started
2017-11-29 11:03:38 [INFO]-[org.springframework.web.context.support.XmlWebApplicationContext] Refreshing Root WebApplicationContext: startup date [Wed Nov 29 11:03:38 CST 2017]; root of context hierarchy
2017-11-29 11:03:40 [INFO]-[org.springframework.beans.factory.xml.XmlBeanDefinitionReader] Loading XML bean definitions from URL [file:/software/git_data/opencron/opencron-server/target/opencron-server-1.1.0-RELEASE/WEB-INF/classes/opencron.xml]
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/view.htm]}" onto public java.lang.String org.opencron.server.controller.AgentController.queryAllAgent(javax.servlet.http.HttpSession,org.springframework.ui.Model,org.opencron.server.tag.PageBean)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/refresh.htm]}" onto public java.lang.String org.opencron.server.controller.AgentController.refreshAgent(javax.servlet.http.HttpSession,org.opencron.server.tag.PageBean)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/checkhost.do],methods=[POST]}" onto public boolean org.opencron.server.controller.AgentController.checkhost(java.lang.Long,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/add.htm]}" onto public java.lang.String org.opencron.server.controller.AgentController.addPage(org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/autoreg.do],methods=[POST]}" onto public synchronized void org.opencron.server.controller.AgentController.autoReg(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,org.opencron.server.domain.Agent,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/edit.do],methods=[POST]}" onto public void org.opencron.server.controller.AgentController.edit(org.opencron.server.domain.Agent)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/pwd.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.AgentController.pwd(java.lang.Boolean,java.lang.Long,java.lang.String,java.lang.String,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/detail/{id}.htm]}" onto public java.lang.String org.opencron.server.controller.AgentController.showDetail(org.springframework.ui.Model,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/getConnAgents.do],methods=[POST]}" onto public java.util.List<org.opencron.server.domain.Agent> org.opencron.server.controller.AgentController.getConnAgents()
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/add.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.AgentController.add(javax.servlet.http.HttpSession,org.opencron.server.domain.Agent)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/get.do],methods=[POST]}" onto public void org.opencron.server.controller.AgentController.get(javax.servlet.http.HttpServletResponse,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/checkname.do],methods=[POST]}" onto public boolean org.opencron.server.controller.AgentController.checkName(java.lang.Long,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/checkdel.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.AgentController.checkDelete(java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/delete.do],methods=[POST]}" onto public void org.opencron.server.controller.AgentController.delete(java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/agent/path.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.AgentController.getPath(java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/config/edit.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.ConfigController.edit(javax.servlet.http.HttpSession,org.opencron.server.domain.Config)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/config/view.htm]}" onto public java.lang.String org.opencron.server.controller.ConfigController.settings(org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/config/edit.htm]}" onto public java.lang.String org.opencron.server.controller.ConfigController.editPage(org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/config/clear.do],methods=[POST]}" onto public boolean org.opencron.server.controller.ConfigController.clearRecord(java.lang.String,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/config/skin.do],methods=[POST]}" onto public boolean org.opencron.server.controller.ConfigController.skin(java.lang.String,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpSession)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/progress.do],methods=[POST]}" onto public org.opencron.server.vo.ChartVo org.opencron.server.controller.DashboardController.progress(javax.servlet.http.HttpSession)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/notice/detail/{logId}.htm]}" onto public java.lang.String org.opencron.server.controller.DashboardController.detail(org.springframework.ui.Model,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/login.do],methods=[POST]}" onto public void org.opencron.server.controller.DashboardController.login(javax.servlet.http.HttpSession,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpSession,java.lang.String,java.lang.String) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/logout.htm]}" onto public java.lang.String org.opencron.server.controller.DashboardController.logout(javax.servlet.http.HttpSession) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/record.do]}" onto public java.util.List<org.opencron.server.vo.ChartVo> org.opencron.server.controller.DashboardController.record(javax.servlet.http.HttpSession,java.lang.String,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/headpic/upload.do],methods=[POST]}" onto public void org.opencron.server.controller.DashboardController.upload(org.springframework.web.multipart.MultipartFile,java.lang.Long,java.lang.String,javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpSession,javax.servlet.http.HttpServletResponse) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/notice/uncount.do],methods=[POST]}" onto public java.lang.Long org.opencron.server.controller.DashboardController.uncount(javax.servlet.http.HttpSession)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/notice/unread.htm]}" onto public java.lang.String org.opencron.server.controller.DashboardController.nuread(javax.servlet.http.HttpSession,org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/dashboard.htm]}" onto public java.lang.String org.opencron.server.controller.DashboardController.dashboard(javax.servlet.http.HttpSession,org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[]}" onto public java.lang.String org.opencron.server.controller.DashboardController.index()
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/notice/view.htm]}" onto public java.lang.String org.opencron.server.controller.DashboardController.log(javax.servlet.http.HttpSession,org.springframework.ui.Model,org.opencron.server.tag.PageBean,java.lang.Long,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/monitor.do],methods=[POST]}" onto public java.util.Map<java.lang.String, java.io.Serializable> org.opencron.server.controller.DashboardController.port(java.lang.Long) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/group/view.htm]}" onto public java.lang.String org.opencron.server.controller.GroupController.view(org.opencron.server.tag.PageBean)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/group/edit/{groupId}.htm]}" onto public java.lang.String org.opencron.server.controller.GroupController.edit(java.lang.Long,org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/group/checkname.do],methods=[POST]}" onto public boolean org.opencron.server.controller.GroupController.checkname(java.lang.Long,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/group/add.htm]}" onto public java.lang.String org.opencron.server.controller.GroupController.add(org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/group/save.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.GroupController.save(javax.servlet.http.HttpSession,org.opencron.server.domain.Group,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/view.htm]}" onto public java.lang.String org.opencron.server.controller.JobController.view(javax.servlet.http.HttpSession,javax.servlet.http.HttpServletRequest,org.opencron.server.tag.PageBean,org.opencron.server.vo.JobVo,org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/edit.do],methods=[POST]}" onto public boolean org.opencron.server.controller.JobController.edit(javax.servlet.http.HttpSession,org.opencron.server.domain.Job) throws org.quartz.SchedulerException
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/detail/{id}.htm]}" onto public java.lang.String org.opencron.server.controller.JobController.showDetail(javax.servlet.http.HttpSession,org.springframework.ui.Model,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/add.htm]}" onto public java.lang.String org.opencron.server.controller.JobController.addpage(javax.servlet.http.HttpSession,org.springframework.ui.Model,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/editsingle.do]}" onto public void org.opencron.server.controller.JobController.editSingleJob(javax.servlet.http.HttpSession,javax.servlet.http.HttpServletResponse,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/editflow.htm]}" onto public java.lang.String org.opencron.server.controller.JobController.editFlowJob(javax.servlet.http.HttpSession,org.springframework.ui.Model,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/editcmd.do],methods=[POST]}" onto public boolean org.opencron.server.controller.JobController.editCmd(javax.servlet.http.HttpSession,java.lang.Long,java.lang.String) throws org.quartz.SchedulerException
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/canrun.do],methods=[POST]}" onto public boolean org.opencron.server.controller.JobController.canRun(java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/execute.do],methods=[POST]}" onto public boolean org.opencron.server.controller.JobController.remoteExecute(javax.servlet.http.HttpSession,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/goexec.htm]}" onto public java.lang.String org.opencron.server.controller.JobController.goExec(javax.servlet.http.HttpSession,org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/batchexec.do],methods=[POST]}" onto public boolean org.opencron.server.controller.JobController.batchExec(javax.servlet.http.HttpSession,java.lang.String,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/checkname.do],methods=[POST]}" onto public boolean org.opencron.server.controller.JobController.checkName(java.lang.Long,java.lang.Long,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/checkdel.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.JobController.checkDelete(java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/delete.do],methods=[POST]}" onto public boolean org.opencron.server.controller.JobController.delete(java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/job/save.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.JobController.save(javax.servlet.http.HttpSession,org.opencron.server.domain.Job,javax.servlet.http.HttpServletRequest) throws org.quartz.SchedulerException
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/record/refresh.htm]}" onto public java.lang.String org.opencron.server.controller.RecordController.refresh(javax.servlet.http.HttpSession,org.opencron.server.tag.PageBean,org.opencron.server.vo.RecordVo,java.lang.String,org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/record/detail/{id}.htm]}" onto public java.lang.String org.opencron.server.controller.RecordController.showDetail(org.springframework.ui.Model,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/record/done.htm]}" onto public java.lang.String org.opencron.server.controller.RecordController.queryDone(javax.servlet.http.HttpSession,org.opencron.server.tag.PageBean,org.opencron.server.vo.RecordVo,java.lang.String,org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/record/running.htm]}" onto public java.lang.String org.opencron.server.controller.RecordController.queryRunning(javax.servlet.http.HttpSession,org.opencron.server.tag.PageBean,org.opencron.server.vo.RecordVo,java.lang.String,org.springframework.ui.Model,java.lang.Boolean)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/record/kill.do],methods=[POST]}" onto public boolean org.opencron.server.controller.RecordController.kill(javax.servlet.http.HttpSession,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/detail.do],methods=[POST]}" onto public org.opencron.server.domain.Terminal org.opencron.server.controller.TerminalController.detail(org.opencron.server.domain.Terminal) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/view.htm]}" onto public java.lang.String org.opencron.server.controller.TerminalController.view(javax.servlet.http.HttpSession,org.opencron.server.tag.PageBean,org.springframework.ui.Model) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/upload.do],methods=[POST]}" onto public void org.opencron.server.controller.TerminalController.upload(javax.servlet.http.HttpSession,javax.servlet.http.HttpServletResponse,java.lang.String,org.springframework.web.multipart.MultipartFile[],java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/sendAll.do],methods=[POST]}" onto public boolean org.opencron.server.controller.TerminalController.sendAll(java.lang.String,java.lang.String) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/theme.do],methods=[POST]}" onto public void org.opencron.server.controller.TerminalController.theme(java.lang.String,java.lang.String) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/ssh.do],methods=[POST]}" onto public java.util.Map<java.lang.String, java.lang.String> org.opencron.server.controller.TerminalController.ssh(javax.servlet.http.HttpSession,javax.servlet.http.HttpServletResponse,org.opencron.server.domain.Terminal) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/ssh2.htm]}" onto public java.lang.String org.opencron.server.controller.TerminalController.ssh2(javax.servlet.http.HttpSession,org.opencron.server.domain.Terminal) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/reopen.htm]}" onto public java.lang.String org.opencron.server.controller.TerminalController.reopen(javax.servlet.http.HttpSession,java.lang.String) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/delete.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.TerminalController.delete(javax.servlet.http.HttpSession,org.opencron.server.domain.Terminal) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/save.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.TerminalController.save(javax.servlet.http.HttpSession,org.opencron.server.domain.Terminal) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/exists.do],methods=[POST]}" onto public boolean org.opencron.server.controller.TerminalController.exists(javax.servlet.http.HttpSession,org.opencron.server.domain.Terminal) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/resize.do],methods=[POST]}" onto public boolean org.opencron.server.controller.TerminalController.resize(java.lang.String,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/terminal/open.htm]}" onto public java.lang.String org.opencron.server.controller.TerminalController.open(javax.servlet.http.HttpServletRequest,java.lang.String,java.lang.Long) throws java.lang.Exception
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/user/detail/{userId}.htm]}" onto public java.lang.String org.opencron.server.controller.UserController.detail(java.lang.Long,org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/user/edit.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.UserController.edit(javax.servlet.http.HttpSession,org.opencron.server.domain.User) throws org.quartz.SchedulerException
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/user/pwd.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.UserController.pwd(java.lang.Long,java.lang.String,java.lang.String,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/user/edit/{id}.htm]}" onto public java.lang.String org.opencron.server.controller.UserController.editPage(javax.servlet.http.HttpSession,org.springframework.ui.Model,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/user/view.htm]}" onto public java.lang.String org.opencron.server.controller.UserController.queryUser(org.opencron.server.tag.PageBean)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/user/add.htm]}" onto public java.lang.String org.opencron.server.controller.UserController.add(org.springframework.ui.Model)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/user/add.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.UserController.add(javax.servlet.http.HttpSession,org.opencron.server.domain.User)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/user/get.do],methods=[POST]}" onto public void org.opencron.server.controller.UserController.get(javax.servlet.http.HttpServletResponse,java.lang.Long)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/user/checkname.do],methods=[POST]}" onto public boolean org.opencron.server.controller.UserController.checkName(java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/verify/exp.do],methods=[POST]}" onto public boolean org.opencron.server.controller.VerifyController.validateCronExp(java.lang.Integer,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/verify/ping.do],methods=[POST]}" onto public boolean org.opencron.server.controller.VerifyController.validatePing(int,java.lang.Long,java.lang.String,java.lang.Integer,java.lang.String)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping] Mapped "{[/verify/guid.do],methods=[POST]}" onto public java.lang.String org.opencron.server.controller.VerifyController.getGuid(int,java.lang.Long,java.lang.String,java.lang.Integer,java.lang.String,javax.servlet.http.HttpServletResponse)
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter] Looking for @ControllerAdvice: Root WebApplicationContext: startup date [Wed Nov 29 11:03:38 CST 2017]; root of context hierarchy
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter] Looking for @ControllerAdvice: Root WebApplicationContext: startup date [Wed Nov 29 11:03:38 CST 2017]; root of context hierarchy
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] Mapped URL path [/static/**] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0'
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] Mapped URL path [/favicon.ico] onto handler 'org.springframework.web.servlet.resource.ResourceHttpRequestHandler#1'
2017-11-29 11:03:46 [INFO]-[org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0'
2017-11-29 11:03:52 [INFO]-[com.alibaba.druid.pool.DruidDataSource] {dataSource-1} inited
2017-11-29 11:03:57 [INFO]-[org.hibernate.annotations.common.Version] HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
2017-11-29 11:03:57 [INFO]-[org.hibernate.Version] HHH000412: Hibernate Core {4.3.11.Final}
2017-11-29 11:03:57 [INFO]-[org.hibernate.cfg.Environment] HHH000206: hibernate.properties not found
2017-11-29 11:03:57 [INFO]-[org.hibernate.cfg.Environment] HHH000021: Bytecode provider name : javassist
2017-11-29 11:04:00 [INFO]-[org.hibernate.dialect.Dialect] HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
2017-11-29 11:04:01 [INFO]-[org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] HHH000399: Using default transaction strategy (direct JDBC transactions)
2017-11-29 11:04:01 [INFO]-[org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] HHH000397: Using ASTQueryTranslatorFactory
2017-11-29 11:04:03 [INFO]-[org.hibernate.tool.hbm2ddl.SchemaUpdate] HHH000228: Running hbm2ddl schema update
2017-11-29 11:04:03 [INFO]-[org.hibernate.tool.hbm2ddl.SchemaUpdate] HHH000102: Fetching database metadata
2017-11-29 11:04:03 [INFO]-[org.hibernate.tool.hbm2ddl.SchemaUpdate] HHH000396: Updating schema
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_AGENT
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_AGENT_GROUP
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_CONFIG
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_GROUP
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_JOB
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_LOG
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_RECORD
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_ROLE
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_TERMINAL
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_USER
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_AGENT
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_AGENT_GROUP
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_CONFIG
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_GROUP
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_JOB
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_LOG
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_RECORD
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_ROLE
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_TERMINAL
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_USER
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_AGENT
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_AGENT_GROUP
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_CONFIG
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_GROUP
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_JOB
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_LOG
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_RECORD
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_ROLE
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_TERMINAL
2017-11-29 11:04:03 [INFO]-[java.sql.DatabaseMetaData] HHH000262: Table not found: T_USER
2017-11-29 11:04:06 [INFO]-[org.hibernate.tool.hbm2ddl.SchemaUpdate] HHH000232: Schema update complete
2017-11-29 11:04:06 [INFO]-[org.springframework.web.socket.server.support.WebSocketHandlerMapping] Mapped URL path [/terminal.ws] onto handler of type [class org.springframework.web.socket.server.support.WebSocketHttpRequestHandler]
2017-11-29 11:04:06 [INFO]-[org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler] Initializing ExecutorService  'SockJsScheduler'
2017-11-29 11:04:06 [INFO]-[org.springframework.web.socket.server.support.WebSocketHandlerMapping] Mapped URL path [/terminal.js/**] onto handler of type [class org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler]
2017-11-29 11:04:07 [INFO]-[org.quartz.impl.StdSchedulerFactory] Using default implementation for ThreadExecutor
2017-11-29 11:04:07 [INFO]-[org.quartz.simpl.SimpleThreadPool] Job execution threads will use class loader of thread: main
2017-11-29 11:04:07 [INFO]-[org.quartz.core.SchedulerSignalerImpl] Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
2017-11-29 11:04:07 [INFO]-[org.quartz.core.QuartzScheduler] Quartz Scheduler v.2.3.0 created.
2017-11-29 11:04:07 [INFO]-[org.quartz.simpl.RAMJobStore] RAMJobStore initialized.
2017-11-29 11:04:07 [INFO]-[org.quartz.core.QuartzScheduler] Scheduler meta-data: Quartz Scheduler (v2.3.0) 'DefaultQuartzScheduler' with instanceId 'NON_CLUSTERED'
  Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
  NOT STARTED.
  Currently in standby mode.
  Number of jobs executed: 0
  Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 10 threads.
  Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.

2017-11-29 11:04:07 [INFO]-[org.quartz.impl.StdSchedulerFactory] Quartz scheduler 'DefaultQuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
2017-11-29 11:04:07 [INFO]-[org.quartz.impl.StdSchedulerFactory] Quartz scheduler version: 2.3.0
2017-11-29 11:04:07 [INFO]-[org.springframework.orm.hibernate4.HibernateTransactionManager] Using DataSource [{
        CreateTime:"2017-11-29 11:03:47",
        ActiveCount:0,
        PoolingCount:3,
        CreateCount:3,
        DestroyCount:0,
        CloseCount:2,
        ConnectCount:2,
        Connections:[
                {ID:1727171103, ConnectTime:"2017-11-29 11:03:50", UseCount:0, LastActiveTime:"2017-11-29 11:03:50"},
                {ID:1621202291, ConnectTime:"2017-11-29 11:03:50", UseCount:0, LastActiveTime:"2017-11-29 11:03:50"},
                {ID:1151370725, ConnectTime:"2017-11-29 11:03:50", UseCount:2, LastActiveTime:"2017-11-29 11:04:06"}
        ]
}

[
        {
        ID:1727171103,
        poolStatements:[
                ]
        },
        {
        ID:1621202291,
        poolStatements:[
                ]
        },
        {
        ID:1151370725,
        poolStatements:[
                ]
        }
]] of Hibernate SessionFactory for HibernateTransactionManager
2017-11-29 11:04:08 [INFO]-[org.opencron.server.job.OpencronMonitor] [opencron]:checking Agent connection...
2017-11-29 11:04:08 [INFO]-[org.opencron.server.service.SchedulerService] [opencron] init quartzJob...
2017-11-29 11:04:08 [INFO]-[org.quartz.core.QuartzScheduler] Scheduler DefaultQuartzScheduler_$_NON_CLUSTERED started.
2017-11-29 11:04:08 [INFO]-[org.springframework.context.support.DefaultLifecycleProcessor] Starting beans in phase 2147483647
2017-11-29 11:04:08 [INFO]-[org.springframework.web.context.ContextLoader] Root WebApplicationContext: initialization completed in 31733 ms
2017-11-29 11:04:09 [INFO]-[org.eclipse.jetty.server.handler.ContextHandler.ROOT] Initializing Spring FrameworkServlet 'springServlet'
2017-11-29 11:04:09 [INFO]-[org.springframework.web.servlet.DispatcherServlet] FrameworkServlet 'springServlet': initialization started
2017-11-29 11:04:09 [INFO]-[org.springframework.web.context.support.XmlWebApplicationContext] Refreshing WebApplicationContext for namespace 'springServlet-servlet': startup date [Wed Nov 29 11:04:09 CST 2017]; parent: Root WebApplicationContext
2017-11-29 11:04:09 [INFO]-[org.springframework.web.servlet.DispatcherServlet] FrameworkServlet 'springServlet': initialization completed in 77 ms
2017-11-29 11:04:09 [INFO]-[org.eclipse.jetty.server.handler.ContextHandler] Started o.e.j.w.WebAppContext@bf75b5c{/,file:///tmp/jetty-0.0.0.0-8080-opencron-server.war-_-any-8481665586971318489.dir/webapp/,AVAILABLE}{./opencron-server/target/opencron-server.war}
2017-11-29 11:04:09 [INFO]-[org.eclipse.jetty.server.AbstractConnector] Started ServerConnector@41ef1ea2{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2017-11-29 11:04:09 [INFO]-[org.eclipse.jetty.server.Server] Started @37720ms

启动后,查看一下端口情况:

[root@dg12c2 opencron]# netstat -tupln | grep 8080
tcp6       0      0 :::8080                 :::*                    LISTEN      29777/java
[root@dg12c2 opencron]# 

WEB访问:http://192.168.8.30:8080/

 
opencron
 

默认口令:opencron / opencron

第一次登录,会需要修改默认口令:

 
opencron
 

登录后:

opencron
 

Way – 2:Tomcat – 部署WAR包

再看看通过TOMCAT的方式。

确认没有进程占用8080

[root@dg12c2 ~]# netstat -tupln | grep 8080
[root@dg12c2 ~]# 

OPENCRON的WAR包:

[root@dg12c2 ~]# cd /software/git_data/opencron/build/
[root@dg12c2 build]# ls -ltr
total 8536
-rw-r--r-- 1 root root 8738691 Oct 25 05:35 apache-maven-3.5.2-bin.tar.gz
drwxr-xr-x 6 root root      99 Nov 29 09:46 apache-maven-3.5.2
drwxr-xr-x 2 root root      76 Nov 29 09:58 dist
[root@dg12c2 build]#
[root@dg12c2 build]# cd dist/
[root@dg12c2 dist]# ls -ltr
total 49832
-rw-r--r-- 1 root root 11092786 Nov 29 09:58 opencron-agent-1.1.0-RELEASE.tar.gz
-rw-r--r-- 1 root root 39928144 Nov 29 09:58 opencron-server.war
[root@dg12c2 dist]#
[root@dg12c2 dist]# 

清空当前TOMCAT的webapps:

[root@dg12c2 webapps]# pwd
/usr/local/tomcat/apache-tomcat-9.0.1/webapps
[root@dg12c2 webapps]#
[root@dg12c2 webapps]# ls -ltr
total 4
drwxr-xr-x  3 root root  283 Sep 27 18:32 ROOT
drwxr-xr-x  5 root root  103 Sep 27 18:32 manager
drwxr-xr-x  5 root root   87 Sep 27 18:32 host-manager
drwxr-xr-x  6 root root   83 Sep 27 18:32 examples
drwxr-xr-x 14 root root 4096 Sep 27 18:32 docs
[root@dg12c2 webapps]#
[root@dg12c2 webapps]# rm -rf *
[root@dg12c2 webapps]#
[root@dg12c2 webapps]# ls -ltr
total 0
[root@dg12c2 webapps]#
[root@dg12c2 webapps]# mkdir ROOT
[root@dg12c2 webapps]#
[root@dg12c2 webapps]# ls -ltr ROOT/
total 0
[root@dg12c2 webapps]#
[root@dg12c2 webapps]# 

将WAR移动到刚刚新建的ROOT中:

[root@dg12c2 dist]# cp opencron-server.war /usr/local/tomcat/apache-tomcat-9.0.1/webapps/ROOT
[root@dg12c2 dist]# 

使用jar解压WAR包,解压之后一定要删除war包:

[root@dg12c2 ROOT]# pwd
/usr/local/tomcat/apache-tomcat-9.0.1/webapps/ROOT
[root@dg12c2 ROOT]#
[root@dg12c2 ROOT]# ls -ltr
total 38996
-rw-r--r-- 1 root root 39928144 Nov 29 11:27 opencron-server.war
[root@dg12c2 ROOT]#
[root@dg12c2 ROOT]# jar -xvf opencron-server.war 

(... ... 过多的输出)
 inflated: static/js/sweetalert.min.js
 inflated: static/js/testdevice.js
 inflated: static/js/toggler.min.js
 inflated: static/js/xterm/addons/attach/attach.js
 inflated: static/js/xterm/addons/fit/fit.js
 inflated: static/js/xterm/addons/fullscreen/fullscreen.css
 inflated: static/js/xterm/addons/fullscreen/fullscreen.js
 inflated: static/js/xterm/addons/linkify/linkify.js
 inflated: static/js/xterm/addons/terminado/terminado.js
 inflated: static/js/xterm/xterm.css
 inflated: static/js/xterm/xterm.js
 inflated: static/js/xterm/xterm.js.map
 inflated: META-INF/maven/org.opencron/opencron-server/pom.xml
 inflated: META-INF/maven/org.opencron/opencron-server/pom.properties
[root@dg12c2 ROOT]#
[root@dg12c2 ROOT]# ls -ltr
total 38996
drwxr-xr-x 6 root root       51 Nov 29 09:56 static
drwxr-xr-x 7 root root      109 Nov 29 09:56 WEB-INF
drwxr-xr-x 3 root root       38 Nov 29 09:56 META-INF
-rw-r--r-- 1 root root 39928144 Nov 29 11:27 opencron-server.war
[root@dg12c2 ROOT]#
[root@dg12c2 ROOT]# rm -rf opencron-server.war
[root@dg12c2 ROOT]#
[root@dg12c2 ROOT]# ls -ltr
total 0
drwxr-xr-x 6 root root  51 Nov 29 09:56 static
drwxr-xr-x 7 root root 109 Nov 29 09:56 WEB-INF
drwxr-xr-x 3 root root  38 Nov 29 09:56 META-INF
[root@dg12c2 ROOT]# 

修改数据库配置:

[root@dg12c2 ROOT]# pwd
/usr/local/tomcat/apache-tomcat-9.0.1/webapps/ROOT
[root@dg12c2 ROOT]#
[root@dg12c2 ROOT]# cd WEB-INF/classes/
[root@dg12c2 classes]#
[root@dg12c2 classes]# ls -ltr
total 20
-rw-r--r-- 1 root root 8741 Nov 29 09:45 opencron.xml
-rw-r--r-- 1 root root 1656 Nov 29 09:45 log4j.properties
-rw-r--r-- 1 root root 1042 Nov 29 09:46 config.properties
drwxr-xr-x 3 root root   22 Nov 29 09:56 org
[root@dg12c2 classes]#
[root@dg12c2 classes]# vi config.properties
[root@dg12c2 classes]# cat config.properties | head -n 5
jdbc.driver=com.mysql.jdbc.Driver
#这里的ip是mysql的IP地址:
jdbc.url=jdbc:mysql://10.158.1.97:3306/opencron?useUnicode=true&characterEncoding=utf8&useCursorFetch=true&autoReconnect=true&failOverReadOnly=false
#修改成要连接的mysql的用户名和密码
jdbc.username=root
jdbc.password=****

[root@dg12c2 classes]# 

然后,启动TOMCAT,就完成部署了。

agent端默认连接端口:1577

Way – 2:Tomcat – 配置虚拟主机

先清空TOMCAT的webapps,不要让上面的配置影响了这一部分的配置:

[root@dg12c2 ~]# ls -ltr /usr/local/tomcat/apache-tomcat-9.0.1/webapps/
total 0
[root@dg12c2 ~]# 

解压和配置修改的部分和上面一样,只不过这次的路径不同:

[root@dg12c2 ~]# mkdir /var/www/html/opencron -p
[root@dg12c2 ~]#
[root@dg12c2 ~]# cp /software/git_data/opencron/build/dist/opencron-server.war /var/www/html/opencron/
[root@dg12c2 ~]#
[root@dg12c2 ~]# cd /var/www/html/opencron/
[root@dg12c2 opencron]# ls -ltr
total 38996
-rw-r--r-- 1 root root 39928144 Nov 29 11:36 opencron-server.war
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# jar -xf opencron-server.war
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# ls -ltr
total 38996
drwxr-xr-x 6 root root       51 Nov 29 09:56 static
drwxr-xr-x 7 root root      109 Nov 29 09:56 WEB-INF
drwxr-xr-x 3 root root       38 Nov 29 09:56 META-INF
-rw-r--r-- 1 root root 39928144 Nov 29 11:36 opencron-server.war
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# rm -rf opencron-server.war
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# 

配置TOMCAT的配置文件:

[root@dg12c2 opencron]# vi /usr/local/tomcat/apache-tomcat-9.0.1/conf/server.xml
[root@dg12c2 opencron]# cat /usr/local/tomcat/apache-tomcat-9.0.1/conf/server.xml | tail -n 10
      </Host>

      <Host name="10.158.1.97" appBase="/var/www/html/opencron" unpackWARs="true" autoDeploy="false" xmlValidation="false" xmlNamespaceAware="false" URIEncoding="UTF-8">
        <Context path=" reloadable="true"/>

      </Host>

    </Engine>
  </Service>
</Server>
[root@dg12c2 opencron]#
[root@dg12c2 opencron]# 

然后启动TOMCAT:

[root@dg12c2 opencron]# /usr/local/tomcat/apache-tomcat-9.0.1/bin/startup.sh
Using CATALINA_BASE:   /usr/local/tomcat/apache-tomcat-9.0.1
Using CATALINA_HOME:   /usr/local/tomcat/apache-tomcat-9.0.1
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-9.0.1/temp
Using JRE_HOME:        /usr/java/jdk1.8.0_152
Using CLASSPATH:       /usr/local/tomcat/apache-tomcat-9.0.1/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-9.0.1/bin/tomcat-juli.jar
Tomcat started.
[root@dg12c2 opencron]# 

日志:
文件:/usr/local/tomcat/apache-tomcat-9.0.1/logs/catalina.2017-11-29.log

29-Nov-2017 11:49:10.996 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'xmlValidation' to 'false' did not find a matching property.
29-Nov-2017 11:49:11.000 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'xmlNamespaceAware' to 'false' did not find a matching property.
29-Nov-2017 11:49:11.000 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine/Host} Setting property 'URIEncoding' to 'UTF-8' did not find a matching property.
29-Nov-2017 11:49:11.033 WARNING [main] org.apache.catalina.core.StandardContext.setPath A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [/] does not meet these criteria and has been changed to []
29-Nov-2017 11:49:11.035 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ' did not find a matching property.
29-Nov-2017 11:49:11.049 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/9.0.1
29-Nov-2017 11:49:11.050 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Sep 27 2017 17:31:52 UTC
29-Nov-2017 11:49:11.050 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         9.0.1.0
29-Nov-2017 11:49:11.050 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
29-Nov-2017 11:49:11.050 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.10.0-514.el7.x86_64
29-Nov-2017 11:49:11.050 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
29-Nov-2017 11:49:11.050 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/java/jdk1.8.0_152/jre
29-Nov-2017 11:49:11.051 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_152-b16
29-Nov-2017 11:49:11.051 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
29-Nov-2017 11:49:11.051 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /usr/local/tomcat/apache-tomcat-9.0.1
29-Nov-2017 11:49:11.051 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /usr/local/tomcat/apache-tomcat-9.0.1
29-Nov-2017 11:49:11.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/apache-tomcat-9.0.1/conf/logging.properties
29-Nov-2017 11:49:11.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
29-Nov-2017 11:49:11.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
29-Nov-2017 11:49:11.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
29-Nov-2017 11:49:11.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat/apache-tomcat-9.0.1
29-Nov-2017 11:49:11.052 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat/apache-tomcat-9.0.1
29-Nov-2017 11:49:11.053 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/apache-tomcat-9.0.1/temp
29-Nov-2017 11:49:11.058 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
29-Nov-2017 11:49:11.245 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
29-Nov-2017 11:49:11.262 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
29-Nov-2017 11:49:11.274 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
29-Nov-2017 11:49:11.275 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
29-Nov-2017 11:49:11.276 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 848 ms
29-Nov-2017 11:49:11.315 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
29-Nov-2017 11:49:11.316 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.1
29-Nov-2017 11:49:15.303 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
29-Nov-2017 11:49:15.354 INFO [main] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
29-Nov-2017 11:49:15.510 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
29-Nov-2017 11:49:30.099 WARNING [main] org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [7,230] milliseconds.
29-Nov-2017 11:49:30.212 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Spring FrameworkServlet 'springServlet'
29-Nov-2017 11:49:30.323 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/var/www/html/opencron/static]
29-Nov-2017 11:49:30.344 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/var/www/html/opencron/static] has finished in [21] ms
29-Nov-2017 11:49:30.348 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
29-Nov-2017 11:49:30.372 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
29-Nov-2017 11:49:30.380 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 19103 ms

最后登录的样子和上面截图的一样的,这里就不重复说明了。

三:接管一个客户端:

添加一个执行器。

执行器管理:

opencron
 
 
opencron
 
 
opencron
 

执行器添加完成后,在目标端的日志中也可以看到痕迹:
文件:logs/opencron.out

[INFO ] 2017-11-29 11:52:30,818(4597222) --> [pool-2-thread-1] org.opencron.agent.AgentProcessor.ping(AgentProcessor.java:91): [opencron]:ping ip:10.158.1.97,port:60014
2017-11-29 11:52:30,818  INFO (org.opencron.agent.AgentProcessor:91) - [opencron]:ping ip:10.158.1.97,port:60014

接下来会在OPENCRON中添加一个任务。

添加前,先看看目标端上的CRONTAB的情况:

[root@dg12c1 ~]# crontab -l
no crontab for root
[root@dg12c1 ~]# 
 
opencron
 
 
opencron
 
 
opencron
 

按照上面这样的方式做调度会有这样的问题:

2017-11-29 12:09:38,342  INFO (org.opencron.agent.AgentProcessor:277) - [opencron]:execute result:Response(action:EXECUTE, result:null, exitCode:127, success:false, startTime:1511928578290, endTime:1511928578342, message: %Y-%m-%d: command not found
 %H:%M:%S: command not found
  >> /var/log/messages: No such file or directory
Broken pipe
)

OPENCRON并不知道/var/log/message在哪里。

因此作出以下调整:
在目标机本地创建SHELL:

[root@dg12c1 ~]# cat do_job.sh
/usr/bin/date "+|%Y-%m-%d|%H:%M:%S|" >> /var/log/messages
[root@dg12c1 ~]#
[root@dg12c1 ~]# /bin/bash do_job.sh
[root@dg12c1 ~]#
[root@dg12c1 ~]# 

并确定可以按照预期执行。

将上面OPENCRON中的定时任务的指令改为:/bin/bash do_job.sh

然后,就正常了:

 
opencron
 

正常的情况下,任务执行成功后,AGENT端的日志里也有所反应:

[INFO ] 2017-11-29 13:10:25,158(9271562) --> [nioEventLoopGroup-3-1] org.opencron.agent.AgentMonitor$1.onConnect(AgentMonitor.java:70): [opencron]:monitor connected:SessionId @ 1782b8ee-3387-405c-94db-afaca9578006,port @ 17502
2017-11-29 13:10:25,158  INFO (org.opencron.agent.AgentMonitor:70) - [opencron]:monitor connected:SessionId @ 1782b8ee-3387-405c-94db-afaca9578006,port @ 17502

OPENCRON面板中,也有状态输出:

 
opencron
 

看看目标机器:

[root@dg12c1 ~]# crontab -l
no crontab for root
[root@dg12c1 ~]#
[root@dg12c1 ~]# 

可以看到,OPENCRON,并没有在目标机器上创建CRONTAB。

===================================================================================================================================

安装步骤

opencron分为两个opencron-server端和opencron-agent端,opencron-server端即为一个web可视化的*管理调度平台,opencron-agent为要管理的任务的机器,每个要纳入*统一管理的机器都必须安装opencron-agent, opencron-agent在要管理的服务器中安装执行完后,可以直接在opencron-server添加当前的机器.

opencron-agent 安装步骤:

1·)下载源码:
> git clone https://github.com/wolfboys/opencron.git

2):进入源码目录并执行编译:
> cd opencron
> sh build.sh
编译完成的文件在build/dist下

3)部署agent,将opencron-agent-${version}.tar.gz包拷贝到要管理任务的目标服务器,解包,会看到以下目录
---bin/
|  startup.sh          #agent的启动脚本,调用的是opencron.sh来完成
|  shutdown.sh         #agent停止脚本,调用的是opencron.sh来完成
|  opencron.sh         #agent控制启动|停止的脚本
|  monitor.sh          #实时监控获取数据需要的脚本,由系统调度
|  kill.sh             #kill任务时需要的脚本,由系统调度
---conf/
| log4j.properties     #log4j配置文件
---lib/
| *.jar                #agent运行需要的jar文件
---temp/
| *.sh                 #用于存放项目生成的零时文件的目录
---logs
| opencron.out         #项目启动会产生的Log文件

> tar -xzvf opencron-agent-${version}.tar.gz
3)启动opencron-agent 进入opencron-agent/bin
> cd opencron-agent/bin
> sh startup.sh
这里可以接受两个参数,分别是服务启动的端口和密码,默认端口是:1577,默认密码:opencron
如要指定参数启动命令如下:
> sh startup.sh -P10001 -p123456
参数说明:
-P (大写的p)为agent启动的端口,选填,如果不输入默认启动端口是1577
-p (小写的p)为当前agent的连接密码,选填,如果不输入默认连接该机器的密码是opencron
更多详细的启动信息请查看logs/opencron.out

5)停止opencron-agent 进入opencron-agent/bin 执行:
> cd opencron-agent/bin
> sh shutdown.sh

opencron-server 部署步骤:

1):编译好项目源码,找到 build/dist/opencron-server.war

2):更改项目的mysql连接信息,mysql的配置在config.properties里,更改即可:
如:
--mysql
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://${you_mysql_host}:3306/opencron?useUnicode=true&characterEncoding=UTF-8
jdbc.username=${user}
jdbc.password=${password}

3)发布到tomcat或者其他的web服务器启动即可.第一次会自动创建表,默认初始用户名opencron,密码opencron,第一次登陆会提示修改密码.

4)tomcat发布项目步骤:
   tomcat部署有两种部署方式
   1):直接部署到webapps下:
      1:下载tomcat8或者以上版本(http://tomcat.apache.org)
      2:解压tomcat,删除webapps目录下的全部文件
        >  rm -rf ${tomcat_home}/webapps/*
      3:在webapps下新建ROOT文件夹
        >  mkdir ${tomcat_home}/webapps/ROOT
      4:将war解包到ROOT下并删除war文件(注意解包完毕一定要删除war包)
        >  mv server.war ${tomcat_home}/webapps/ROOT
        >  cd ${tomcat_home}/webapps/ROOT
        >  jar -xvf server.war
        >  rm -rf server.war
      5:更改jdbc配置信息
        > vi ${tomcat_home}/webapps/ROOT/WEB-INF/classes/config.properties
      6:完成启动
   2):通过配置server.xml外部指向
      1:将war包解压到指定的路径,如 /data/www/opencron,并删除war包
      2:更改jdbc配置文件
         vi /data/www/opencron/WEB-INF/classes/config.properties
      3:进入tomcat的conf中修改server.xml配置文件
         下面附上我的完整的server.xml配置:

         <?xml version='1.0' encoding='utf-8'?>
         <Server port=" shutdown="SHUTDOWN">
           <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
           <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
           <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
           <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
           <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

           <GlobalNamingResources>
             <Resource name="UserDatabase" auth="Container"
                       type="org.apache.catalina.UserDatabase"
                       description="User database that can be updated and saved"
                       factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
                       pathname="conf/tomcat-users.xml" />
           </GlobalNamingResources>

             <Service name="Catalina">

             <!--项目的访问端口-->
             <Connector port=" protocol="HTTP/1.1"
                         connectionTimeout="
                        maxThreads="
                         minSpareThreads="
                         maxSpareThreads="
                         minProcessors="
                         maxProcessors="
                        acceptCount="
                        enableLookups="false"
                        disableUploadTimeout="true"
                        compression="on"
                        compressionMinSize="
                        compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain"
                        redirectPort="
                        URIEncoding="UTF-8"/>
                 <Connector port=" />

                  <Engine name="Catalina" defaultHost="localhost">
                         <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
                         <Host name="localhost"
                                 appBase="/data/www/opencron"
                                 unpackWARs="true"
                                 autoDeploy="false"
                                 xmlValidation="false"
                                 xmlNamespaceAware="false"
                                 URIEncoding="UTF-8">

                         <Context path="/"
                                 docBase="/data/www/opencron"
                                 debug="
                                 reloadable="true"/>
                         </Host>

                 </Engine>
           </Service>

         </Server>

         配置里Host里的appBase和Context的docBase即为外部解压的项目的路径
         推荐第二种外部部署的方式

      启动tomcat,打开浏览器以$ip:$port的方式访问,如:  http://192.168.0.188:8080       

5):进入到opencron的管理端第一件要做的事情就是添加要管理的执行器.在菜单的第二栏点击"执行器管理"->添加执行器,执行器ip,
就是上面你部署的opencron-agent的机器ip,端口号是要连接的opencron-agent的启动端口,密码也是opencron-agent端的连接密码,
输入ip,端口和密码后点击"检查通信",如果成功则server和agnet端已经成功通信,server可以管理agent了,添加保持即可.
如果连接失败,先检查agent端启动是否成功,查看logs中的详情

注意事项:

1):如果自行编译项目的,有可能agent端的脚本执行失败,这时请更改agent/bin下所有的脚本的字符集
   a) vim *.sh
   b) :set ff=unix 保存退出即可

2):如果脚本字符编码已经是unix,还是启动失败,请尝试给启动脚本添加权限 chmod 777 bin/*

3):如果agent已经成功启动server还是连接不上,请检查agent端口是否开放(如很多云服务器得开放端口才能访问)

4):如果server端用nginx做反向代理,配置如下:

upstream opencron {
     server 127.0.0.1:8080;
}

server {
    listen 80;
    server_name www.opencron.org;
    root /data/www/opencron/;

    location / {
        proxy_pass        http://opencron;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        client_max_body_size  10m;
        client_body_buffer_size 1m;
        proxy_connect_timeout 300;
        proxy_send_timeout    300;
        proxy_read_timeout    300;
        proxy_buffer_size     4k;
        proxy_buffers    4   32k;
        proxy_busy_buffers_size 64k;
        proxy_temp_file_write_size  64k;
    }

    #这里必须这么配置,否则web终端无法使用
    location  ^~  /terminal.ws {
        proxy_pass http://opencron;
        proxy_redirect    off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }

}