Managing Cloudera Manager Server Logs

You can use the Cloudera Manager Server logs to troubleshoot problems with Cloudera Manager .

Viewing the Cloudera Manager Server Logs

To help you troubleshoot problems, you can view the Cloudera Manager Server log. You can view the logs in the Logs page or in specific pages for the log.

  1. In the left menu, click Diagnostics > Logs.
  2. Next to Sources, select the Cloudera Manager Server checkbox and deselect the other options.
  3. Adjust the search criteria and click Search.

You can also view the raw Cloudera Manager Server log by logging in to the Cloudera Manager Server host and view the /var/log/cloudera-scm-server/cloudera-scm-server.log file.

Setting the Cloudera Manager Server Log Location

You can customize the location of the Cloudera Manager Server log files.

Depending on your requirements, choose one of the following methods:

  • Log-Only Relocation (Recommended): Changes only the log directory path (for example, to /var/log/custom/cloudera-scm-server) without modifying operational state or run directories.

  • Broad Directory Relocation: Changes the parent directory for both logs and operational run directories using the CMF_VAR variable.

Option 1: Relocating only the Cloudera Manager Server Logs (Recommended)
To change the log directory location without altering other operational paths, you can either move your existing log directory to the new location or create a new directory from scratch:
Method A: Moving the existing Log Directory (Preserves existing Logs)
  1. Stop the Cloudera Manager Server:
    sudo systemctl stop cloudera-scm-server
  2. Move the existing log directory to your preferred target location:
    sudo mv /var/log/cloudera-scm-server /var/log/custom/cloudera-scm-server
  3. Open /etc/default/cloudera-scm-server in a text editor and configure the custom log path by appending the -Dcmf.log.dir system property to CMF_JAVA_OPTS:
    export CMF_JAVA_OPTS="$CMF_JAVA_OPTS -Dcmf.log.dir=/var/log/custom/cloudera-scm-server"
  4. Start the Cloudera Manager Server:
    sudo systemctl start cloudera-scm-serve
  5. Verify that the Cloudera Manager Server log files are actively being written to your new custom directory:
    ls -l /var/log/custom/cloudera-scm-server/cloudera-scm-server.log
Method B: Creating a new Custom Log Directory
  1. Stop the Cloudera Manager Server:
    sudo systemctl stop cloudera-scm-server
  2. Create your custom log directory and set ownership to cloudera-scm:
    sudo mkdir -p /var/log/custom/cloudera-scm-server
                                  
                                  sudo chown -R cloudera-scm:cloudera-scm /var/log/custom/cloudera-scm-server
  3. Open /etc/default/cloudera-scm-server in a text editor and configure the custom log path by appending the -Dcmf.log.dir system property to CMF_JAVA_OPTS:
    export CMF_JAVA_OPTS="$CMF_JAVA_OPTS -Dcmf.log.dir=/var/log/custom/cloudera-scm-server"
  4. Start the Cloudera Manager Server:
    sudo systemctl start cloudera-scm-server
  5. Verify that the Cloudera Manager Server log files are actively being written to your new custom directory:
    ls -l /var/log/custom/cloudera-scm-server/cloudera-scm-server.log
Option 2: Relocating the Parent Variable Directory (CMF_VAR)
  1. Stop the Cloudera Manager Server:
    sudo systemctl stop cloudera-scm-server
  2. Move or copy the existing log and run directories to the new base location (for example, /opt) to retain state and existing log files, or create new directories and assign ownership:
    sudo mkdir -p /opt/log/cloudera-scm-server
                        sudo mkdir -p /opt/run/cloudera-scm-server
                        sudo chown -R cloudera-scm:cloudera-scm /opt/log /opt/run
  3. Open /etc/default/cloudera-scm-server in a text editor and set the CMF_VAR environment variable to the new parent directory:
    export CMF_VAR=/opt
  4. Start the Cloudera Manager Server:
    sudo systemctl start cloudera-scm-server