fix:fixed the problem of reporting NoClass in session mode

This commit is contained in:
wangchengcheng
2024-01-23 18:12:25 +08:00
parent 62bffa9731
commit 046b7fea80
4 changed files with 42 additions and 14 deletions

View File

@@ -6,7 +6,7 @@
<groupId>com.zdjizhi</groupId> <groupId>com.zdjizhi</groupId>
<artifactId>flink-dos-detection</artifactId> <artifactId>flink-dos-detection</artifactId>
<version>23.12</version> <version>1.0</version>
<name>flink-dos-detection</name> <name>flink-dos-detection</name>
<url>http://www.example.com</url> <url>http://www.example.com</url>
@@ -64,6 +64,7 @@
<!-- Prevents recompilation due to missing package-info.class, see MCOMPILER-205 --> <!-- Prevents recompilation due to missing package-info.class, see MCOMPILER-205 -->
<arg>-Xpkginfo:always</arg> <arg>-Xpkginfo:always</arg>
</compilerArgs> </compilerArgs>
</configuration> </configuration>
</plugin> </plugin>
@@ -80,6 +81,12 @@
<configuration> <configuration>
<finalName>flink-dos-detection</finalName> <finalName>flink-dos-detection</finalName>
<relocations>
<relocation>
<pattern>org.apache.http</pattern>
<shadedPattern>shade.org.apache.http</shadedPattern>
</relocation>
</relocations>
<filters> <filters>
<filter> <filter>
<!-- Do not copy the signatures in the META-INF folder. <!-- Do not copy the signatures in the META-INF folder.

View File

@@ -255,5 +255,10 @@ public class DosConfigs {
.longType() .longType()
.defaultValue(60L); .defaultValue(60L);
public static final ConfigOption<String> JOB_NAME =
ConfigOptions.key("job.name")
.stringType()
.defaultValue("detection_dos_attack")
.withDescription("The flink job name.");
} }

View File

@@ -79,6 +79,6 @@ public class DosDetectionApplication {
.addSink(KafkaProducer.getKafkaProducer(config.get(KAFKA_SINK_METRIC_TOPIC), DosConfiguration.getProperties(SINK_KAFKA_PROPERTIES_PREFIX))) .addSink(KafkaProducer.getKafkaProducer(config.get(KAFKA_SINK_METRIC_TOPIC), DosConfiguration.getProperties(SINK_KAFKA_PROPERTIES_PREFIX)))
.setParallelism(config.get(KAFKA_SINK_METRIC_PARALLELISM)); .setParallelism(config.get(KAFKA_SINK_METRIC_PARALLELISM));
env.execute(args[0]); env.execute(config.get(JOB_NAME));
} }
} }

View File

@@ -1,24 +1,41 @@
#kafka source
source.kafka.topic=DOS-SKETCH-RECORD source.kafka.topic=DOS-SKETCH-RECORD
source.kafka.props.bootstrap.servers=192.168.44.11:9094,192.168.44.14:9094,192.168.44.15:9094 source.kafka.props.bootstrap.servers=192.168.45.102:9094
source.kafka.props.group.id=dsadsadsad source.kafka.props.group.id=dos-detection-job-20240116
source.kafka.props.session.timeout.ms=60000
source.kafka.props.max.poll.records=5000
source.kafka.props.max.partition.fetch.bytes=31457280
source.kafka.props.security.protocol=SASL_PLAINTEXT source.kafka.props.security.protocol=SASL_PLAINTEXT
source.kafka.props.sasl.mechanism=PLAIN source.kafka.props.sasl.mechanism=PLAIN
source.kafka.props.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="admin"password="galaxy2019"; source.kafka.props.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="admin"password="galaxy2019";
#kafka sink #kafka sink
kafka.sink.event.topic.name=dos-test kafka.sink.event.topic.name=DOS-EVENT
kafka.sink.metric.topic=test kafka.sink.metric.topic=TRAFFIC-TOP-DESTINATION-IP-METRIC
sink.kafka.props.bootstrap.servers=192.168.44.12:9092 sink.kafka.props.bootstrap.servers=192.168.45.102:9094
sink.kafka.props.security.protocol=SASL_PLAINTEXT
sink.kafka.props.sasl.mechanism=PLAIN
sink.kafka.props.sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="admin" password="galaxy2019";
sink.kafka.props.acks=1
sink.kafka.props.retries=0
sink.kafka.props.linger.ms=10
sink.kafka.props.request.timeout.ms=30000
sink.kafka.props.batch.size=262144
sink.kafka.props.buffer.memory=134217728
sink.kafka.props.max.request.size=10485760
sink.kafka.props.compression.type=snappy
#zookeeper地址 #zookeeper地址
hbase.zookeeper.quorum=192.168.44.12:2181 hbase.zookeeper.quorum=192.168.45.102:2181
flink.watermark.max.orderness=300 flink.watermark.max.orderness=300
#计算窗口大小默认600s #计算窗口大小默认600s
flink.window.max.time=600 flink.window.max.time=600
#bifang服务访问地址
bifang.server.uri=http://192.168.44.72 #cm服务访问地址
knowledge.base.uri=http://192.168.44.67:9999 bifang.server.uri=http://192.168.44.3
knowledge.base.uri=http://192.168.45.102:9999
############################## 阈值 配置 ###################################### ############################## 阈值 配置 ######################################
static.sensitivity.threshold=1 static.sensitivity.threshold=1
#基线敏感阈值 #基线敏感阈值
@@ -32,4 +49,3 @@ baseline.sessions.critical.threshold=8