@ -1,41 +0,0 @@
|
||||
#Maintin by jimmy |
||||
#Email: zhengge2012@gmail.com |
||||
FROM anapsix/alpine-java:8_jdk |
||||
WORKDIR /tmp |
||||
RUN wget http://archive.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz |
||||
RUN tar -zxvf apache-maven-3.6.1-bin.tar.gz && rm apache-maven-3.6.1-bin.tar.gz |
||||
RUN mv apache-maven-3.6.1 /usr/lib/mvn |
||||
RUN chown -R root:root /usr/lib/mvn |
||||
RUN ln -s /usr/lib/mvn/bin/mvn /usr/bin/mvn |
||||
RUN wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz |
||||
RUN tar -zxvf zookeeper-3.4.6.tar.gz |
||||
RUN mv zookeeper-3.4.6 /opt/zookeeper |
||||
RUN rm -rf zookeeper-3.4.6.tar.gz |
||||
RUN echo "export ZOOKEEPER_HOME=/opt/zookeeper" >>/etc/profile |
||||
RUN echo "export PATH=$PATH:$ZOOKEEPER_HOME/bin" >>/etc/profile |
||||
ADD conf/zoo.cfg /opt/zookeeper/conf/zoo.cfg |
||||
#RUN source /etc/profile |
||||
#RUN zkServer.sh start |
||||
RUN apk add --no-cache git npm nginx mariadb mariadb-client mariadb-server-utils pwgen |
||||
WORKDIR /opt |
||||
RUN git clone https://github.com/analysys/EasyScheduler.git |
||||
WORKDIR /opt/EasyScheduler |
||||
RUN mvn -U clean package assembly:assembly -Dmaven.test.skip=true |
||||
RUN mv /opt/EasyScheduler/target/escheduler-1.0.0-SNAPSHOT /opt/easyscheduler |
||||
WORKDIR /opt/EasyScheduler/escheduler-ui |
||||
RUN npm install |
||||
RUN npm audit fix |
||||
RUN npm run build |
||||
RUN mkdir -p /opt/escheduler/front/server |
||||
RUN cp -rfv dist/* /opt/escheduler/front/server |
||||
WORKDIR / |
||||
RUN rm -rf /opt/EasyScheduler |
||||
#configure mysql server https://github.com/yobasystems/alpine-mariadb/tree/master/alpine-mariadb-amd64 |
||||
ADD conf/run.sh /scripts/run.sh |
||||
RUN mkdir /docker-entrypoint-initdb.d && \ |
||||
mkdir /scripts/pre-exec.d && \ |
||||
mkdir /scripts/pre-init.d && \ |
||||
chmod -R 755 /scripts |
||||
RUN rm -rf /var/cache/apk/* |
||||
EXPOSE 8888 |
||||
ENTRYPOINT ["/scripts/run.sh"] |
@ -1,31 +0,0 @@
|
||||
server { |
||||
listen 8888;# 访问端口 |
||||
server_name localhost; |
||||
#charset koi8-r; |
||||
#access_log /var/log/nginx/host.access.log main; |
||||
location / { |
||||
root /opt/escheduler/front/server; # 静态文件目录 |
||||
index index.html index.html; |
||||
} |
||||
location /escheduler { |
||||
proxy_pass http://127.0.0.1:12345; # 接口地址 |
||||
proxy_set_header Host $host; |
||||
proxy_set_header X-Real-IP $remote_addr; |
||||
proxy_set_header x_real_ipP $remote_addr; |
||||
proxy_set_header remote_addr $remote_addr; |
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
||||
proxy_http_version 1.1; |
||||
proxy_connect_timeout 4s; |
||||
proxy_read_timeout 30s; |
||||
proxy_send_timeout 12s; |
||||
proxy_set_header Upgrade $http_upgrade; |
||||
proxy_set_header Connection "upgrade"; |
||||
} |
||||
#error_page 404 /404.html; |
||||
# redirect server error pages to the static page /50x.html |
||||
# |
||||
error_page 500 502 503 504 /50x.html; |
||||
location = /50x.html { |
||||
root /usr/share/nginx/html; |
||||
} |
||||
} |
@ -1,310 +0,0 @@
|
||||
#!/bin/sh |
||||
|
||||
workDir=`/opt/easyscheduler` |
||||
workDir=`cd ${workDir};pwd` |
||||
|
||||
#To be compatible with MacOS and Linux |
||||
txt="" |
||||
if [[ "$OSTYPE" == "darwin"* ]]; then |
||||
# Mac OSX |
||||
txt="''" |
||||
elif [[ "$OSTYPE" == "linux-gnu" ]]; then |
||||
# linux |
||||
txt="" |
||||
elif [[ "$OSTYPE" == "cygwin" ]]; then |
||||
# POSIX compatibility layer and Linux environment emulation for Windows |
||||
echo "Easy Scheduler not support Windows operating system" |
||||
exit 1 |
||||
elif [[ "$OSTYPE" == "msys" ]]; then |
||||
# Lightweight shell and GNU utilities compiled for Windows (part of MinGW) |
||||
echo "Easy Scheduler not support Windows operating system" |
||||
exit 1 |
||||
elif [[ "$OSTYPE" == "win32" ]]; then |
||||
echo "Easy Scheduler not support Windows operating system" |
||||
exit 1 |
||||
elif [[ "$OSTYPE" == "freebsd"* ]]; then |
||||
# ... |
||||
txt="" |
||||
else |
||||
# Unknown. |
||||
echo "Operating system unknown, please tell us(submit issue) for better service" |
||||
exit 1 |
||||
fi |
||||
|
||||
source ${workDir}/conf/config/run_config.conf |
||||
source ${workDir}/conf/config/install_config.conf |
||||
|
||||
# mysql配置 |
||||
# mysql 地址,端口 |
||||
mysqlHost="127.0.0.1:3306" |
||||
|
||||
# mysql 数据库名称 |
||||
mysqlDb="easyscheduler" |
||||
|
||||
# mysql 用户名 |
||||
mysqlUserName="easyscheduler" |
||||
|
||||
# mysql 密码 |
||||
mysqlPassword="easyschedulereasyscheduler" |
||||
|
||||
# conf/config/install_config.conf配置 |
||||
# 安装路径,不要当前路径(pwd)一样 |
||||
installPath="/opt/easyscheduler" |
||||
|
||||
# 部署用户 |
||||
deployUser="escheduler" |
||||
|
||||
# zk集群 |
||||
zkQuorum="192.168.xx.xx:2181,192.168.xx.xx:2181,192.168.xx.xx:2181" |
||||
|
||||
# 安装hosts |
||||
ips="ark0,ark1,ark2,ark3,ark4" |
||||
|
||||
# conf/config/run_config.conf配置 |
||||
# 运行Master的机器 |
||||
masters="ark0,ark1" |
||||
|
||||
# 运行Worker的机器 |
||||
workers="ark2,ark3,ark4" |
||||
|
||||
# 运行Alert的机器 |
||||
alertServer="ark3" |
||||
|
||||
# 运行Api的机器 |
||||
apiServers="ark1" |
||||
|
||||
# alert配置 |
||||
# 邮件协议 |
||||
mailProtocol="SMTP" |
||||
|
||||
# 邮件服务host |
||||
mailServerHost="smtp.exmail.qq.com" |
||||
|
||||
# 邮件服务端口 |
||||
mailServerPort="25" |
||||
|
||||
# 发送人 |
||||
mailSender="xxxxxxxxxx" |
||||
|
||||
# 发送人密码 |
||||
mailPassword="xxxxxxxxxx" |
||||
|
||||
# 下载Excel路径 |
||||
xlsFilePath="/tmp/xls" |
||||
|
||||
|
||||
# hadoop 配置 |
||||
# 是否启动hdfs,如果启动则为true,需要配置以下hadoop相关参数; |
||||
# 不启动设置为false,如果为false,以下配置不需要修改 |
||||
hdfsStartupSate="false" |
||||
|
||||
# namenode地址,支持HA,需要将core-site.xml和hdfs-site.xml放到conf目录下 |
||||
namenodeFs="hdfs://mycluster:8020" |
||||
|
||||
# resourcemanager HA配置,如果是单resourcemanager,这里为空即可 |
||||
yarnHaIps="192.168.xx.xx,192.168.xx.xx" |
||||
|
||||
# 如果是单 resourcemanager,只需要配置一个主机名称,如果是resourcemanager HA,则默认配置就好 |
||||
singleYarnIp="ark1" |
||||
|
||||
# hdfs根路径,根路径的owner必须是部署用户 |
||||
hdfsPath="/escheduler" |
||||
|
||||
# common 配置 |
||||
# 程序路径 |
||||
programPath="/tmp/escheduler" |
||||
|
||||
#下载路径 |
||||
downloadPath="/tmp/escheduler/download" |
||||
|
||||
# 任务执行路径 |
||||
execPath="/tmp/escheduler/exec" |
||||
|
||||
# SHELL环境变量路径 |
||||
shellEnvPath="$installPath/conf/env/.escheduler_env.sh" |
||||
|
||||
# Python换将变量路径 |
||||
pythonEnvPath="$installPath/conf/env/escheduler_env.py" |
||||
|
||||
# 资源文件的后缀 |
||||
resSuffixs="txt,log,sh,conf,cfg,py,java,sql,hql,xml" |
||||
|
||||
# 开发状态,如果是true,对于SHELL脚本可以在execPath目录下查看封装后的SHELL脚本,如果是false则执行完成直接删除 |
||||
devState="true" |
||||
|
||||
# zk 配置 |
||||
# zk根目录 |
||||
zkRoot="/escheduler" |
||||
|
||||
# 用来记录挂掉机器的zk目录 |
||||
zkDeadServers="/escheduler/dead-servers" |
||||
|
||||
# masters目录 |
||||
zkMasters="/escheduler/masters" |
||||
|
||||
# workers目录 |
||||
zkWorkers="/escheduler/workers" |
||||
|
||||
# zk master分布式锁 |
||||
mastersLock="/escheduler/lock/masters" |
||||
|
||||
# zk worker分布式锁 |
||||
workersLock="/escheduler/lock/workers" |
||||
|
||||
# zk master容错分布式锁 |
||||
mastersFailover="/escheduler/lock/failover/masters" |
||||
|
||||
# zk worker容错分布式锁 |
||||
workersFailover="/escheduler/lock/failover/masters" |
||||
|
||||
# zk session 超时 |
||||
zkSessionTimeout="300" |
||||
|
||||
# zk 连接超时 |
||||
zkConnectionTimeout="300" |
||||
|
||||
# zk 重试间隔 |
||||
zkRetrySleep="100" |
||||
|
||||
# zk重试最大次数 |
||||
zkRetryMaxtime="5" |
||||
|
||||
|
||||
# master 配置 |
||||
# master执行线程最大数,流程实例的最大并行度 |
||||
masterExecThreads="100" |
||||
|
||||
# master任务执行线程最大数,每一个流程实例的最大并行度 |
||||
masterExecTaskNum="20" |
||||
|
||||
# master心跳间隔 |
||||
masterHeartbeatInterval="10" |
||||
|
||||
# master任务提交重试次数 |
||||
masterTaskCommitRetryTimes="5" |
||||
|
||||
# master任务提交重试时间间隔 |
||||
masterTaskCommitInterval="100" |
||||
|
||||
# master最大cpu平均负载,用来判断master是否还有执行能力 |
||||
masterMaxCupLoadAvg="10" |
||||
|
||||
# master预留内存,用来判断master是否还有执行能力 |
||||
masterReservedMemory="1" |
||||
|
||||
|
||||
# worker 配置 |
||||
# worker执行线程 |
||||
workerExecThreads="100" |
||||
|
||||
# worker心跳间隔 |
||||
workerHeartbeatInterval="10" |
||||
|
||||
# worker一次抓取任务数 |
||||
workerFetchTaskNum="10" |
||||
|
||||
# worker最大cpu平均负载,用来判断master是否还有执行能力 |
||||
workerMaxCupLoadAvg="10" |
||||
|
||||
# worker预留内存,用来判断master是否还有执行能力 |
||||
workerReservedMemory="1" |
||||
|
||||
# api 配置 |
||||
# api 服务端口 |
||||
apiServerPort="12345" |
||||
|
||||
# api session 超时 |
||||
apiServerSessionTimeout="7200" |
||||
|
||||
# api 上下文路径 |
||||
apiServerContextPath="/escheduler/" |
||||
|
||||
# spring 最大文件大小 |
||||
springMaxFileSize="1024MB" |
||||
|
||||
# spring 最大请求文件大小 |
||||
springMaxRequestSize="1024MB" |
||||
|
||||
# api 最大post请求大小 |
||||
apiMaxHttpPostSize="5000000" |
||||
|
||||
# 1,替换文件 |
||||
echo "1,替换文件" |
||||
sed -i ${txt} "s#spring.datasource.url.*#spring.datasource.url=jdbc:mysql://${mysqlHost}/${mysqlDb}?characterEncoding=UTF-8#g" conf/dao/data_source.properties |
||||
sed -i ${txt} "s#spring.datasource.username.*#spring.datasource.username=${mysqlUserName}#g" conf/dao/data_source.properties |
||||
sed -i ${txt} "s#spring.datasource.password.*#spring.datasource.password=${mysqlPassword}#g" conf/dao/data_source.properties |
||||
|
||||
sed -i ${txt} "s#org.quartz.dataSource.myDs.URL.*#org.quartz.dataSource.myDs.URL=jdbc:mysql://${mysqlHost}/${mysqlDb}?characterEncoding=UTF-8#g" conf/quartz.properties |
||||
sed -i ${txt} "s#org.quartz.dataSource.myDs.user.*#org.quartz.dataSource.myDs.user=${mysqlUserName}#g" conf/quartz.properties |
||||
sed -i ${txt} "s#org.quartz.dataSource.myDs.password.*#org.quartz.dataSource.myDs.password=${mysqlPassword}#g" conf/quartz.properties |
||||
|
||||
|
||||
sed -i ${txt} "s#fs.defaultFS.*#fs.defaultFS=${namenodeFs}#g" conf/common/hadoop/hadoop.properties |
||||
sed -i ${txt} "s#yarn.resourcemanager.ha.rm.ids.*#yarn.resourcemanager.ha.rm.ids=${yarnHaIps}#g" conf/common/hadoop/hadoop.properties |
||||
sed -i ${txt} "s#yarn.application.status.address.*#yarn.application.status.address=http://${singleYarnIp}:8088/ws/v1/cluster/apps/%s#g" conf/common/hadoop/hadoop.properties |
||||
|
||||
sed -i ${txt} "s#data.basedir.path.*#data.basedir.path=${programPath}#g" conf/common/common.properties |
||||
sed -i ${txt} "s#data.download.basedir.path.*#data.download.basedir.path=${downloadPath}#g" conf/common/common.properties |
||||
sed -i ${txt} "s#process.exec.basepath.*#process.exec.basepath=${execPath}#g" conf/common/common.properties |
||||
sed -i ${txt} "s#data.store2hdfs.basepath.*#data.store2hdfs.basepath=${hdfsPath}#g" conf/common/common.properties |
||||
sed -i ${txt} "s#hdfs.startup.state.*#hdfs.startup.state=${hdfsStartupSate}#g" conf/common/common.properties |
||||
sed -i ${txt} "s#escheduler.env.path.*#escheduler.env.path=${shellEnvPath}#g" conf/common/common.properties |
||||
sed -i ${txt} "s#escheduler.env.py.*#escheduler.env.py=${pythonEnvPath}#g" conf/common/common.properties |
||||
sed -i ${txt} "s#resource.view.suffixs.*#resource.view.suffixs=${resSuffixs}#g" conf/common/common.properties |
||||
sed -i ${txt} "s#development.state.*#development.state=${devState}#g" conf/common/common.properties |
||||
|
||||
sed -i ${txt} "s#zookeeper.quorum.*#zookeeper.quorum=${zkQuorum}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.escheduler.root.*#zookeeper.escheduler.root=${zkRoot}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.escheduler.dead.servers.*#zookeeper.escheduler.dead.servers=${zkDeadServers}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.escheduler.masters.*#zookeeper.escheduler.masters=${zkMasters}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.escheduler.workers.*#zookeeper.escheduler.workers=${zkWorkers}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.escheduler.lock.masters.*#zookeeper.escheduler.lock.masters=${mastersLock}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.escheduler.lock.workers.*#zookeeper.escheduler.lock.workers=${workersLock}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.escheduler.lock.failover.masters.*#zookeeper.escheduler.lock.failover.masters=${mastersFailover}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.escheduler.lock.failover.workers.*#zookeeper.escheduler.lock.failover.workers=${workersFailover}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.session.timeout.*#zookeeper.session.timeout=${zkSessionTimeout}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.connection.timeout.*#zookeeper.connection.timeout=${zkConnectionTimeout}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.retry.sleep.*#zookeeper.retry.sleep=${zkRetrySleep}#g" conf/zookeeper.properties |
||||
sed -i ${txt} "s#zookeeper.retry.maxtime.*#zookeeper.retry.maxtime=${zkRetryMaxtime}#g" conf/zookeeper.properties |
||||
|
||||
sed -i ${txt} "s#master.exec.threads.*#master.exec.threads=${masterExecThreads}#g" conf/master.properties |
||||
sed -i ${txt} "s#master.exec.task.number.*#master.exec.task.number=${masterExecTaskNum}#g" conf/master.properties |
||||
sed -i ${txt} "s#master.heartbeat.interval.*#master.heartbeat.interval=${masterHeartbeatInterval}#g" conf/master.properties |
||||
sed -i ${txt} "s#master.task.commit.retryTimes.*#master.task.commit.retryTimes=${masterTaskCommitRetryTimes}#g" conf/master.properties |
||||
sed -i ${txt} "s#master.task.commit.interval.*#master.task.commit.interval=${masterTaskCommitInterval}#g" conf/master.properties |
||||
sed -i ${txt} "s#master.max.cpuload.avg.*#master.max.cpuload.avg=${masterMaxCupLoadAvg}#g" conf/master.properties |
||||
sed -i ${txt} "s#master.reserved.memory.*#master.reserved.memory=${masterReservedMemory}#g" conf/master.properties |
||||
|
||||
|
||||
sed -i ${txt} "s#worker.exec.threads.*#worker.exec.threads=${workerExecThreads}#g" conf/worker.properties |
||||
sed -i ${txt} "s#worker.heartbeat.interval.*#worker.heartbeat.interval=${workerHeartbeatInterval}#g" conf/worker.properties |
||||
sed -i ${txt} "s#worker.fetch.task.num.*#worker.fetch.task.num=${workerFetchTaskNum}#g" conf/worker.properties |
||||
sed -i ${txt} "s#worker.max.cpuload.avg.*#worker.max.cpuload.avg=${workerMaxCupLoadAvg}#g" conf/worker.properties |
||||
sed -i ${txt} "s#worker.reserved.memory.*#worker.reserved.memory=${workerReservedMemory}#g" conf/worker.properties |
||||
|
||||
|
||||
sed -i ${txt} "s#server.port.*#server.port=${apiServerPort}#g" conf/application.properties |
||||
sed -i ${txt} "s#server.session.timeout.*#server.session.timeout=${apiServerSessionTimeout}#g" conf/application.properties |
||||
sed -i ${txt} "s#server.context-path.*#server.context-path=${apiServerContextPath}#g" conf/application.properties |
||||
sed -i ${txt} "s#spring.http.multipart.max-file-size.*#spring.http.multipart.max-file-size=${springMaxFileSize}#g" conf/application.properties |
||||
sed -i ${txt} "s#spring.http.multipart.max-request-size.*#spring.http.multipart.max-request-size=${springMaxRequestSize}#g" conf/application.properties |
||||
sed -i ${txt} "s#server.max-http-post-size.*#server.max-http-post-size=${apiMaxHttpPostSize}#g" conf/application.properties |
||||
|
||||
|
||||
sed -i ${txt} "s#mail.protocol.*#mail.protocol=${mailProtocol}#g" conf/alert.properties |
||||
sed -i ${txt} "s#mail.server.host.*#mail.server.host=${mailServerHost}#g" conf/alert.properties |
||||
sed -i ${txt} "s#mail.server.port.*#mail.server.port=${mailServerPort}#g" conf/alert.properties |
||||
sed -i ${txt} "s#mail.sender.*#mail.sender=${mailSender}#g" conf/alert.properties |
||||
sed -i ${txt} "s#mail.passwd.*#mail.passwd=${mailPassword}#g" conf/alert.properties |
||||
sed -i ${txt} "s#xls.file.path.*#xls.file.path=${xlsFilePath}#g" conf/alert.properties |
||||
|
||||
|
||||
sed -i ${txt} "s#installPath.*#installPath=${installPath}#g" conf/config/install_config.conf |
||||
sed -i ${txt} "s#deployUser.*#deployUser=${deployUser}#g" conf/config/install_config.conf |
||||
sed -i ${txt} "s#ips.*#ips=${ips}#g" conf/config/install_config.conf |
||||
|
||||
|
||||
sed -i ${txt} "s#masters.*#masters=${masters}#g" conf/config/run_config.conf |
||||
sed -i ${txt} "s#workers.*#workers=${workers}#g" conf/config/run_config.conf |
||||
sed -i ${txt} "s#alertServer.*#alertServer=${alertServer}#g" conf/config/run_config.conf |
||||
sed -i ${txt} "s#apiServers.*#apiServers=${apiServers}#g" conf/config/run_config.conf |
@ -1,105 +0,0 @@
|
||||
#!/bin/sh |
||||
|
||||
# execute any pre-init scripts |
||||
for i in /scripts/pre-init.d/*sh |
||||
do |
||||
if [ -e "${i}" ]; then |
||||
echo "[i] pre-init.d - processing $i" |
||||
. "${i}" |
||||
fi |
||||
done |
||||
|
||||
if [ -d "/run/mysqld" ]; then |
||||
echo "[i] mysqld already present, skipping creation" |
||||
chown -R mysql:mysql /run/mysqld |
||||
else |
||||
echo "[i] mysqld not found, creating...." |
||||
mkdir -p /run/mysqld |
||||
chown -R mysql:mysql /run/mysqld |
||||
fi |
||||
|
||||
if [ -d /var/lib/mysql/mysql ]; then |
||||
echo "[i] MySQL directory already present, skipping creation" |
||||
chown -R mysql:mysql /var/lib/mysql |
||||
else |
||||
echo "[i] MySQL data directory not found, creating initial DBs" |
||||
|
||||
chown -R mysql:mysql /var/lib/mysql |
||||
|
||||
mysql_install_db --user=mysql --ldata=/var/lib/mysql > /dev/null |
||||
|
||||
if [ "$MYSQL_ROOT_PASSWORD" = "" ]; then |
||||
MYSQL_ROOT_PASSWORD=`pwgen 16 1` |
||||
echo "[i] MySQL root Password: $MYSQL_ROOT_PASSWORD" |
||||
fi |
||||
|
||||
MYSQL_DATABASE="easyscheduler" |
||||
MYSQL_USER="easyscheduler" |
||||
MYSQL_PASSWORD="easyschedulereasyscheduler" |
||||
|
||||
tfile=`mktemp` |
||||
if [ ! -f "$tfile" ]; then |
||||
return 1 |
||||
fi |
||||
|
||||
cat << EOF > $tfile |
||||
USE mysql; |
||||
FLUSH PRIVILEGES ; |
||||
GRANT ALL ON *.* TO 'root'@'%' identified by '$MYSQL_ROOT_PASSWORD' WITH GRANT OPTION ; |
||||
GRANT ALL ON *.* TO 'root'@'localhost' identified by '$MYSQL_ROOT_PASSWORD' WITH GRANT OPTION ; |
||||
SET PASSWORD FOR 'root'@'localhost'=PASSWORD('${MYSQL_ROOT_PASSWORD}') ; |
||||
DROP DATABASE IF EXISTS test ; |
||||
FLUSH PRIVILEGES ; |
||||
EOF |
||||
|
||||
if [ "$MYSQL_DATABASE" != "" ]; then |
||||
echo "[i] Creating database: $MYSQL_DATABASE" |
||||
echo "CREATE DATABASE IF NOT EXISTS \`$MYSQL_DATABASE\` CHARACTER SET utf8 COLLATE utf8_general_ci;" >> $tfile |
||||
|
||||
if [ "$MYSQL_USER" != "" ]; then |
||||
echo "[i] Creating user: $MYSQL_USER with password $MYSQL_PASSWORD" |
||||
echo "GRANT ALL ON \`$MYSQL_DATABASE\`.* to '$MYSQL_USER'@'%' IDENTIFIED BY '$MYSQL_PASSWORD';" >> $tfile |
||||
fi |
||||
fi |
||||
|
||||
/usr/bin/mysqld --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0 < $tfile |
||||
rm -f $tfile |
||||
|
||||
for f in /docker-entrypoint-initdb.d/*; do |
||||
case "$f" in |
||||
*.sql) echo "$0: running $f"; /usr/bin/mysqld --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0 < "$f"; echo ;; |
||||
*.sql.gz) echo "$0: running $f"; gunzip -c "$f" | /usr/bin/mysqld --user=mysql --bootstrap --verbose=0 --skip-name-resolve --skip-networking=0 < "$f"; echo ;; |
||||
*) echo "$0: ignoring or entrypoint initdb empty $f" ;; |
||||
esac |
||||
echo |
||||
done |
||||
|
||||
echo |
||||
echo 'MySQL init process done. Ready for start up.' |
||||
echo |
||||
|
||||
echo "exec /usr/bin/mysqld --user=mysql --console --skip-name-resolve --skip-networking=0" "$@" |
||||
fi |
||||
|
||||
# execute any pre-exec scripts |
||||
for i in /scripts/pre-exec.d/*sh |
||||
do |
||||
if [ -e "${i}" ]; then |
||||
echo "[i] pre-exec.d - processing $i" |
||||
. ${i} |
||||
fi |
||||
done |
||||
|
||||
mysql -ueasyscheduler -peasyschedulereasyscheduler --one-database easyscheduler -h127.0.0.1 < /opt/easyscheduler/sql/escheduler.sql |
||||
mysql -ueasyscheduler -peasyschedulereasyscheduler --one-database easyscheduler -h127.0.0.1 < /opt/easyscheduler/sql/quartz.sql |
||||
source /etc/profile |
||||
zkServer.sh start |
||||
cd /opt/easyscheduler |
||||
rm -rf /etc/nginx/conf.d/default.conf |
||||
sh ./bin/escheduler-daemon.sh start master-server |
||||
sh ./bin/escheduler-daemon.sh start worker-server |
||||
sh ./bin/escheduler-daemon.sh start api-server |
||||
sh ./bin/escheduler-daemon.sh start logger-server |
||||
sh ./bin/escheduler-daemon.sh start alert-server |
||||
nginx -c /etc/nginx/nginx.conf |
||||
exec /usr/bin/mysqld --user=mysql --console --skip-name-resolve --skip-networking=0 $@ |
@ -1,30 +0,0 @@
|
||||
# The number of milliseconds of each tick |
||||
tickTime=2000 |
||||
# The number of ticks that the initial |
||||
# synchronization phase can take |
||||
initLimit=10 |
||||
# The number of ticks that can pass between |
||||
# sending a request and getting an acknowledgement |
||||
syncLimit=5 |
||||
# the directory where the snapshot is stored. |
||||
# do not use /tmp for storage, /tmp here is just |
||||
# example sakes. |
||||
dataDir=/tmp/zookeeper |
||||
# the port at which the clients will connect |
||||
clientPort=2181 |
||||
# the maximum number of client connections. |
||||
# increase this if you need to handle more clients |
||||
#maxClientCnxns=60 |
||||
# |
||||
# Be sure to read the maintenance section of the |
||||
# administrator guide before turning on autopurge. |
||||
# |
||||
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance |
||||
# |
||||
# The number of snapshots to retain in dataDir |
||||
#autopurge.snapRetainCount=3 |
||||
# Purge task interval in hours |
||||
# Set to "0" to disable auto purge feature |
||||
#autopurge.purgeInterval=1 |
||||
dataDir=/opt/zookeeper/data |
||||
dataLogDir=/opt/zookeeper/logs |
@ -0,0 +1,53 @@
|
||||
Easy Scheduler Release 1.0.3 |
||||
=== |
||||
Easy Scheduler 1.0.3是1.x系列中的第四个版本。 |
||||
|
||||
新特性: |
||||
=== |
||||
- [[EasyScheduler-254](https://github.com/analysys/EasyScheduler/issues/254)] 流程定义删除和批量删除 |
||||
- [[EasyScheduler-347](https://github.com/analysys/EasyScheduler/issues/347)] 任务依赖增加“今日” |
||||
- [[EasyScheduler-273](https://github.com/analysys/EasyScheduler/issues/273)]sql任务添加title |
||||
- [[EasyScheduler-247](https://github.com/analysys/EasyScheduler/issues/247)]API在线文档 |
||||
- [[EasyScheduler-319](https://github.com/analysys/EasyScheduler/issues/319)] 单机容错 |
||||
- [[EasyScheduler-253](https://github.com/analysys/EasyScheduler/issues/253)] 项目增加流程定义统计和运行流程实例统计 |
||||
- [[EasyScheduler-292](https://github.com/analysys/EasyScheduler/issues/292)] 启用SSL的邮箱发送邮件 |
||||
- [[EasyScheduler-77](https://github.com/analysys/EasyScheduler/issues/77)] 定时管理、工作流定义添加删除功能 |
||||
- [[EasyScheduler-380](https://github.com/analysys/EasyScheduler/issues/380)] 服务监控功能 |
||||
- [[EasyScheduler-380](https://github.com/analysys/EasyScheduler/issues/382)] 项目增加流程定义统计和运行流程实例统计 |
||||
|
||||
增强: |
||||
=== |
||||
- [[EasyScheduler-192](https://github.com/analysys/EasyScheduler/issues/192)] 租户删除前可以考虑校验租户和资源 |
||||
- [[EasyScheduler-376](https://github.com/analysys/EasyScheduler/issues/294)] 删除实例时候,没有删除对应zookeeper队列里的任务 |
||||
- [[EasyScheduler-185](https://github.com/analysys/EasyScheduler/issues/185)] 项目删除工作流定义还存在 |
||||
- [[EasyScheduler-206](https://github.com/analysys/EasyScheduler/issues/206)] 优化部署,完善docker化支持 |
||||
- [[EasyScheduler-381](https://github.com/analysys/EasyScheduler/issues/381)] 前端一键部署脚本支持ubuntu |
||||
|
||||
修复: |
||||
=== |
||||
- [[EasyScheduler-255](https://github.com/analysys/EasyScheduler/issues/255)]子父流程全局变量覆盖,子流程继承父流程全局变量并可以重写 |
||||
- [[EasyScheduler-256](https://github.com/analysys/EasyScheduler/issues/256)]子父流程参数显示异常 |
||||
- [[EasyScheduler-186](https://github.com/analysys/EasyScheduler/issues/186)]所有查询中只要输入%会返回所有数据 |
||||
- [[EasyScheduler-185](https://github.com/analysys/EasyScheduler/issues/185)]项目删除工作流定义还存在 |
||||
- [[EasyScheduler-266](https://github.com/analysys/EasyScheduler/issues/266)]Stop process return: process definition 1 not on line |
||||
- [[EasyScheduler-300](https://github.com/analysys/EasyScheduler/issues/300)] 超时告警时间单位 |
||||
- [[EasyScheduler-235](https://github.com/analysys/EasyScheduler/issues/235)]nginx超时连接问题修复 |
||||
- [[EasyScheduler-272](https://github.com/analysys/EasyScheduler/issues/272)]管理员不能生成token |
||||
- [[EasyScheduler-272](https://github.com/analysys/EasyScheduler/issues/277)]save global parameters error |
||||
- [[EasyScheduler-183](https://github.com/analysys/EasyScheduler/issues/183)]创建中文名称的Worker分组报错 |
||||
- [[EasyScheduler-377](https://github.com/analysys/EasyScheduler/issues/377)]资源文件重命名只修改描述时会报名称已存在错误 |
||||
- [[EasyScheduler-235](https://github.com/analysys/EasyScheduler/issues/235)]创建spark数据源,点击“测试连接”,系统回退回到登入页面 |
||||
- [[EasyScheduler-83](https://github.com/analysys/EasyScheduler/issues/83)]1.0.1版本启动api server报错 |
||||
- [[EasyScheduler-379](https://github.com/analysys/EasyScheduler/issues/379)]跨天恢复执行定时任务时,时间参数不对 |
||||
- [[EasyScheduler-383](https://github.com/analysys/EasyScheduler/issues/383)]sql邮件不显示前面的空行 |
||||
|
||||
|
||||
感谢: |
||||
=== |
||||
最后但最重要的是,没有以下伙伴的贡献就没有新版本的诞生: |
||||
|
||||
Baoqi, jimmy201602, samz406, petersear, millionfor, hyperknob, fanguanqun, yangqinlong, qq389401879, |
||||
feloxx, coding-now, hymzcn, nysyxxg, chgxtony |
||||
|
||||
以及微信群里众多的热心伙伴!在此非常感谢! |
||||
|
@ -0,0 +1,96 @@
|
||||
Q:单机运行服务老挂,应该是内存不够,测试机器4核8G。生产环境需要分布式,如果单机的话建议的配置是? |
||||
|
||||
A: Easy Scheduler有5个服务组成,这些服务本身需要的内存和cpu不多, |
||||
|
||||
| 服务 | 内存 | cpu核数 | |
||||
| ------------ | ---- | ------- | |
||||
| MasterServer | 2G | 2核 | |
||||
| WorkerServer | 2G | 2核 | |
||||
| ApiServer | 512M | 1核 | |
||||
| AlertServer | 512M | 1核 | |
||||
| LoggerServer | 512M | 1核 | |
||||
|
||||
注意:由于如果任务较多,WorkServer所在机器建议物理内存在16G以上 |
||||
|
||||
|
||||
|
||||
--- |
||||
|
||||
Q: 管理员为什么不能创建项目? |
||||
|
||||
A: 管理员目前属于"纯管理", 没有租户,即没有linux上对应的用户,所以没有执行权限, 但是有所有的查看权限。如果需要创建项目等业务操作,请使用管理员创建租户和普通用户,然后使用普通用户登录进行操作 |
||||
|
||||
--- |
||||
|
||||
Q: 系统支持哪些邮箱? |
||||
|
||||
A: 支持绝大多数邮箱,qq、163、126、139、outlook、aliyun等皆可支持 |
||||
|
||||
--- |
||||
|
||||
Q:常用的系统变量时间参数有哪些,如何使用? |
||||
|
||||
A: 请参考使用手册中的系统参数 |
||||
|
||||
--- |
||||
|
||||
Q:pip install kazoo 这个安装报错。是必须安装的吗? |
||||
|
||||
A: 这个是python连接zookeeper需要使用到的 |
||||
|
||||
--- |
||||
|
||||
Q: 如果alert、api、logger服务任意一个宕机,任何还会正常执行吧 |
||||
|
||||
A: 不影响,影响正在运行中的任务的服务有Master和Worker服务 |
||||
|
||||
--- |
||||
|
||||
Q: 这个怎么指定机器运行任务的啊 」 |
||||
|
||||
A: 通过worker分组: 这个流程只能在指定的机器组里执行。默认是Default,可以在任一worker上执行。 |
||||
|
||||
--- |
||||
|
||||
Q: 跨用户的任务依赖怎么实现呢, 比如A用户写了一个任务,B用户需要依赖这个任务 |
||||
|
||||
就比如说 我们数仓组 写了一个 中间宽表的任务, 其他业务部门想要使用这个中间表的时候,他们应该是另外一个用户,怎么依赖这个中间表呢 |
||||
|
||||
A: 有两种情况,一个是要运行这个宽表任务,可以使用子工作流把宽表任务放到自己的工作流里面。另一个是检查这个宽表任务有没有完成,可以使用依赖节点来检查这个宽表任务在指定的时间周期有没有完成。 |
||||
|
||||
--- |
||||
|
||||
Q: 启动WorkerServer服务时不能正常启动,报以下信息是什么原因? |
||||
|
||||
``` |
||||
[INFO] 2019-05-06 16:39:31.492 cn.escheduler.server.zk.ZKWorkerClient:[155] - register failure , worker already started on : 127.0.0.1, please wait for a moment and try again |
||||
``` |
||||
|
||||
A:Worker/Master Server在启动时,会向Zookeeper注册自己的启动信息,是Zookeeper的临时节点,如果两次启动时间间隔较短的情况,上次启动的Worker/Master Server在Zookeeper的会话还未过期,会出现上述信息,处理办法是等待session过期,一般是1分钟左右 |
||||
|
||||
---- |
||||
|
||||
Q: 编译时escheduler-grpc模块一直报错:Information:java: Errors occurred while compiling module 'escheduler-rpc', 找不到LogParameter、RetStrInfo、RetByteInfo等class类 |
||||
|
||||
A: 这是因为rpc源码包是google Grpc实现的,需要使用maven进行编译,在根目录下执行:mvn -U clean package assembly:assembly -Dmaven.test.skip=true , 然后刷新下整个项目 |
||||
|
||||
---- |
||||
|
||||
Q:EasyScheduler支持windows上运行么? |
||||
|
||||
A: 建议在Ubuntu、Centos上运行,暂不支持windows上运行,不过windows上可以进行编译。开发调试的话建议Ubuntu或者mac上进行。 |
||||
|
||||
----- |
||||
|
||||
Q:任务为什么不执行? |
||||
|
||||
A: 不执行的原因: |
||||
|
||||
查看command表里有没有内容? |
||||
|
||||
查看Master server的运行日志: |
||||
|
||||
查看Worker Server的运行日志 |
||||
|
||||
|
||||
|
After Width: | Height: | Size: 57 KiB |
After Width: | Height: | Size: 83 KiB |
After Width: | Height: | Size: 278 KiB |
After Width: | Height: | Size: 243 KiB |
After Width: | Height: | Size: 267 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 242 KiB |
After Width: | Height: | Size: 243 KiB |
After Width: | Height: | Size: 215 KiB |
After Width: | Height: | Size: 116 KiB |
After Width: | Height: | Size: 179 KiB |
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 113 KiB |
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 46 KiB |
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 245 KiB |
After Width: | Height: | Size: 193 KiB |
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 114 KiB |
After Width: | Height: | Size: 85 KiB |
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 47 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 42 KiB |
After Width: | Height: | Size: 280 KiB |
After Width: | Height: | Size: 292 KiB |
After Width: | Height: | Size: 143 KiB |
After Width: | Height: | Size: 181 KiB |
After Width: | Height: | Size: 134 KiB |
After Width: | Height: | Size: 54 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 119 KiB |
After Width: | Height: | Size: 88 KiB |
After Width: | Height: | Size: 85 KiB |
@ -0,0 +1,50 @@
|
||||
# 快速上手 |
||||
|
||||
* 管理员用户登录 |
||||
>地址:192.168.xx.xx:8888 用户名密码:admin/esheduler123 |
||||
|
||||
<p align="center"> |
||||
<img src="https://analysys.github.io/easyscheduler_docs_cn/images/login.jpg" width="60%" /> |
||||
</p> |
||||
|
||||
* 创建队列 |
||||
|
||||
<p align="center"> |
||||
<img src="https://analysys.github.io/easyscheduler_docs_cn/images/create-queue.png" width="60%" /> |
||||
</p> |
||||
|
||||
* 创建租户 |
||||
<p align="center"> |
||||
<img src="https://analysys.github.io/easyscheduler_docs_cn/images/addtenant.png" width="60%" /> |
||||
</p> |
||||
|
||||
* 创建普通用户 |
||||
<p align="center"> |
||||
<img src="https://analysys.github.io/easyscheduler_docs_cn/images/useredit2.png" width="60%" /> |
||||
</p> |
||||
|
||||
* 创建告警组 |
||||
|
||||
<p align="center"> |
||||
<img src="https://analysys.github.io/easyscheduler_docs_cn/images/mail_edit.png" width="60%" /> |
||||
</p> |
||||
|
||||
* 使用普通用户登录 |
||||
> 点击右上角用户名“退出”,重新使用普通用户登录。 |
||||
|
||||
* 项目管理->创建项目->点击项目名称 |
||||
<p align="center"> |
||||
<img src="https://analysys.github.io/easyscheduler_docs_cn/images/project.png" width="60%" /> |
||||
</p> |
||||
|
||||
* 点击工作流定义->创建工作流定义->上线流程定义 |
||||
|
||||
<p align="center"> |
||||
<img src="https://analysys.github.io/easyscheduler_docs_cn/images/dag1.png" width="60%" /> |
||||
</p> |
||||
|
||||
* 运行流程定义->点击工作流实例->点击流程实例名称->双击任务节点->查看任务执行日志 |
||||
|
||||
<p align="center"> |
||||
<img src="https://analysys.github.io/easyscheduler_docs_cn/images/task-log.png" width="60%" /> |
||||
</p> |
@ -1,38 +1 @@
|
||||
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'> |
||||
<html> |
||||
<head><title> easyscheduler </title> |
||||
<meta name='Keywords' content=''> |
||||
<meta name='Description' content=''> |
||||
<style type="text/css">table { |
||||
font-size: 14px; |
||||
color: #333333; |
||||
border-width: 1px; |
||||
border-color: #666666; |
||||
border-collapse: collapse; |
||||
} |
||||
|
||||
table th { |
||||
border-width: 1px; |
||||
padding: 8px; |
||||
border-style: solid; |
||||
border-color: #666666; |
||||
background-color: #dedede; |
||||
} |
||||
|
||||
table td { |
||||
border-width: 1px; |
||||
padding: 8px; |
||||
border-style: solid; |
||||
border-color: #666666; |
||||
background-color: #ffffff; |
||||
}</style> |
||||
</head> |
||||
<body> |
||||
<table> |
||||
<thead> |
||||
<#if title??> ${title} </#if> |
||||
</thead> |
||||
<#if content??> ${content} </#if> |
||||
</table> |
||||
</body> |
||||
</html> |
||||
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'><html><head><title> easyscheduler</title><meta name='Keywords' content=''><meta name='Description' content=''><style type="text/css">table { margin-top:0px; padding-top:0px; border:1px solid; font-size: 14px; color: #333333; border-width: 1px; border-color: #666666; border-collapse: collapse; } table th { border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #dedede; } table td { border-width: 1px; padding: 8px; border-style: solid; border-color: #666666; background-color: #ffffff; }</style></head><body style="margin:0;padding:0"><table border="1px" cellpadding="5px" cellspacing="-10px"><thead><#if title??> ${title}</#if></thead><#if content??> ${content}</#if></table></body></html> |