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

Installation Instructions #191

Open
CodeBleu opened this issue Nov 3, 2024 · 4 comments
Open

Installation Instructions #191

CodeBleu opened this issue Nov 3, 2024 · 4 comments

Comments

@CodeBleu
Copy link

CodeBleu commented Nov 3, 2024

@rikonen
@rdunklau
@aiven-amartin

What can we help you with?

How do I install this?

Where would you expect to find this information?

README

@CodeBleu
Copy link
Author

@rikonen pretty please? I would really like to use this software, but there is no clear docs on how to actually install this (Ubuntu in my case)

@rikonen
Copy link
Contributor

rikonen commented Nov 13, 2024

I'm not really working on the project anymore. There is currently no support packaging this for Ubuntu specifically unfortunately. In general the expectation is that user mysql is used to run both MyHoard and MySQL server, MySQL server is managed via systemd and the unit name is mysqld, the following is defined in sudoers

mysql   ALL=(ALL) NOPASSWD: /usr/bin/systemctl start mysqld
mysql   ALL=(ALL) NOPASSWD: /usr/bin/systemctl stop mysqld
mysql   ALL=(ALL) NOPASSWD: /usr/bin/systemctl restart mysqld
mysql   ALL=(ALL) NOPASSWD: /usr/bin/myhoard_mysql_env_update -f /etc/systemd/system/mysqld.environment -b false -g false
mysql   ALL=(ALL) NOPASSWD: /usr/bin/myhoard_mysql_env_update -f /etc/systemd/system/mysqld.environment -b false -g true
mysql   ALL=(ALL) NOPASSWD: /usr/bin/myhoard_mysql_env_update -f /etc/systemd/system/mysqld.environment -b true -g false
mysql   ALL=(ALL) NOPASSWD: /usr/bin/myhoard_mysql_env_update -f /etc/systemd/system/mysqld.environment -b true -g true

, /usb/bin/myhoard and /usr/bin/myhoard_mysql_env_update are executable files that run myhoard.py and myhoard_mysql_env_update.py python modules respectively, and the myhoard.json file is updated according to your configuration to contain appropriate parameters. The myhoard.unit file has an example of how to configure systemd service for MyHoard itself.

@CodeBleu
Copy link
Author

@rikonen Thank you for the reply.

  • So, is there no other "install" before any of that is configured for service account or permissions?
  • Do I need to do a pip install ?

@CodeBleu
Copy link
Author

@rikonen I was able to get things workong ( I believe ).

I connected as the mysql user and:

  • git cloned repo into /tmp directory
  • copied the myhoard dir into /var/lib/myhoard and gave it mysql user/group permissions
  • used python3 -m venv /var/lib/myhoard/venv to create a virtual environment
  • activated the virtual env with source /var/lib/myhoard/venv/bin/activate
  • pip install -e . (from within the /tmp/myhoard directory)
  • updated the service file (with path to virtualenv in ExecStart and some other tweaks) ( see below )
  • made changes to myhoard.json config file
[Unit]
Description=MySQL streaming backup service

[Service]
User=mysql
Group=mysql
Type=notify
Restart=always
RestartSec=5s
Type=forking
KillMode=process
TimeoutSec=60s
ExecStart=/bin/bash -c '/var/lib/myhoard/venv/bin/myhoard --config /var/lib/myhoard/myhoard.json & echo "Service started"'
ExecStop=/bin/kill -TERM $MAINPID
ExecReload=/bin/kill -HUP $MAINPID
WorkingDirectory=/var/lib/myhoard
# Percona XtraBackup needs to keep all database tables open simultaneously and it inherits our
# nofile limit. Set to very large number to allow it to operate in large environments
LimitNOFILE=2000000

[Install]
WantedBy=multi-user.target

Now my questions are:

  1. I do not have a /etc/systemd/system/mysqld.environment file and not sure what goes in there or what it's for? My systemd service name for mysql is mysql not mysqld
  2. How can I validate the backup is good without restoring it?
  3. Is it possible to do a restore on the master mysql server?

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

No branches or pull requests

2 participants