Skip to content
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

Move snapshot directory to /var/BeaKer/snapshots #83

Merged
merged 2 commits into from
May 9, 2023

Conversation

caffeinatedpixel
Copy link
Contributor

@caffeinatedpixel caffeinatedpixel commented May 9, 2023

Closes #82

The /opt/BeaKer directory is deleted upon every run of the installer. This means that the snapshots subdirectory and its files are also deleted. This PR moves the snapshots directory to /var/BeaKer/snapshots, which would not get deleted on every install.

Tested on Ubuntu 20.04 & CentOS 7

  • Generated new BeaKer installer
  • Installed new installer over a BeaKer v0.0.13 install
  • Ran ./beaker down && beaker up -d for sanity
  • Ran the installer again to upgrade to Elastic v8.7.0 and created a snapshot
  • Verified that snapshot was created and that the snapshot files were visible in /var/BeaKer/snapshots & /usr/share/elasticsearch/snapshots
  • Ran the installer again to overwrite the v8.7.0 install, verified that the snapshot files were still in the host & container directories

@caffeinatedpixel caffeinatedpixel marked this pull request as ready for review May 9, 2023 21:18
@Zalgo2462
Copy link
Contributor

Zalgo2462 commented May 9, 2023

I tested this PR using the procedure above. During the reinstall of 8.x over itself, I got passed the old error, but I ran into a new error
image

Looking at my env file, the token is present, so I'm not sure why the script did this.

Looking at the script, it appears token_already_valid was false for some reason.

The script attempted to hit the Elastic API with the service token. For some reason, this failed.
Then, the script tried to check if a token already existed using the elastic password. For some reason, this failed.
Then, the script tried to create a new service token, but Elastic returns an error if you try to create a new a token without deleting the old one. As a result, the script crashed.

Perhaps Elastic wasn't really ready by the time the API was called? Running these commands on the cli afterwards seems to work.

@Zalgo2462
Copy link
Contributor

Running the script again, I did not run into this issue. The problem seems to be solved by re-running the installer. So, I'm going to pull this in.

@Zalgo2462 Zalgo2462 merged commit 21c4c2e into master May 9, 2023
@Zalgo2462 Zalgo2462 deleted the 82-snapshot-dir-missing branch May 9, 2023 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Containers fail to start if there is an existing snapshot
2 participants