Skip to content

Docker & Redis Datenbank

Verschoben Linux
  • Ich habe es endlich geschafft, meinen Redis Container so zu starten, das er meine Konfigurationsdatei nutzt und die Daten permanent gespeichert werden. Das hier ist der erfolgreiche Aufruf.

    docker run --name redis -v /local-data/:/data -v /root/redis.conf:/redis-stack.conf -d redis/redis-stack-server:latest
    

    Ok, Docker hat einen ganzen Haufen Parameter zum Einstellen, hier ein Beispiel, nur für docker run

    [frank-ms7c92 ~]# docker run --help
    
    Usage:  docker run [OPTIONS] IMAGE [COMMAND] [ARG...]
    
    Create and run a new container from an image
    
    Aliases:
      docker container run, docker run
    
    Options:
          --add-host list                  Add a custom host-to-IP mapping (host:ip)
      -a, --attach list                    Attach to STDIN, STDOUT or STDERR
          --blkio-weight uint16            Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
          --blkio-weight-device list       Block IO weight (relative device weight) (default [])
          --cap-add list                   Add Linux capabilities
          --cap-drop list                  Drop Linux capabilities
          --cgroup-parent string           Optional parent cgroup for the container
          --cgroupns string                Cgroup namespace to use (host|private)
                                           'host':    Run the container in the Docker host's cgroup namespace
                                           'private': Run the container in its own private cgroup namespace
                                           '':        Use the cgroup namespace as configured by the
                                                      default-cgroupns-mode option on the daemon (default)
          --cidfile string                 Write the container ID to the file
          --cpu-period int                 Limit CPU CFS (Completely Fair Scheduler) period
          --cpu-quota int                  Limit CPU CFS (Completely Fair Scheduler) quota
          --cpu-rt-period int              Limit CPU real-time period in microseconds
          --cpu-rt-runtime int             Limit CPU real-time runtime in microseconds
      -c, --cpu-shares int                 CPU shares (relative weight)
          --cpus decimal                   Number of CPUs
          --cpuset-cpus string             CPUs in which to allow execution (0-3, 0,1)
          --cpuset-mems string             MEMs in which to allow execution (0-3, 0,1)
      -d, --detach                         Run container in background and print container ID
          --detach-keys string             Override the key sequence for detaching a container
          --device list                    Add a host device to the container
          --device-cgroup-rule list        Add a rule to the cgroup allowed devices list
          --device-read-bps list           Limit read rate (bytes per second) from a device (default [])
          --device-read-iops list          Limit read rate (IO per second) from a device (default [])
          --device-write-bps list          Limit write rate (bytes per second) to a device (default [])
          --device-write-iops list         Limit write rate (IO per second) to a device (default [])
          --disable-content-trust          Skip image verification (default true)
          --dns list                       Set custom DNS servers
          --dns-option list                Set DNS options
          --dns-search list                Set custom DNS search domains
          --domainname string              Container NIS domain name
          --entrypoint string              Overwrite the default ENTRYPOINT of the image
      -e, --env list                       Set environment variables
          --env-file list                  Read in a file of environment variables
          --expose list                    Expose a port or a range of ports
          --gpus gpu-request               GPU devices to add to the container ('all' to pass all GPUs)
          --group-add list                 Add additional groups to join
          --health-cmd string              Command to run to check health
          --health-interval duration       Time between running the check (ms|s|m|h) (default 0s)
          --health-retries int             Consecutive failures needed to report unhealthy
          --health-start-period duration   Start period for the container to initialize before starting health-retries countdown (ms|s|m|h) (default 0s)
          --health-timeout duration        Maximum time to allow one check to run (ms|s|m|h) (default 0s)
          --help                           Print usage
      -h, --hostname string                Container host name
          --init                           Run an init inside the container that forwards signals and reaps processes
      -i, --interactive                    Keep STDIN open even if not attached
          --ip string                      IPv4 address (e.g., 172.30.100.104)
          --ip6 string                     IPv6 address (e.g., 2001:db8::33)
          --ipc string                     IPC mode to use
          --isolation string               Container isolation technology
          --kernel-memory bytes            Kernel memory limit
      -l, --label list                     Set meta data on a container
          --label-file list                Read in a line delimited file of labels
          --link list                      Add link to another container
          --link-local-ip list             Container IPv4/IPv6 link-local addresses
          --log-driver string              Logging driver for the container
          --log-opt list                   Log driver options
          --mac-address string             Container MAC address (e.g., 92:d0:c6:0a:29:33)
      -m, --memory bytes                   Memory limit
          --memory-reservation bytes       Memory soft limit
          --memory-swap bytes              Swap limit equal to memory plus swap: '-1' to enable unlimited swap
          --memory-swappiness int          Tune container memory swappiness (0 to 100) (default -1)
          --mount mount                    Attach a filesystem mount to the container
          --name string                    Assign a name to the container
          --network network                Connect a container to a network
          --network-alias list             Add network-scoped alias for the container
          --no-healthcheck                 Disable any container-specified HEALTHCHECK
          --oom-kill-disable               Disable OOM Killer
          --oom-score-adj int              Tune host's OOM preferences (-1000 to 1000)
          --pid string                     PID namespace to use
          --pids-limit int                 Tune container pids limit (set -1 for unlimited)
          --platform string                Set platform if server is multi-platform capable
          --privileged                     Give extended privileges to this container
      -p, --publish list                   Publish a container's port(s) to the host
      -P, --publish-all                    Publish all exposed ports to random ports
          --pull string                    Pull image before running ("always", "missing", "never") (default "missing")
      -q, --quiet                          Suppress the pull output
          --read-only                      Mount the container's root filesystem as read only
          --restart string                 Restart policy to apply when a container exits (default "no")
          --rm                             Automatically remove the container when it exits
          --runtime string                 Runtime to use for this container
          --security-opt list              Security Options
          --shm-size bytes                 Size of /dev/shm
          --sig-proxy                      Proxy received signals to the process (default true)
          --stop-signal string             Signal to stop the container
          --stop-timeout int               Timeout (in seconds) to stop a container
          --storage-opt list               Storage driver options for the container
          --sysctl map                     Sysctl options (default map[])
          --tmpfs list                     Mount a tmpfs directory
      -t, --tty                            Allocate a pseudo-TTY
          --ulimit ulimit                  Ulimit options (default [])
      -u, --user string                    Username or UID (format: <name|uid>[:<group|gid>])
          --userns string                  User namespace to use
          --uts string                     UTS namespace to use
      -v, --volume list                    Bind mount a volume
          --volume-driver string           Optional volume driver for the container
          --volumes-from list              Mount volumes from the specified container(s)
      -w, --workdir string                 Working directory inside the container
    

    Wir zerlegen das mal und schauen uns das Stück für Stück an. So das ich es hoffentlich dann verstehe und es auch für andere Container benutzen kann.

    docker run # Create and run a new container from an image
    

    Das ist einfach und gut zu verstehen 🙂

    --name redis # Assign a name to the container
    

    Auch nicht wirklich schwer.

    -v /local-data/:/data # Bind mount a volume
    

    Jetzt wird es endlich mal komplexer. Wir mounten einen lokalen Ordner /local-data/ Die schlanke Anleitung dazu, direkt von Docker.

    -v or --volume: Consists of three fields, separated by colon characters (:). The fields must be in the correct order, and the meaning of each field is not immediately obvious.

    In the case of named volumes, the first field is the name of the volume, and is unique on a given host machine. For anonymous volumes, the first field is omitted.

    The second field is the path where the file or directory are mounted in the container.

    The third field is optional, and is a comma-separated list of options, such as ro. These options are discussed below.

    Der Doppelpunkt dient als Trennzeichen. Und /data ist der Ordner im Docker Container. Als Zusammenfassung.

    1. /local-data/ # Lokaler Ordner auf dem Host
    2. Doppelpunkt als Trennzeichen
    3. /data # Ordner innerhalb des Docker Containers

    /local-data

    [frank-ms7c92 local-data]# ls -lha
    insgesamt 4,0K
    drwxr-xr-x 1 root root  16  7. Mär 19:10 .
    drwxr-xr-x 1 root root 272  7. Mär 19:01 ..
    -rw-r--r-- 1 root root 944  7. Mär 19:10 dump.rdb
    

    /data

    root@503c1b403529:/data# ls -lha
    total 4.0K
    drwxr-xr-x 1 root root  16 Mar  7 18:10 .
    drwxr-xr-x 1 root root 240 Mar  7 18:01 ..
    -rw-r--r-- 1 root root 944 Mar  7 18:10 dump.rdb
    

    Was mir aktuell noch unklar ist, wo wird Redis mitgeteil, die Daten in /data abzulegen? In meiner Konfiguration ist das nicht gesetzt? Ok schauen wir mal weiter, vielleicht wird es noch heller..

    -v /root/redis.conf:/redis-stack.conf  # Bind mount a volume
    

    Das jetzt in Kurzform, meine Konfiguration liegt auf dem Host im Rootverzeichnis und soll in den Container.

    1. /root/redis.conf # Konfiguration, liegt auf dem Host
    2. Doppelpunkt als Trennzeichen
    3. redis-stack.conf # Die Datei im Container

    Eben meine aktuelle Testkonfiguration

    bind 0.0.0.0
    port 6379
    databases 16
    pidfile /var/run/redis/redis-server.pid
    save 60 1
    #save 900 1
    save 300 10
    save 60 10000
    stop-writes-on-bgsave-error yes
    rdbcompression yes
    rdbchecksum yes
    dbfilename dump.rdb
    dir /
    

    Ich vermute, das die Angabe des Arbeitsverzeichnisses ( dir / ) dazu führt, das die redis-stack.conf im Rootverzeichnis auftaucht. Mir ist aktuell unklar, warum Redis die jetzt benutzt? Macht das Docker selbstständig?

    Ich weiß das sie auf alle Fälle geladen und auch benutzt wird. Habe ich über das Einstellen des Ports ausprobiert.

    Ok, hier kurz die Frage, warum taucht das dump.rdb im /data Verzeichnis auf? Macht das Docker von alleine?

    Ihe seht, ich habe hier leider immer noch viel Fragezeichen....

    -d # Run container in background and print container ID
    

    Das ist wieder etwas einfacher. Das startet den Docker Container als Daemon im Hintergrund. Kann man einfach mal ausprobieren und das -d weglassen, dann seht ihr was ich meine 😉

     redis/redis-stack-server:latest # Image
    

    Das ist das Image, was zum Bau des Docker Containers benutzt wird.

  • @FrankM sagte in Docker & Redis Datenbank:

    save 60 1
    #save 900 1
    save 300 10
    save 60 10000

    Hier kann man auch noch schön sehen, wie ich gekämpft habe, bis ich mal eine dump.rdb gesehen habe. Auch irgendwie logisch, das ich nie eine gesehen hatte, wenn man weiß das

    save 900 1
    

    bedeutet, das er alle 900 Sekunden speichert, wenn mindestens eine Änderung vorhanden ist. Das kann dann schon was dauern. Ich habe das dann mal verkürzt, damit ich schneller ein Ergebnis habe.

    save 60 1
    

    Das brachte mich dann dem Ziel näher. Danach konnte ich die dump.rdb auch finden.

    Bitte keine Redis DB ohne Passwort laufen lassen!

  • FrankMF FrankM verschob dieses Thema von Privat am

  • Redis Insight - Desktop UI

    Redis
    1
    0 Stimmen
    1 Beiträge
    74 Aufrufe
    Niemand hat geantwortet
  • 0 Stimmen
    2 Beiträge
    377 Aufrufe
    FrankMF

    Ok, ich war leider nicht in der Lage den CODE-Server hinter einem Proxy zu installieren. Das CODE-Team scheint Docker zu lieben und das andere nur am Rande zu machen. Ohne Liebe 🙂

    Da ich extrem lange Ladezeiten hatte und die Software insgesamt nicht den Eindruck machte, das man das gerne produktiv auf einem Server nutzen möchte, habe ich den Server eben wieder gelöscht.

    Jetzt fehlt mir leider, die deepl.com Anbindung, aber das kann man ja auch über die Webseite nutzen.

    Ich nutze jetzt wieder den eingebauten CODE-Server, der eigentlich ein App-Image ist.

    28c41010-5ce1-4f7c-89d5-1c9b253011d0-grafik.png

    Der klare Vorteil, es läuft incl. Dokumenten Freigabe 🙂

    Nicht vergessen, unter Allow list for WOPI requests kommen die Server Adressen des Nextcloud-Webservers rein!

    c1a06c2c-86b5-4750-a062-7ba9d8dd8253-grafik.png

  • 0 Stimmen
    3 Beiträge
    2k Aufrufe
    FrankMF

    Das mit den Namen der btrfs Subvolumes ist bekannt bei Timeshift. Im Readme steht dazu folgendes.

    BTRFS volumes

    BTRFS volumes must have an Ubuntu-type layout with @ and @home subvolumes. Other layouts are not supported. Systems having the @ subvolume and having /home on a non-BTRFS partition are also supported.

    Text file busy / btrfs returned an error: 256 / Failed to create snapshot can occur if you have a Linux swapfile mounted within the @ or @home subvolumes which prevents snapshot from succeeding. Relocate the swapfile out of @ or *@home, for example into it's own subvolume like @swap.

  • Docker - Portainer

    Linux
    3
    0 Stimmen
    3 Beiträge
    606 Aufrufe
    FrankMF

    Dann grabe ich das mal wieder aus 😉

    Bedingt durch den Wegfall meines Proxmox, musste ich mir Gedanken darüber machen, wie ein paar Dienste auch weiterhin laufen sollen. Um mal die zwei wichtigsten zu nennen.

    checkmk DokuWiki

    Diese sollen später, wenn der zweite NanoPi R5S aus China da ist, dort laufen. Da der aber mit der Schneckenpost kommt, kann man ja in der Zwischenzeit mal wieder mit Docker spielen.

    Ich erinnerte mich daran, das checkmk eine sehr gute Anleitung hat, so das ich das mal wieder ausprobierte. Klappte einwandfrei. Dann erinnerte mich an Portainer und dachte mir, das probiere ich mal wieder aus 🙂

    1d2dc9b3-ad71-45c5-b552-72c88a1bf773-grafik.png

    Ich hatte übrigens die Endpoints gesucht und nicht gefunden, die heißen jetzt Environments. Auf dem Bild ist noch keiner eingerichtet.

    4bdbf196-1b36-4e65-94d0-0e56daa473bf-grafik.png

    Irgendwie ist das wirklich richtig gute Software. Ich mag den Portainer und auch als selbst ausgebildeter ITler 😉 kommt man damit sehr schnell ganz gut zurecht.

    Ja, man kann die ganzen Docker Befehle auch über die Konsole eingeben, was ich normalerweise auch mit ganz vielen Dingen mache, aber das macht hier einfach Spaß. Man hat auch schnell einen guten Überblick was wo läuft usw.

    Wer so was sucht, einfach mal ausprobieren. Klare Empfehlung von mir.

  • Projekt Ryzen7 & X570 Mainboard

    Linux
    25
    0 Stimmen
    25 Beiträge
    2k Aufrufe
    FrankMF

    Nach sehr langer Zeit, habe ich heute mal wieder ein aktuelles BIOS geflashed.

    9f33e13e-92f8-452e-b238-5469bdc6d571-grafik.png

    Link Preview Image MPG X570 GAMING PLUS

    Satisfying gamers with what they really need, MPG X570 GAMING PLUS is equipped with Extended Heatsink Design, Frozr Heatsink Design, Core boost, Lightning Gen4 M.2, M.2 Shield Frozr accessory, Game Boost, Turbo USB and MSI latest Dragon Center. Black and

    favicon

    (de.msi.com)

    20220409_084823.jpg

    20220409_084852.jpg

    Danach Neustart, bootet wie es soll. Damit wäre mein Mainboard kompatibel für den wohl letzten Prozessor auf dem AM4 basierenden Board.

    Ryzen 7 5800X3D

    Gamestar schreibt dazu

    AMD möchte mit einem neuen Prozessor noch einmal ein Spitzenmodell für Spieler bringen, welches auf dem aktuellen Sockel AM4 basiert. Künftige Modelle werden auf einen neuen Sockel namens AM5 setzen. Der wohl letzte Prozessor für mit AM4 und damit auch die Zen-3-Architektur bringt aber noch eine Besonderheit mit sich.
    Quelle: https://www.gamestar.de/artikel/ryzen-7-5800x3d-tests-spieler,3379594.html

    Das PC Magazin schreibt zu Preis und Verfügbarkeit

    Am 15. März hat AMD den Preis und die Verfügbarkeit des Ryzen 7 5800X3D bekannt gegeben. Demnach wird die neue CPU mit 3D V-Cache am 20. April zu einer UVP von 449 US-Dollar ( rund 408 Euro) erscheinen.
    Quelle: https://www.pc-magazin.de/ratgeber/amd-ryzen-7-5800-prozessor-cpu-infos-preis-release-specs-3202912.html

    Ich bin sehe gespannt, ob der USB-Bug endlich behoben wurde. Ihr erinnert Euch? Wenn ich komplett neu starte, dann kann ich keine Eingabe machen. Tastatur und Maus ohne Funktion.

    Ich verrate Euch sicherlich nicht zu viel, wenn ich aktuell eine Neuanschaffung plane, so ein AM5 Brett würde mich schon reizen 🙂 Denke, das war der letzte Beitrag zu diesem Projekt 😉

  • IPTV Telekom & IPFire - igmpproxy

    Linux
    1
    0 Stimmen
    1 Beiträge
    617 Aufrufe
    Niemand hat geantwortet
  • Upgrade auf NodeBB 1.11.0

    NodeBB
    1
    0 Stimmen
    1 Beiträge
    362 Aufrufe
    Niemand hat geantwortet
  • Installation von Grav & NGinx & PHP7.2

    Angeheftet Verschoben Grav
    2
    0 Stimmen
    2 Beiträge
    1k Aufrufe
    FrankMF

    Nachdem ich den ROCKPro64 jetzt auf den Mainline umgestellt habe, lief meine Testinstallation von Grav nicht mehr.

    Hilfreiche Sache um das Problem zu lösen -> https://gist.github.com/GhazanfarMir/03bd1f1f770a3834d47274586d46ea62

    Ich bekam immer 502 Bad Gateway, Grund war ein nicht korrekt gestarteter php-pfm Service.

    rock64@rockpro64v2_0:/usr/local/bin$ sudo service php7.2-fpm start rock64@rockpro64v2_0:/usr/local/bin$ sudo service php7.2-fpm status ● php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2018-08-16 20:15:20 CEST; 21s ago Docs: man:php-fpm7.2(8) Main PID: 3206 (php-fpm7.2) Status: "Processes active: 0, idle: 2, Requests: 3, slow: 0, Traffic: 0.2req/sec" Tasks: 3 (limit: 4622) CGroup: /system.slice/php7.2-fpm.service ├─3206 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf) ├─3207 php-fpm: pool www └─3208 php-fpm: pool www Aug 16 20:15:19 rockpro64v2_0 systemd[1]: Starting The PHP 7.2 FastCGI Process Manager... Aug 16 20:15:20 rockpro64v2_0 systemd[1]: Started The PHP 7.2 FastCGI Process Manager.