content:serverbasics:docker-mariadb
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
| content:serverbasics:docker-mariadb [2024/08/04 01:41] – [Backup] obel1x | content:serverbasics:docker-mariadb [2025/06/05 23:40] (aktuell) – [STOP] obel1x | ||
|---|---|---|---|
| Zeile 12: | Zeile 12: | ||
| * Using Sockets, not TCP/IP on the host | * Using Sockets, not TCP/IP on the host | ||
| * Added some tweaks from the net | * Added some tweaks from the net | ||
| + | |||
| + | ====== STOP ====== | ||
| + | |||
| + | This - it turned out is a very bad idea. MariaDB on Docker performs VERY bad. So i would strongly not advise to use Docker for this. Use native mariadb on your host and adept what is written here. | ||
| + | |||
| + | When you link the native mariadb- Socket to the services like this, you will be able to use Mariadb: | ||
| + | |||
| + | < | ||
| + | volumes: | ||
| + | #Bind mount: Socketfile needs to be definied by full filename, not only path! | ||
| + | - / | ||
| + | |||
| + | </ | ||
| + | |||
| + | Or you can use Port 3306 and as host your servername (NOT localhost). | ||
| + | |||
| + | So stop reading here, maybe only adjusting your local mariadb with these values beneath, thats all. | ||
| + | |||
| ===== Create Socket in tmpfs ===== | ===== Create Socket in tmpfs ===== | ||
| Zeile 18: | Zeile 36: | ||
| Create the File ''/ | Create the File ''/ | ||
| - | < | ||
| + | < | ||
| #Type Path Mode UID GID Age Argument | #Type Path Mode UID GID Age Argument | ||
| d / | d / | ||
| Zeile 252: | Zeile 270: | ||
| </ | </ | ||
| + | |||
| ===== Backup ===== | ===== Backup ===== | ||
| - | Backing up MariaDB works like this: | + | Backing up MariaDB |
| < | < | ||
| Zeile 271: | Zeile 290: | ||
| </ | </ | ||
| + | |||
| + | ==== No Docker Service ==== | ||
| + | |||
| + | If you have MariaDB as native Host- Service installed, use: | ||
| + | < | ||
| + | |||
| + | #!/bin/bash | ||
| + | # Makes a Backup of the whole Mariadb | ||
| + | BACKUPFILE=/ | ||
| + | echo " | ||
| + | # Keep one Copy of the old Backup | ||
| + | if [ -f ${BACKUPFILE} ]; then | ||
| + | if [ -f ${BACKUPFILE}.back ]; then | ||
| + | rm ${BACKUPFILE}.back | ||
| + | fi | ||
| + | mv ${BACKUPFILE} ${BACKUPFILE}.back | ||
| + | else | ||
| + | echo "File ${BACKUPFILE} was not found, not removing ${BACKUPFILE}.back" | ||
| + | fi | ||
| + | # for mysql use mysqldump... | ||
| + | / | ||
| + | if [ ! -f ${BACKUPFILE} ]; then | ||
| + | echo " | ||
| + | exit 1 | ||
| + | fi | ||
| + | |||
| + | </ | ||
| + | |||
| ===== Optimizing Tables ===== | ===== Optimizing Tables ===== | ||
content/serverbasics/docker-mariadb.1722728491.txt.gz · Zuletzt geändert: von obel1x
