简体   繁体   English

如何更新 Cassandra system.log 的权限?

[英]How can I update the permissions on Cassandra system.log?

when configured through logback.xml, by default system.log was created with permission set -rw-r----- with cassandra user having ownership.当通过 logback.xml 配置时,默认情况下 system.log 是使用权限集创建的-rw-r----- cassandra 用户拥有所有权。 For exporting logs tried updating -rw-r--r-- to 644 permission, But on logrotation that was reverted by cassandra.对于导出日志,尝试将-rw-r--r--更新为 644 权限,但在 cassandra 恢复的 logrotation 上。

Anyway the privilege for these files can be updated through configuration?不管怎样,这些文件的权限可以通过配置更新吗?

This isn't really a Cassandra question but a filesystem security issue.这实际上不是 Cassandra 问题,而是文件系统安全问题。

Your server has strict permissions for newly-created files.您的服务器对新创建的文件有严格的权限。 In Unix, the user file-creation mode mask ( umask ) determines the permissions when files get created -- Logback doesn't set the permissions so it is not configurable through logback.xml .在 Unix 中,用户文件创建模式掩码 ( umask ) 决定文件创建时的权限——Logback 不设置权限,因此无法通过logback.xml配置。

You need to update the default umask for the Cassandra user so permissions are not so restrictive.您需要更新 Cassandra 用户的默认umask ,以便权限不那么受限。 The default umask is usually set to 022 so the owner has read/write/execute permissions ( 0 ), and everyone else has read access ( 2 ).默认umask通常设置为022 ,因此所有者具有读/写/执行权限 ( 0 ),而其他人都具有读权限 ( 2 )。

The default umask is typically configured in the following locations:默认umask通常配置在以下位置:

  • /etc/profile
  • /etc/bash.bashrc

You can check the current setting by running:您可以通过运行以下命令检查当前设置:

$ umask

You can set default umask for Cassandra by adding it to ~/.bashrc or ~/.bash_profile , for example:您可以通过将其添加到~/.bashrc~/.bash_profile来为 Cassandra 设置默认umask ,例如:

umask 022

If you need assistance, consult your sysadmin team.如果您需要帮助,请咨询您的系统管理员团队。 Cheers!干杯!


Please support the Apache Cassandra community by hovering over the tag then click on the Watch tag button.请将鼠标悬停在标签上,然后单击“ Watch tag ”按钮,支持 Apache Cassandra 社区。 Thanks!谢谢!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM