Installing DMP Producer

This section provides a step-by-step guide to installing DMP Producer.

Prerequisites

Make sure the following things are in place, before installing:

  • Root access to the VM
  • Required software like Java, MySQL, Kafka, must be installed on the VM

To install DMP Producer, follow the steps below:

  1. Copy necessary files to the mount points e.g., /data, /hdd, and create symbolic links.
    ln -s /data/ /disk1/
    ls -al
  2. Link the DMP Producer configuration.
    ln -s /data/config/dmp-producer /mnt/sst
  3. Update the property files like dmp-producer.properties, msk.properties and piistorage.properties.
    • Locate the files at/disk1/config/dmp-producer/dmp-producer.properties, and update the dmp-producer.properties.
      #Kafka producer configurations
      KafkaProducerConfig=
      # Properties for DB e.g., MySQL
      DBConfig=
      #SQS config
      SQSConfig=
      #SES Properties
      SESConfig=
      #SMTP
      SMTPConfig=
    • Locate the /disk1/msk/msk.properties, and update msk.properties.
      # Properties for DB e.g., MySQL
      DBConfig=
    • Locate /disk1/piistorage/config/piistorage.properties, and update piistorage.properties.
      # Properties for DB
      DBConfig=
      # Properties for Aerospike
      AerospikeConfig=
      # Properties for Cron Expression
      CronExpressionConfig=
  4. Copy the DMP Producer JAR file to /disk1/config/dmp-producer/.
    cp /path/to/dmp-producer.jar /disk1/config/dmp-producer/
  5. Create a user for DMP system.
    useradd -c "DMP-System User" cdpservice
    Update the /etc/passwd file to:
    cdpservice:x:1002:1003:DMP-System User:/home/cdpservice:/sbin/nologin
  6. Create a service file at /usr/lib/systemd/system/dmp-producer.service.
    [Unit]
    Description=DMP Producer Service
    After=network.target
    [Service]
    User=cdpservice
    Group=cdpservice
    ExecStart=/usr/bin/java -jar /disk1/config/dmp-producer/dmp-producer.jar
    SuccessExitStatus=143
    StandardOutput=/disk1/logs/dmp-producer/dmp-producer-out.log
    StandardError=/disk1/logs/dmp-producer/dmp-producer-err.log
    Restart=on-failure
    [Install]
    WantedBy=multi-user.target
  7. Set Ownership and Permissions for the user.
    chown -R cdpservice:cdpservice /disk1 /mnt
    touch /disk1/logs/dmp-producer/dmp-producer-out.log
    touch /disk1/logs/dmp-producer/dmp-producer-err.log
    touch /disk1/logs/dmp-producer-gc.log
    chcon -t user_home_t /disk1/logs/dmp-producer/dmp-producer-out.log
    chcon -t user_home_t /disk1/logs/dmp-producer/dmp-producer-err.log
    chcon -t user_home_t /disk1/logs/dmp-producer-gc.log
  8. Start the DMP Producer Service.
    systemctl start dmp-producer
    systemctl status dmp-producer

Troubleshooting

If you encounter issues, use the following commands for troubleshooting:
ls -Z /disk1/logs/dmp-producer/dmp-producer-gc.log
ausearch -m avc -ts recent | audit2allow -M dmp_producer
chcon -t init_var_run_t /disk1/logs/dmp-producer/*
chcon -t init_var_run_t /disk1/logs/dmp-producer-gc.log
ausearch -m avc -ts recent
semodule -i dmp_producer.pp
systemctl start dmp-producer
systemctl status dmp-producer
systemctl stop dmp-producer