连接器请求地址修改
cat /home/sdata2/tomcat/bin/setenv.sh
修改里面的 SYSTEM_URL
为数睿服务实际访问地址
如图所示
连接器执行
异常日志
2024-01-23 18:01:49,586 (conf-file-poller-0) [ERROR - org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:147)] Failed to load configuration data. Exception follows.
org.apache.flume.FlumeException: Unable to load source type: com.sdata.dataconnector.flume.source.OnemindSource, class: com.sdata.dataconnector.flume.source.OnemindSourceat org.apache.flume.source.DefaultSourceFactory.getClass(DefaultSourceFactory.java:68)at org.apache.flume.source.DefaultSourceFactory.create(DefaultSourceFactory.java:42)at org.apache.flume.node.AbstractConfigurationProvider.loadSources(AbstractConfigurationProvider.java:322)at org.apache.flume.node.AbstractConfigurationProvider.getConfiguration(AbstractConfigurationProvider.java:105)at org.apache.flume.node.PollingPropertiesFileConfigurationProvider$FileWatcherRunnable.run(PollingPropertiesFileConfigurationProvider.java:145)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ClassNotFoundException: com.sdata.dataconnector.flume.source.OnemindSourceat java.net.URLClassLoader.findClass(URLClassLoader.java:381)at java.lang.ClassLoader.loadClass(ClassLoader.java:424)at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)at java.lang.ClassLoader.loadClass(ClassLoader.java:357)at java.lang.Class.forName0(Native Method)at java.lang.Class.forName(Class.java:264)at org.apache.flume.source.DefaultSourceFactory.getClass(DefaultSourceFactory.java:66)
解决办法
1、执行权限 -> chmod u+x $HOME/flume-bin/bin/flume-ng2、在Flume组件中创建软连接。a) 执行以下命令,创建文件“plugins.d”。-> cd $HOME/flume-bin-> mkdir plugins.db) 执行以下命令,创建目录“customize-source-1”。-> cd $HOME/flume-bin/plugins.d-> mkdir customize-source-1c) 执行以下命令,创建libext软连接。-> cd $HOME/flume-bin/plugins.d/customize-source-1-> ln -s $HOME/tomcat/webapps/sdata/WEB-INF/lib libext