moosefs / moosefs

MooseFS Distributed Storage – Open Source, Petabyte, Fault-Tolerant, Highly Performing, Scalable Network Distributed File System / Software-Defined Storage
https://moosefs.com
GNU General Public License v2.0
1.69k stars 207 forks source link

[FEATURE] Log error message when /etc/mfs files inaccessible #457

Open deltabweb opened 3 years ago

deltabweb commented 3 years ago

Have you read through available documentation, open Github issues and Github Ideas Discussions?

Yes

System information

Your moosefs version and its origin (moosefs.com, packaged by distro, built from source, ...).

3.0.116 built from source

Operating system (distribution) and kernel version.

Armbian 21.08.2 (Debian Buster based) - Kernel 5.4.142-odroidxu4

Hardware / network configuration, and underlying filesystems on master, chunkservers, and clients.

Odroid HC1

How much data is tracked by moosefs master (order of magnitude)?

I don't think it's relevant here

Describe your request:

What new feature would you like to see implemented in MooseFS?

Add an error message to logs if /etc/mfs/mfschunkserver.cfg, /etc/mfs/mfshdd.cfg or any other config file needed by MooseFS can't be read because of access rights.

The error message could be something like init: Could not open "/etc/mfs/mfshdd.cfg". Check that the config file exists and that the user "mfs" can read it.

I suppose that the path to the config file and the user name can be dynamic based on settings.

Why this feature? Is it a necessity or a nice to have? Is this feature related to any other features or problems in the open issues?

Long story short, I added a new chunkserver to my cluster and mfschunkserver wouldn't start. This is the output I got at startup:

mfschunkserver[25412]: open files limit has been set to: 16384
open files limit has been set to: 16384
mfschunkserver[25412]: set gid to 117
mfschunkserver[25412]: set uid to 110
working directory: /var/lib/mfs
lockfile created and locked
mfschunkserver[25412]: setting glibc malloc arena max to 4
setting glibc malloc arena max to 4
mfschunkserver[25412]: setting glibc malloc arena test to 4
setting glibc malloc arena test to 4
mfschunkserver[25412]: out of memory killer disabled
mfschunkserver[25412]: monotonic clock function: clock_gettime
mfschunkserver[25412]: monotonic clock speed: 3787 ops / 10 mili seconds
initializing mfschunkserver modules ...
mfschunkserver[25412]: init: hdd space manager failed !!!
init: hdd space manager failed !!!
error occurred during initialization - exiting
mfschunkserver[25412]: exititng ...
exititng ...
mfschunkserver[25412]: process exited successfully (status:1)
process exited successfully (status:1)

It took me a while to find out that the reason I was getting this error message was because /etc/mfs/mfshdd.cfg was not accessible by the mfs user. An error message would have saved me a lot of time.

Steps to reproduce

  1. Change /etc/mfs/mfshdd.cfg owner to root and access rights to 600
  2. Start mfschunkserver

PS: Typo in logs

While fixing this error you might want to also fix the typo at the end of the logs saying exititng instead of exiting

chogata commented 3 years ago

Hi @deltabweb

Thank you for this, it's a perfectly reasonable request. We're gonna add some logs pertaining to config files and problems with them.