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

Audit Proxy

Configure MessageQueue

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

  • If using Pulsar, the configuration file is conf/audit-proxy-pulsar.conf. Change the Pulsar service url for next configuration.
  1. agent1.sources.tcp-source.port = 10081
  2. agent1.sinks.pulsar-sink-msg1.pulsar_server_url= pulsar://localhost:6650
  3. agent1.sinks.pulsar-sink-msg1.topic = persistent://public/default/inlong-audit
  4. agent1.sinks.pulsar-sink-msg2.pulsar_server_url = pulsar://localhost:6650
  5. 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 master address for next configuration.
  1. agent1.sources.tcp-source.port = 10081
  2. agent1.sinks.tube-sink-msg1.master-host-port-list = localhost:8715
  3. agent1.sinks.tube-sink-msg1.topic = inlong-audit
  4. agent1.sinks.tube-sink-msg2.master-host-port-list = localhost:8715
  5. agent1.sinks.tube-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 [pulsartube]

Audit Store

Configure

The configuration file is conf/application.properties.

  1. # proxy.type: pulsar / tube
  2. audit.config.proxy.type=pulsar
  3. # store.server: mysql / elasticsearch
  4. audit.config.store.mode=mysql
  5. # audit pulsar config (optional), replace PULSAR_BROKER_LIST with your Pulsar service url
  6. audit.pulsar.server.url=pulsar://PULSAR_BROKER_LIST
  7. audit.pulsar.topic=persistent://public/default/inlong-audit
  8. audit.pulsar.consumer.sub.name=sub-audit
  9. # audit tube config (optional), replace TUBE_LIST with your TubeMQ master address
  10. audit.tube.masterlist=TUBE_LIST
  11. audit.tube.topic=inlong-audit
  12. audit.tube.consumer.group.name=inlong-audit-consumer
  13. # mysql
  14. 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
  15. spring.datasource.druid.username=root
  16. spring.datasource.druid.password=inlong

Dependencies

  • If the backend database is MySQL, please download mysql-connector-java-8.0.27.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.