-
-
Save amber46/4a1a8842b35ff26961b8234b0677cdbb to your computer and use it in GitHub Desktop.
pt-heartbeat systemd init script example - percona tookit systemd examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mysql] | |
host=localhost | |
socket=/var/run/mysqld/mysqld.sock | |
[client] | |
host=localhost | |
socket=/var/run/mysqld/mysqld.sock |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
utc | |
replace | |
daemonize | |
pid=/var/run/pt-heartbeat-databasenamehere.pid | |
socket=/var/run/mysqld/mysqld.sock | |
database=databasenamehere | |
table=heartbeat | |
interval=0.01 | |
user=insert_low_privilege_mysql_user_here | |
password=insert_low_privilege_mysql_user_password_here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# pt-heartbeat-databasenamehere systemd service file | |
# | |
[Unit] | |
Description="pt-heartbeat-databasenamehere" | |
After=syslog.target mysql.service | |
Requires=mysql.service | |
[Install] | |
WantedBy=multi-user.target | |
[Service] | |
Type=simple | |
PIDFile=/var/run/pt-heartbeat-databasenamehere.pid | |
ExecStart=/usr/bin/pt-heartbeat "--config=/etc/percona-toolkit/pt-heartbeat-databasenamehere.conf" "--defaults-file=/etc/percona-toolkit/my.cnf" "--update" | |
StandardOutput=syslog | |
StandardError=syslog | |
SyslogIdentifier=pt-heartbeat-databasenamehere | |
Restart=on-abort |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Grants for 'pt_heartbeat'@'10.%' | |
CREATE USER IF NOT EXISTS 'pt_heartbeat'@'10.%'; | |
ALTER USER 'pt_heartbeat'@'10.%' IDENTIFIED WITH 'mysql_native_password' AS 'INSERTREALLYSECUREPASSWORDHERE' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK; | |
GRANT DELETE, INSERT, SELECT, UPDATE ON `databasenamehere`.`heartbeat` TO 'pt_heartbeat'@'10.%'; | |
GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'pt_heartbeat'@'10.%'; | |
-- Grants for 'pt_heartbeat'@'127.0.0.1' | |
CREATE USER IF NOT EXISTS 'pt_heartbeat'@'127.0.0.1'; | |
ALTER USER 'pt_heartbeat'@'127.0.0.1' IDENTIFIED WITH 'mysql_native_password' AS 'INSERTREALLYSECUREPASSWORDHERE' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK; | |
GRANT DELETE, INSERT, SELECT, UPDATE ON `databasenamehere`.`heartbeat` TO 'pt_heartbeat'@'127.0.0.1'; | |
GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'pt_heartbeat'@'127.0.0.1'; | |
-- Grants for 'pt_heartbeat'@'localhost' | |
CREATE USER IF NOT EXISTS 'pt_heartbeat'@'localhost'; | |
ALTER USER 'pt_heartbeat'@'localhost' IDENTIFIED WITH 'mysql_native_password' AS 'INSERTREALLYSECUREPASSWORDHERE' REQUIRE NONE PASSWORD EXPIRE DEFAULT ACCOUNT UNLOCK; | |
GRANT DELETE, INSERT, SELECT, UPDATE ON `databasenamehere`.`heartbeat` TO 'pt_heartbeat'@'localhost'; | |
GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'pt_heartbeat'@'localhost'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment