This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 2c890c29bb [INLONG-10263][Audit] Solve the conflict between the 
jdbc.url parameter of Audit Store and the container environment variable 
(#10264)
2c890c29bb is described below

commit 2c890c29bb8e69e675717c23791ec67bd0ab5868
Author: doleyzi <[email protected]>
AuthorDate: Thu May 23 19:08:24 2024 +0800

    [INLONG-10263][Audit] Solve the conflict between the jdbc.url parameter of 
Audit Store and the container environment variable (#10264)
---
 inlong-audit/audit-docker/audit-docker.sh                |  4 ++--
 .../java/org/apache/inlong/audit/config/JdbcConfig.java  | 16 ++++++++--------
 inlong-audit/conf/application.properties                 |  8 ++++----
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/inlong-audit/audit-docker/audit-docker.sh 
b/inlong-audit/audit-docker/audit-docker.sh
index f8c19973e1..2c73b18c34 100755
--- a/inlong-audit/audit-docker/audit-docker.sh
+++ b/inlong-audit/audit-docker/audit-docker.sh
@@ -54,8 +54,8 @@ sed -i "s/apache_inlong_audit/${AUDIT_DBNAME}/g" 
"${sql_mysql_file}"
 
 # replace the configuration for audit-store
 sed -i 
"s/127.0.0.1:3306\/apache_inlong_audit/${AUDIT_JDBC_URL}\/${AUDIT_DBNAME}/g" 
"${store_conf_file}"
-sed -i "s/jdbc.username=.*$/jdbc.username=${AUDIT_JDBC_USERNAME}/g" 
"${store_conf_file}"
-sed -i "s/jdbc.password=.*$/jdbc.password=${AUDIT_JDBC_PASSWORD}/g" 
"${store_conf_file}"
+sed -i 
"s/audit.store.jdbc.username=.*$/audit.store.jdbc.username=${AUDIT_JDBC_USERNAME}/g"
 "${store_conf_file}"
+sed -i 
"s/audit.store.jdbc.password=.*$/audit.store.jdbc.password=${AUDIT_JDBC_PASSWORD}/g"
 "${store_conf_file}"
 
 # replace the configuration for audit-service
 sed -i 
"s/mysql.jdbc.url=.*$/mysql.jdbc.url=jdbc:mysql:\/\/${AUDIT_JDBC_URL}\/${AUDIT_DBNAME}/g"
 "${service_conf_file}"
diff --git 
a/inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/config/JdbcConfig.java
 
b/inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/config/JdbcConfig.java
index e7f3f639cd..42249200f0 100644
--- 
a/inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/config/JdbcConfig.java
+++ 
b/inlong-audit/audit-store/src/main/java/org/apache/inlong/audit/config/JdbcConfig.java
@@ -25,20 +25,20 @@ import org.springframework.context.annotation.Configuration;
 @Data
 public class JdbcConfig {
 
-    @Value("${jdbc.driver:com.mysql.cj.jdbc.Driver}")
+    @Value("${audit.store.jdbc.driver:com.mysql.cj.jdbc.Driver}")
     private String driver;
-    @Value("${jdbc.url}")
+    @Value("${audit.store.jdbc.url}")
     private String url;
-    @Value("${jdbc.username}")
+    @Value("${audit.store.jdbc.username}")
     private String userName;
-    @Value("${jdbc.password}")
+    @Value("${audit.store.jdbc.password}")
     private String password;
-    @Value("${jdbc.batchIntervalMs:1000}")
+    @Value("${audit.store.jdbc.batchIntervalMs:1000}")
     private int batchIntervalMs;
-    @Value("${jdbc.batchThreshold:500}")
+    @Value("${audit.store.jdbc.batchThreshold:500}")
     private int batchThreshold;
-    @Value("${jdbc.processIntervalMs:100}")
+    @Value("${audit.store.jdbc.processIntervalMs:100}")
     private int processIntervalMs;
-    @Value("${data.queue.size:1000000}")
+    @Value("${audit.store.data.queue.size:1000000}")
     private int dataQueueSize;
 }
diff --git a/inlong-audit/conf/application.properties 
b/inlong-audit/conf/application.properties
index e3843b1161..17fd3461f6 100644
--- a/inlong-audit/conf/application.properties
+++ b/inlong-audit/conf/application.properties
@@ -47,7 +47,7 @@ audit.kafka.consumer.name=inlong-audit-consumer
 audit.kafka.group.id=audit-consumer-group
 
 # Generic jdbc storage
-jdbc.driver=com.mysql.cj.jdbc.Driver
-jdbc.url=jdbc:mysql://127.0.0.1:3306/apache_inlong_audit?characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2b8&rewriteBatchedStatements=true&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
-jdbc.username=root
-jdbc.password=inlong
\ No newline at end of file
+audit.store.jdbc.driver=com.mysql.cj.jdbc.Driver
+audit.store.jdbc.url=jdbc:mysql://127.0.0.1:3306/apache_inlong_audit?characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2b8&rewriteBatchedStatements=true&allowMultiQueries=true&zeroDateTimeBehavior=CONVERT_TO_NULL
+audit.store.jdbc.username=root
+audit.store.jdbc.password=inlong
\ No newline at end of file

Reply via email to