2024年1月19日 星期五

Librenms Docker Windows

Version:

Windows 11p 22631.3007

Docker v4.26.1

Docker Compose version v2.23.3-desktop.2


建一個 docker 用的目錄

D:\dockerDATA\

再建一個 Librenms 專用目錄

D:\dockerDATA\Librenms\


下載官方範本 https://codeload.github.com/librenms/docker/zip/refs/heads/master

解開 docker-master\examples\compose 中的 4 個檔 (.env, compose.yml, msmtpd.env) 到 D:\dockerDATA\Librenms\


powershell>

cd D:\dockerDATA\Librenms\

docker compose -f compose.yml up -d


maridb 無法啟動出錯 

2024-01-19 15:09:11 2024-01-19 08:09:11+01:00 [ERROR] [Entrypoint]: mysqld failed while attempting to check config

2024-01-19 15:09:11     command was: mysqld --innodb-file-per-table=1 --lower_case_table-names=0 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --verbose --help

2024-01-19 15:09:11     2024-01-19  8:09:11 0 [ERROR] The server option 'lower_case_table_names' is configured to use case sensitive table names but the data directory resides on a case-insensitive file system. Please use a case sensitive file system for your data directory or switch to a case-insensitive table name mode.


powershell>

docker compose down

cd D:\dockerDATA\Librenms\

fsutil.exe file queryCaseSensitiveInfo ./db

目錄區分大小寫屬性停用

fsutil.exe file setCaseSensitiveInfo ./db enable

目錄區分大小寫屬性啟用


參考來源:

https://github.com/librenms/docker

https://learn.microsoft.com/zh-tw/windows/wsl/case-sensitivity

5 則留言:

  1. 加上 phpmyadmin
    檢查 docker network ls; 使用 --net librenms_default

    docker run -v ./phpmyadmin_php:/usr/local/etc/php/ --name phpmyadmin -d --link librenms_db -p 8080:80 --net librenms_default -e UPLOAD_LIMIT="300M" phpmyadmin/phpmyadmin

    回覆刪除
  2. 指定 container 的目錄到 windows 目錄
    docker run -v D:\docker_chair\phpmyadmin_php:/usr/local/etc/php/ --name phpmyadmin -d --link librenms_db -p 8080:80 --net librenms_default -e UPLOAD_LIMIT="300M" phpmyadmin/phpmyadmin

    回覆刪除
  3. OS
    #cat /etc/os-release
    NAME="Alpine Linux"
    ID=alpine
    VERSION_ID=3.17.5

    排程
    #crond --help
    -c DIR Cron dir. Default:/var/spool/cron/crontabs

    回覆刪除
  4. phpmyadmin 找不到 php.ini
    ls -all /usr/local/etc/php
    檢查 php.ini 位置
    php -i |grep php.ini
    Configuration File php.ini Path => /usr/local/etc/php

    回覆刪除
  5. nginx -t to check config is good

    nginx -s reload to reload config without restart

    回覆刪除