New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ElasticSearch 1.6 fails to start with an empty/missing fstab #12018
Comments
It looks up the type of filesystem I think to determine whether it is an SSD or not, as that changes the default number of merge threads. @mikemccand any ideas here? |
For 1.x we use this for for diagnostics (log filesystem type, mount point, free space for each path.data on node init) and from JmxFsProbe (pulling "fs" node stats). This was done in #10502 and #10527 ... In 2.0 we also log the spins detection (SSD or not). Currently ES does not default merge schedule defaults according to spins; rather, we always use aggressive settings (more than one merge thread). I'm not sure we should change to Lucene's defaults... that could be a sudden change on ES users upgrading. Before, JmxFsProbe would only call Files.getFileStore API when you asked for fs stats (and sigar wasn't used), so you wouldn't hit this unless you pulled fs stats w/o sigar, but now we cache the FileStore on init instead. |
@mikemccand so what should we do in this case (freebsd jail) where there is not fstab? |
@peikk0 Can you configure your jail to include an fstab? I don't have much experience with jails in FreeBSD but on some quick googling it seems like this is possible, e.g. https://forums.freebsd.org/threads/jail-conf.34741/ |
Those fstab are used by the host and are not visible inside the jail. Jails are not allowed to mount anything by default anyway and don't have access to devices, or else it could compromise the host and other jails. Anyways, even if I create a fake fstab in the jail, it still won't start:
IMO, a proper fix would be to catch the exception and use a safe default in this case. |
I don't think thats necessarily safe. Its abnormal that you cannot retrieve information from the filestore. I don't think we should hide the error condition. |
also keep in mind, I think the filestore is used to know the amount of disk space. |
/etc/fstab is not a reliable source anyway, it defines what should be mounted, but not what actually is. How about simply using the output of |
Those are issues to take up with the bsd port of the openjdk IMO. we are just using the only way in java to do it, and thats to call Files.getFileStore |
It sounds like this configuration can't be supported - we need access to this info, and we rely on Java to provide it. Closing |
I just ran into this problem – it’s exceedingly unhelpful behaviour for those of us wishing to jail elasticsearch. |
You need to open issues with oracle about it. There is nothing we can do. |
I've read it works fine with OpenJDK 8, I haven't tried it yet though. |
@peikk0, thank you for the pointer. Unfortunately, that doesn’t seem to be the case, at least in my configuration (I have a data directory nullfs mounted into the jail’s directory hierarchy). I have OpenJDK8 installed (and uninstalled OpenJDK7 just to make sure that JDK 8 is being used), but I still encounter the problem. |
Having investigated this a little further, it seems that setting the jail’s
Perhaps this information will be useful to anyone else who encounters this issue. |
Good catch! I just tried it and it works with OpenJDK 7 too! |
Nice solution! I think we should return this information in the error if we hit exception trying to pull the filestores on freebsd. I will take care of it. |
…e_statfs=1 We can't track disk usage in this situation, failing is the correct thing to do. But we can give a FreeBSD-specific error message, so the user can set the necessary jail parameters, versus a vague IOException. Closes elastic#12018
…e_statfs=1 We can't track disk usage in this situation, failing is the correct thing to do. But we can give a FreeBSD-specific error message, so the user can set the necessary jail parameters, versus a vague IOException. Closes #12018
…e_statfs=1 We can't track disk usage in this situation, failing is the correct thing to do. But we can give a FreeBSD-specific error message, so the user can set the necessary jail parameters, versus a vague IOException. Closes #12018
I have experienced the same problem on Linux (so no jails, no chroot) when the path.data is in a BTRFS subvolume that is not mounted. |
This is still an issue on Linux. |
I am running into this on Linux. I don't think it is right for elasticsearch to go through that much magic to determine if locking should work. At the very least, I'd expect it to at least try to lock rather than exiting with an error "Failed to obtain node lock" although the conditions are right. |
@remram44 are you running this on linux with no virtualization? without an |
I'm running from a chroot, so there is no entry in |
Moving the directory I chroot, creating an empty dir where it was and mounting the new location to the old with |
Was this ever solved? I'm trying to setup elastic in an iocage with Version: 6.2.4, Build: ccec39f/2018-04-12T20:37:28.497551Z, JVM: 1.8.0_162 The iocage is running directly on an SSD with /var/db/elasticsearch mounted as nullfs from the host on a mechanical drive. |
In my world with elasticsearch 7.3.1 I still need to apply above bind-mount workaround from @remram44. |
Hi,
I'm running ES in a FreeBSD jail, so there is no fstab and no mount point visible. And since I upgraded ES to version 1.6, it no longer start because it fails to obtain a lock because "Mount point not found in fstab" (file permissions are ok).
Why does it even need to access /etc/fstab just to obtain a lock?
The text was updated successfully, but these errors were encountered: