下载jiacrontabd
Github:https://github.com/TheDanielChen/jiacrontab
下载完成后用FTP或SSH移动到/root/jiacrontab
用chmod给予对应二进制文件权限
自定义.service服务文件
把.service文件放到/usr/lib/systemd/system中
文件内容如下:
jiacrontab_web.service
[Unit]
Description=jiacrontab
[Service]
Type=simple
ExecStart=/root/jiacrontab/jiacrontab_admin/jiacrontab_admin
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=control-group
Restart=on-failure
WorkingDirectory=/root/jiacrontab/jiacrontab_admin
RestartSec=15
[Install]
WantedBy=multi-user.target
jiacrontabd.service
[Unit]
Description=jiacrontab
[Service]
Type=simple
ExecStart=/root/jiacrontab/jiacrontabd/jiacrontabd
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=control-group
Restart=on-failure
WorkingDirectory=/root/jiacrontab/jiacrontabd
RestartSec=15
[Install]
WantedBy=multi-user.target
启动服务
Web端启动:systemctl start jiacrontab_web.service
服务端启动:systemctl start jiacrontabd.service
设置开机启动
systemctl enable jiacrontab_web.service
systemctl enable jiacrontabd.service
配置文件备份(个人自用)
jiacrontab_admin.ini
[app]
http_listen_addr = 0.0.0.0:8008
rpc_listen_addr = :20003
app_name = jiacrontab
; http 返回签名
signing_key = `WERRTT1234$@#@@$`
log_level = warn
; 客户端最大心跳时间
max_client_alive_interval = 30
[jwt]
; jwt 签名
signing_key = eyJhbGciOiJIUzI1
expires = 3600
name = token
[mail]
enabled = false
host = 自己设置
user = 自己设置
skip_verify = true
passwd = 自己设置
from = 自己设置
use_certificate = true
[ldap]
; 支持: ldap://, ldaps://, ldapi://.
addr = ladp://localhost:1234
disabled_anonymous_query = false
bind_passwd= 123456
bind_userdn = "cn=admin,dc=jdevops,dc=com"
basedn = "dc=jdevops,dc=com"
user_field = uid
[database]
; jiacrontab_admin目前支持的数据库包括sqlite3,mysql,pg
; 注意: mysql,pg 等数据库需要手动建立jiacrontab库
; driver_name = postgres
; dsn = postgres://jiacrontab:123456@localhost:5432/jiacrontab?sslmode=disable
; driver_name = mysql
; dsn = root:12345678@(localhost:3306)/jiacrontab?charset=utf8&parseTime=True&loc=Local
driver_name = sqlite3
dsn = data/jiacrontab_admin.db?cache=shared
jiacrontabd.ini
[jiacrontabd]
; 任务日志页面显示冗余信息,比如时间、脚本名称
verbose_job_log = false
; 本机rpc监听地址
listen_addr = :20001
; 当前节点的广播地址,admin通过该地址与当前节点通信,默认取当前节点ip
; boardcast_addr = localhost:20001
; admin 地址
admin_addr = localhost:20003
; 自动清理大于一个月或者单文件体积大于1G的日志文件
auto_clean_task_log = true
; 节点名,默认取节点hostname
; node_name = node1
log_level = warn
log_path = ./logs
user_agent = jiacrontabd
; jiacrontabd目前仅支持sqlite3
driver_name = sqlite3
dsn = data/jiacrontabd.db?cache=shared
; 心跳上报周期(s)
client_alive_interval = 10
© 版权声明
文章版权归作者所有,请勿转载至任何平台。
THE END
暂无评论内容