新建文件夹rundeck [bigdata@hadoop001 app]$ ll total 8 lrwxrwxrwx 1 bigdata bigdata 23 Nov 28 10:28 hadoop -> hadoop-2.6.0-cdh5.16.2/ drwxr-xr-x 18 bigdata bigdata 4096 Nov 28 13:30 hadoop-2.6.0-cdh5.16.2 drwxrwxr-x 2 bigdata bigdata 4096 Nov 29 16:20 rundeck [bigdata@hadoop001 rundeck]$ ll total 171112 -rw-r--r-- 1 bigdata bigdata 175217944 Nov 29 14:00 rundeck-3.3.6-20201111.war #后台运行启动 [bigdata@hadoop001 rundeck]$ nohup java -jar rundeck-3.3.6-20201111.war & [1] 16764 [bigdata@hadoop001 rundeck]$ nohup: ignoring input and appending output to ‘nohup.out’
[bigdata@hadoop001 rundeck]$ tail -F nohup.out [2020-11-29T16:23:06,145] INFO rundeckapp.Application - The following profiles are active: production
Configuring Spring Security Core ... ... finished configuring Spring Security Core
[2020-11-29T16:23:29,480] INFO rundeckapp.BootStrap - Starting Rundeck 3.3.6-20201111 (2020-11-12) ... [2020-11-29T16:23:29,481] INFO rundeckapp.BootStrap - using rdeck.base config property: /home/bigdata/app/rundeck [2020-11-29T16:23:29,482] INFO rundeckapp.BootStrap - Performing rundeck first-run initialization... [2020-11-29T16:23:29,539] INFO rundeckapp.BootStrap - Rundeck initialization complete. [2020-11-29T16:23:29,554] INFO rundeckapp.BootStrap - loaded configuration: /home/bigdata/app/rundeck/etc/framework.properties [2020-11-29T16:23:29,595] INFO rundeckapp.BootStrap - RSS feeds disabled [2020-11-29T16:23:29,595] INFO rundeckapp.BootStrap - Using builtin realm authentication [2020-11-29T16:23:29,595] INFO rundeckapp.BootStrap - Preauthentication is disabled [2020-11-29T16:23:29,658] INFO rundeckapp.BootStrap - Rundeck is ACTIVE: executions can be run. [2020-11-29T16:23:29,943] WARN rundeckapp.BootStrap - [Development Mode] Usage of H2 database is recommended only for development and testing [2020-11-29T16:23:30,144] INFO rundeckapp.BootStrap - workflowConfigFix973: applying... [2020-11-29T16:23:30,152] INFO rundeckapp.BootStrap - workflowConfigFix973: No fix was needed. Storing fix application state. [2020-11-29T16:23:30,413] INFO rundeckapp.BootStrap - Rundeck startup finished in 1011ms [2020-11-29T16:23:30,551] INFO rundeckapp.Application - Started Application in 26.772 seconds (JVM running for 29.475) Grails application running at http://hadoop001:4440 in environment: production
[bigdata@hadoop001 rundeck]$ vi date.sh #!/bin/bash
date
赋权 [bigdata@hadoop001 rundeck]$ chmod +x date.sh [bigdata@hadoop001 rundeck]$ ll total 171148 -rwxrwxr-x 1 bigdata bigdata 18 Nov 29 16:37 date.sh [bigdata@hadoop001 rundeck]$ ./date.sh Sun Nov 29 16:38:55 CST 2020
创建job
create a new job
填写名称
填写workflow
添加step
填写路径
填写crontab 包含秒
执行job 查看结果
关闭
ps -ef | grep rundeck 找到pid
kill -9 pid
邮箱设置
开启下面的服务
生成授权码
muciyrwfnnpcbcif
安装postfix服务
1 2 3 4 5
[root@hadoop001 ~]# service sendmail status Redirecting to /bin/systemctl status sendmail.service Unit sendmail.service could not be found. [root@hadoop001 ~]# yum install -y postfix [root@hadoop001 ~]# yum install -y mailx
启动
1 2 3 4 5 6 7 8 9 10 11
[root@hadoop001 ~]# service postfix restart Redirecting to /bin/systemctl restart postfix.service Job for postfix.service failed because the control process exited with error code. See "systemctl status postfix.service" and "journalctl -xe" for details. ###报错, 定位错误 [root@hadoop001 ~]# which postfix /usr/sbin/postfix [root@hadoop001 ~]# postfix check postfix: fatal: parameter inet_interfaces: no local interface found for ::1 ###可能会报其他错误mysql相关的如果卸载过MySQLclient 解决:rpm -qa|grep mysql yum install mysql-libs
certutil -A -n “GeoTrust SSL CA - G3” -t “Pu,Pu,Pu” -d ./ -i qq.crt
编辑mail.rc配置文件
1 2 3 4 5 6 7 8 9 10 11 12 13
[root@hadoop001 ~]# vi /etc/mail.rc 在文件末尾添加
#QQ set from=549501669@qq.com set smtp=smtp.qq.com set smtp-auth-user=549501669 #授权码 set smtp-auth-password=ufgqsunndyqdbfdi set smtp-auth=login set smtp-use-starttls set ssl-verify=ignore set nss-config-dir=/root/.certs
测试
1 2 3 4 5
[root@hadoop001 ~]# echo hello world |mail -s "title" 549501669@qq.com [root@hadoop001 ~]# could not connect: Network is unreachable "/root/dead.letter" 11/299 . . . message not sent.
阿里云25解封
申请解封失败, 使用京东云, 一次性成功
发邮件不带附件
1 2 3 4
echo -e "`date "+%Y-%m-%d %H:%M:%S"` : The current running \ $JOB_NAME job num is $RUNNINGNUM in 106.14.23.129 ..." | mail \ -r "From : alertAdmin<549501669@qq.com>"\ -s "Warn: Skip the new $JOB_NAME spark job." ${EMAIL}