海豚调度2.0.4 告警alert-email使用
-
- 告警实例查询不到插件
-
- 启动alert服务
- 问题记录
-
- UnknownHostException
-
- 虚拟机不通外网导致
- 结果
-
- 日志
- 邮箱
告警实例查询不到插件
服务未启动,数据库没有初始化数据
启动alert服务
[dolphinscheduler@host1 bin]$ sh dolphinscheduler-daemon.sh start alert-server
Begin start alert-server......
starting alert-server, logging to /home/dolphinscheduler/app/dolphinscheduler/logs/dolphinscheduler-alert-server-host1.out
nohup /usr/local/java/jdk1.8.0_151/bin/java -Dlogback.configurationFile=conf/logback-alert.xml -Xms1g -Xmx1g -Xmn512m -server -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=128m -Xss512k -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:LargePageSizeInBytes=128m -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=70 -XX:+PrintGCDetails -Xloggc:/home/dolphinscheduler/app/dolphinscheduler/logs/gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=dump.hprof -XshowSettings:vm -classpath /home/dolphinscheduler/app/dolphinscheduler/sql:/home/dolphinscheduler/app/dolphinscheduler/conf:/home/dolphinscheduler/app/dolphinscheduler/lib/* org.apache.dolphinscheduler.alert.AlertServer > /home/dolphinscheduler/app/dolphinscheduler/logs/dolphinscheduler-alert-server-host1.out 2>&1 &
End start alert-server.
[dolphinscheduler@host1 bin]$ date
2022年 03月 01日 星期二 17:45:27 CST
[dolphinscheduler@host1 bin]$
此时数据库初始化了插件数据
启动
问题记录
UnknownHostException
...skipping...
:2.0.4-SNAPSHOT]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_151]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_151]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_151]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]
Caused by: com.sun.mail.util.MailConnectException: Couldn\'t connect to host, port: smtp.qq.com, 25; timeout -1
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2209) ~[javax.mail-1.6.2.jar:1.6.2]
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:740) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.Service.connect(Service.java:388) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.Service.connect(Service.java:246) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.Service.connect(Service.java:195) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.Transport.send0(Transport.java:254) ~[javax.mail-1.6.2.jar:1.6.2]
at javax.mail.Transport.send(Transport.java:124) ~[javax.mail-1.6.2.jar:1.6.2]
at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1459) ~[commons-email-1.5.jar:1.5]
... 15 common frames omitted
Caused by: java.net.UnknownHostException: smtp.qq.com
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184) ~[na:1.8.0_151]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_151]
at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_151]
at java.net.Socket.connect(Socket.java:538) ~[na:1.8.0_151]
at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:359) ~[javax.mail-1.6.2.jar:1.6.2]
at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238) ~[javax.mail-1.6.2.jar:1.6.2]
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2175) ~[javax.mail-1.6.2.jar:1.6.2]
... 22 common frames omitted
2022-03-01 17:55:20.964 INFO 7145 --- [pool-3-thread-1] o.a.d.p.alert.email.EmailAlertChannel : alert send error : alert send error.
2022-03-01 17:55:20.964 INFO 7145 --- [pool-3-thread-1] o.a.dolphinscheduler.alert.AlertSender : Alert Plugin email send error : alert send error.
(END)
虚拟机不通外网导致
之前排错网卡设置了NetworkManager开机不启动所致,启动NetworkManager,并设置开机启动
[root@host1 ~]# systemctl start NetworkManager
[root@host1 ~]# systemctl enable NetworkManager
Created symlink from /etc/systemd/system/dbus-org.freedesktop.NetworkManager.service to /usr/lib/systemd/system/NetworkManager.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/NetworkManager.service to /usr/lib/systemd/system/NetworkManager.service.
Created symlink from /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service to /usr/lib/systemd/system/NetworkManager-dispatcher.service.
[root@host1 ~]# systemctl status NetworkManager
● NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since 三 2022-03-02 09:12:51 CST; 7min ago
Docs: man:NetworkManager(8)
Main PID: 1511 (NetworkManager)
CGroup: /system.slice/NetworkManager.service
├─1511 /usr/sbin/NetworkManager --no-daemon
└─1523 /sbin/dhclient -d -q -sf /usr/libexec/nm-dhcp-helper -pf /var/run/dhclient-enp0s8.pid -lf /var/li...
3月 02 09:12:51 host1 NetworkManager[1511]: <info> [1646183571.6563] device (enp0s8): state change: ip-confi...80 0]
3月 02 09:12:51 host1 dhclient[1523]: bound to 10.0.3.15 -- renewal in 43104 seconds.
3月 02 09:12:51 host1 NetworkManager[1511]: <info> [1646183571.6572] device (enp0s8): state change: ip-check...90 0]
3月 02 09:12:51 host1 NetworkManager[1511]: <info> [1646183571.6576] device (enp0s8): state change: secondar...00 0]
3月 02 09:12:51 host1 NetworkManager[1511]: <info> [1646183571.6579] manager: NetworkManager state is now CO...LOCAL
3月 02 09:12:51 host1 NetworkManager[1511]: <info> [1646183571.6616] manager: NetworkManager state is now CO..._SITE
3月 02 09:12:51 host1 NetworkManager[1511]: <info> [1646183571.6617] policy: set \'有线连接 1\' (enp0s8) as de…and DNS
3月 02 09:12:51 host1 NetworkManager[1511]: <info> [1646183571.6638] device (enp0s8): Activation: successful...ated.
3月 02 09:12:51 host1 NetworkManager[1511]: <info> [1646183571.6640] manager: startup complete
3月 02 09:12:51 host1 NetworkManager[1511]: <info> [1646183571.6644] manager: NetworkManager state is now CO...LOBAL
Hint: Some lines were ellipsized, use -l to show in full.
[root@host1 ~]# systemctl list-unit-files|grep Network
dbus-org.freedesktop.NetworkManager.service enabled
NetworkManager-dispatcher.service enabled
NetworkManager-wait-online.service disabled
NetworkManager.service enabled
[root@host1 ~]#
结果
日志
2022-03-02 09:14:31.641 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registering alert plugin: DingTalk
2022-03-02 09:14:31.642 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registered alert plugin: DingTalk
2022-03-02 09:14:31.712 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registering alert plugin: Email
2022-03-02 09:14:31.713 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registered alert plugin: Email
2022-03-02 09:14:31.723 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registering alert plugin: Feishu
2022-03-02 09:14:31.724 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registered alert plugin: Feishu
2022-03-02 09:14:31.730 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registering alert plugin: Http
2022-03-02 09:14:31.731 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registered alert plugin: Http
2022-03-02 09:14:31.736 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registering alert plugin: Script
2022-03-02 09:14:31.736 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registered alert plugin: Script
2022-03-02 09:14:31.743 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registering alert plugin: Slack
2022-03-02 09:14:31.744 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registered alert plugin: Slack
2022-03-02 09:14:31.750 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registering alert plugin: WeChat
2022-03-02 09:14:31.751 INFO 1909 --- [ main] o.a.d.alert.AlertPluginManager : Registered alert plugin: WeChat
2022-03-02 09:14:38.088 INFO 1909 --- [pool-3-thread-1] o.a.d.p.alert.email.EmailAlertChannel : alert send success
2022-03-02 09:14:38.088 INFO 1909 --- [pool-3-thread-1] o.a.dolphinscheduler.alert.AlertSender : Alert Plugin email send success
2022-03-02 09:14:39.062 INFO 1909 --- [pool-3-thread-1] o.a.d.p.alert.email.EmailAlertChannel : alert send success
2022-03-02 09:14:39.062 INFO 1909 --- [pool-3-thread-1] o.a.dolphinscheduler.alert.AlertSender : Alert Plugin email send success
2022-03-02 09:14:57.577 INFO 1909 --- [pool-3-thread-1] o.a.d.p.alert.email.EmailAlertChannel : alert send success
2022-03-02 09:14:57.578 INFO 1909 --- [pool-3-thread-1] o.a.dolphinscheduler.alert.AlertSender : Alert Plugin email send success
邮箱
结果
配置
来源:https://blog.csdn.net/qq_36434219/article/details/123222188
本站部分图文来源于网络,如有侵权请联系删除。