Deployment

All deploying files at inlong-audit directory, if you use MySQL to store audit data, you need to first create the database through sql/apache_inlong_audit.sql.

  1. # initialize database
  2. mysql -uDB_USER -pDB_PASSWD < sql/apache_inlong_audit.sql

If you use ClickHouse to store audit data, you need to first create the database through sql/apache_inlong_audit_clickhouse.sql.

  1. # initialize database
  2. clickhouse client -u DB_USER --password DB_PASSWD < sql/apache_inlong_audit_clickhouse.sql

Audit Proxy

Configure MessageQueue

You can choose Apache Pulsar, Apache Kafka or InLong TubeMQ as your MessageQueue service:

  • If using Pulsar, the configuration file is conf/audit-proxy-pulsar.conf. Change the Pulsar Topic info.
  1. agent1.sinks.pulsar-sink-msg1.topic = persistent://public/default/inlong-audit
  2. agent1.sinks.pulsar-sink-msg2.topic = persistent://public/default/inlong-audit
  • If using TubeMQ, the configuration file is conf/audit-proxy-tube.conf. Change the TubeMQ Topic info.
  1. agent1.sinks.tube-sink-msg1.topic = inlong-audit
  2. agent1.sinks.tube-sink-msg2.topic = inlong-audit
  • If using Kafka, the configuration file is conf/audit-proxy-kafka.conf. Change the Kafka Topic info.
  1. agent1.sinks.kafka-sink-msg1.topic = inlong-audit
  2. agent1.sinks.kafka-sink-msg2.topic = inlong-audit

Start

  1. # By default, pulsar is used as the MessageQueue, and the audit-proxy-pulsar.conf configuration file is loaded.
  2. bash +x ./bin/proxy-start.sh [pulsartubekafka]

Audit Store

Configure

The configuration file is conf/application.properties.

  1. # proxy.type: pulsar / tube / kafka
  2. audit.config.proxy.type=pulsar
  3. # store.server: mysql / elasticsearch / clickhouse
  4. audit.config.store.mode=mysql
  5. # manger config
  6. manager.hosts=127.0.0.1:8083
  7. proxy.cluster.tag=default_cluster
  8. # audit pulsar config (optional)
  9. audit.pulsar.topic=persistent://public/default/inlong-audit
  10. audit.pulsar.consumer.sub.name=sub-audit
  11. # audit tube config (optional)
  12. audit.tube.topic=inlong-audit
  13. audit.tube.consumer.group.name=inlong-audit-consumer
  14. # kafka config (optional)
  15. audit.kafka.topic=inlong-audit
  16. audit.kafka.consumer.name=inlong-audit-consumer
  17. audit.kafka.group.id=audit-consumer-group
  18. # mysql config
  19. spring.datasource.druid.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
  20. spring.datasource.druid.username=root
  21. spring.datasource.druid.password=inlong
  22. # es config (optional)
  23. elasticsearch.host=127.0.0.1
  24. elasticsearch.port=9200
  25. # clickhouse config (optional)
  26. clickhouse.driver=ru.yandex.clickhouse.ClickHouseDriver
  27. clickhouse.url=jdbc:clickhouse://127.0.0.1:8123/default
  28. clickhouse.username=default
  29. clickhouse.password=default

Dependencies

  • If the backend database is MySQL, please download mysql-connector-java-8.0.28.jar and put it into lib/ directory.

  • If the backend database is PostgreSQL, there’s no need for additional dependencies.

Start

  1. bash +x ./bin/store-start.sh

The default listen port is 10081.