Reply
Highlighted
LuQ
New Contributor
Posts: 1
Registered: ‎10-04-2018

Custom Parcel and CSD occur logging permission denied when running as non-root user

Hi,

 

I have a custom Parcel and CSD for Alluxio. If the CSD is run as `user:root, group:root`, no errors occur.

 

However, if I run CSD as `user:alluxio, group:alluxio`, then errors occur when starting Alluxio roles with exception:

 

Failed to log to /var/log/alluxio/alluxio-master-${host}.log: Permission denied

 

In my Alluxio Parcel  /meta/parcel.json I had

 

"users": {
"alluxio": {
"extra_groups": [],
"home": "/var/lib/alluxio",
"longname": "Alluxio",
"shell": "/sbin/nologin"
}
},
"groups": [
"alluxio"
]

 

In my csd, I added logging for each role 

  "roles" : [
    {
      "name" : "ALLUXIO_MASTER",
      "label" : "Master",
      "pluralLabel" : "Masters",
      "jvmBased": true,
      "startRunner" : {
        "program" : "scripts/control.sh",
        "args" : [ "start_master" ],
        "environmentVariables" : {
          "ALLUXIO_HOST": "${host}",
          "ALLUXIO_USER":"${user}",
          "ALLUXIO_ADDITIONAL_PROPERTIES" : "${alluxio_additional_properties}"
        }
      },
      "logging" : {
        "configFilename" : "alluxio-conf/log4j.properties",
        "dir" : "/var/log/alluxio",
        "filename" : "alluxio-master-${host}.log",
        "modifiable" : true,
        "loggingType" : "log4j"
      },

 

Here are my questions:

(1) Will Cloudera Manager create user:alluxio, group:alluxio for me in all the hosts of pre-defined cluster?

(2) Will Cloudera Manager create the folder /var/log/alluxio for me together with permission that allows  user:alluxio

to write files in this folder?

 

Need help to work around the logging permission denied issue. Any suggestions?

 

Thanks for the help!

Lu

Announcements