1
0
Fork 0
mirror of https://github.com/librenms/docker.git synced 2026-01-23 18:25:09 +00:00

remove memcached more

standalone -> monolithic
re-arrange docs
This commit is contained in:
Tony Murray 2022-07-13 07:12:38 -05:00
parent 4fc86317c8
commit d567bdfd04
No known key found for this signature in database
GPG key ID: E57F02A35A950069
16 changed files with 57 additions and 71 deletions

View file

@ -27,19 +27,19 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
* [Dispatcher service](doc/docker/environment-variables.md#dispatcher-service) as "sidecar" container
* Syslog-ng support through a ["sidecar" container](doc/docker/environment-variables.md#syslog-ng)
* Snmp-trap support through a ["sidecar" container](doc/docker/environment-variables.md#snmptrapd)
* Sidecar modular service mode or stand-alone mode
* Sidecar modular service mode or monolitic mode
* Built-in LibreNMS [Weathermap plugin](https://docs.librenms.org/Extensions/Weathermap/)
* Ability to add custom Monitoring plugins
* Ability to add custom alert templates
* OPCache enabled to store precompiled script bytecode in shared memory
* [s6-overlay](https://github.com/just-containers/s6-overlay/) as process supervisor
* [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates (see [this template](examples/traefik))
* [Memcached](https://github.com/docker-library/memcached) image ready to use for better scalability
* [RRDcached](https://github.com/crazy-max/docker-rrdcached) image ready to use for data caching and graphs
* [Redis](https://github.com/docker-library/redis) image ready to use for better scalability
* [RRDcached](https://github.com/crazy-max/docker-rrdcached) Either by sidecar or external image for data caching and graphs
* [msmtpd SMTP relay](https://github.com/crazy-max/docker-msmtpd) image to send emails
* [MariaDB](https://github.com/docker-library/mariadb) image as database instance
## Quick Start
## Docker Compose Recipes
Visit the [usage documentation](doc/usage.md) and run the stand-alone docker compose.

View file

@ -13,6 +13,16 @@
* `REAL_IP_FROM`: Trusted addresses that are known to send correct replacement addresses (default `0.0.0.0/32`)
* `REAL_IP_HEADER`: Request header field whose value will be used to replace the client address (default `X-Forwarded-For`)
* `LOG_IP_VAR`: Use another variable to retrieve the remote IP address for access [log_format](http://nginx.org/en/docs/http/ngx_http_log_module.html#log_format) on Nginx. (default `remote_addr`)
* `REDIS_HOST`: Redis host for poller synchronization
* `REDIS_SENTINEL`: Redis Sentinel host for high availability Redis cluster
* `REDIS_SENTINEL_SERVICE`: Redis Sentinel service name (default `librenms`)
* `REDIS_SCHEME`: Redis scheme (default `tcp`)
* `REDIS_PORT`: Redis port (default `6379`)
* `REDIS_PASSWORD`: Redis password
* `REDIS_DB`: Redis database (default `0`)
* `REDIS_CACHE_DB`: Redis cache database (default `1`)
* `SESSION_DRIVER`: [Driver to use for session storage](https://github.com/librenms/librenms/blob/master/config/session.php) (default `file`)
* `CACHE_DRIVER`: [Driver to use for cache and locks](https://github.com/librenms/librenms/blob/master/config/cache.php) (default `database`)
### Dispatcher service
@ -21,13 +31,6 @@
* `SIDECAR_DISPATCHER`: Set to `1` to enable sidecar dispatcher mode for this container (default `0`)
* `DISPATCHER_NODE_ID`: Unique node ID for your dispatcher service
* `DISPATCHER_ARGS`: Additional args to pass to the [dispatcher service](https://github.com/librenms/librenms/blob/master/librenms-service.py)
* `REDIS_HOST`: Redis host for poller synchronization
* `REDIS_SENTINEL`: Redis Sentinel host for high availability Redis cluster
* `REDIS_SENTINEL_SERVICE`: Redis Sentinel service name (default `librenms`)
* `REDIS_SCHEME`: Redis scheme (default `tcp`)
* `REDIS_PORT`: Redis port (default `6379`)
* `REDIS_PASSWORD`: Redis password
* `REDIS_DB`: Redis database (default `0`)
### Syslog-ng
@ -65,6 +68,10 @@
* `LIBRENMS_SNMP_COMMUNITY`: This container's SNMP v2c community string (default `librenmsdocker`)
* `LIBRENMS_WEATHERMAP`: Enable LibreNMS [Weathermap plugin](https://docs.librenms.org/Extensions/Weathermap/) (default `false`)
* `LIBRENMS_WEATHERMAP_SCHEDULE`: CRON expression format (default `*/5 * * * *`)
* `MEMCACHED_HOST`: Hostname / IP address of a Memcached server
* `MEMCACHED_PORT`: Port of the Memcached server (default `11211`)
* `RRDCACHED_SERVER`: RRDcached server (eg. `rrdcached:42217`)
### Additional
LibreNMS supports most environment variables provided by Laravel (the framework LibreNMS is built on top of).
Check the [Laravel docs](https://laravel.com/docs) for additonal variables.

View file

@ -21,8 +21,8 @@ Install mariadb and librenms as two containers listening on port 8000.
This uses pwgen to generate a random mysql password, alternatively, you may just enter a password.
```shell
wget https://raw.githubusercontent.com/librenms/docker/master/examples/compose/docker-compose-standalone.yml
MYSQL_PASSWORD="`pwgen -Bs1 12`" docker-compose -f docker-compose-standalone.yml up -d
wget https://raw.githubusercontent.com/librenms/docker/master/examples/monolithic/docker-compose.yml
MYSQL_PASSWORD="`pwgen -Bs1 12`" docker-compose up -d
docker-compose logs -f
```
@ -31,11 +31,12 @@ docker-compose logs -f
Use Traefik to generate a letsencrypt ssl certificate and redirect to https. Uses pwgen.
```shell
wget https://raw.githubusercontent.com/librenms/docker/master/examples/compose/docker-compose-standalone-https.yml
wget https://raw.githubusercontent.com/librenms/docker/master/examples/compose/docker-compose-monolithic-https.yml
MYSQL_PASSWORD="`pwgen -Bs1 12`" \
LETSENCRYPT_EMAIL="email@example.com" \
LIBRENMS_BASE_URL="public-dns.example.com" \
docker-compose -f docker-compose-standalone-https.yml up -d
docker-compose -f docker-compose-monolithic-https.yml up -d
docker-compose logs -f
```
@ -48,7 +49,7 @@ You can also use the following minimal command :
docker run -d -p 8000:8000 --name librenms \
-v $(pwd)/data:/data \
-e "DB_HOST=db" \
-e "STANDALONE=1" \
-e "MONOLITHIC=1" \
librenms/librenms:latest
```

View file

@ -65,6 +65,9 @@ services:
- "REDIS_HOST=redis"
- "REDIS_PORT=6379"
- "REDIS_DB=0"
- "REDIS_CACHE_DB=1"
- "CACHE_DRIVER=redis"
- "SESSION_DRIVER=redis"
restart: always
dispatcher:

View file

@ -22,7 +22,7 @@ services:
# simple static Traefik config, you may want to use the docker provider and labels instead
traefik:
image: traefik:2.7 # please check version tag to use the most current version
image: traefik:2.8 # please check version tag to use the most current version
restart: unless-stopped
volumes:
- ./letsencrypt/:/letsencrypt/ # TLS certificate storage
@ -75,7 +75,7 @@ services:
volumes:
- "./librenms:/data"
environment:
- "STANDALONE=1"
- "MONOLITHIC=1"
- "TZ=${TZ}"
- "PUID=${PUID}"
- "PGID=${PGID}"

View file

@ -48,7 +48,7 @@ services:
volumes:
- "./librenms:/data"
environment:
- "STANDALONE=1"
- "MONOLITHIC=1"
- "TZ=${TZ}"
- "PUID=${PUID}"
- "PGID=${PGID}"

View file

@ -16,8 +16,6 @@ x-envlibrenms: &envlibrenms
REAL_IP_HEADER: "X-Forwarded-For"
LOG_IP_VAR: "remote_addr"
LIBRENMS_SNMP_COMMUNITY: "librenmsdocker"
MEMCACHED_HOST: "memcached"
MEMCACHED_PORT: "11211"
LIBRENMS_WEATHERMAP: "true"
LIBRENMS_WEATHERMAP_SCHEDULE: "*/5 * * * *"
@ -40,12 +38,6 @@ services:
MYSQL_PASSWORD: *MYSQL_PASSWORD
restart: always
memcached:
image: memcached:alpine
environment:
TZ: *TZ
restart: always
redis:
image: redis:5.0-alpine
environment:
@ -62,7 +54,6 @@ services:
- "8000:8000"
depends_on:
- db
- memcached
volumes:
- "librenms:/data"
environment:
@ -77,7 +68,10 @@ services:
DB_TIMEOUT: "60"
REDIS_HOST: "redis"
REDIS_PORT: "6379"
REDIS_DB: "0"
REDIS_DB: 0
REDIS_CACHE_DB: 1
CACHE_DRIVER: "redis"
SESSION_DRIVER: "redis"
restart: always
dispatcher:

View file

@ -20,13 +20,6 @@ services:
- "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
restart: always
memcached:
image: memcached:alpine
container_name: librenms_memcached
environment:
- "TZ=${TZ}"
restart: always
redis:
image: redis:5.0-alpine
container_name: librenms_redis
@ -71,7 +64,6 @@ services:
protocol: tcp
depends_on:
- db
- memcached
- rrdcached
- msmtpd
volumes:

View file

@ -6,9 +6,7 @@ REAL_IP_HEADER=X-Forwarded-For
LOG_IP_VAR=remote_addr
LIBRENMS_SNMP_COMMUNITY=librenmsdocker
MEMCACHED_HOST=memcached
MEMCACHED_PORT=11211
RRDCACHED_SERVER=rrdcached:42217
LIBRENMS_WEATHERMAP=false
LIBRENMS_WEATHERMAP_SCHEDULE=*/5 * * * *
LIBRENMS_WEATHERMAP_SCHEDULE="*/5 * * * *"

View file

@ -54,13 +54,6 @@ services:
- "MYSQL_PASSWORD=${MYSQL_PASSWORD}"
restart: always
memcached:
image: memcached:alpine
container_name: librenms_memcached
environment:
- "TZ=${TZ}"
restart: always
redis:
image: redis:5.0-alpine
container_name: librenms_redis
@ -81,7 +74,6 @@ services:
hostname: librenms
depends_on:
- db
- memcached
- msmtpd
volumes:
- "./librenms:/data"
@ -107,6 +99,9 @@ services:
- "REDIS_HOST=redis"
- "REDIS_PORT=6379"
- "REDIS_DB=0"
- "REDIS_CACHE_DB=1"
- "CACHE_DRIVER=redis"
- "SESSION_DRIVER=redis"
restart: always
dispatcher:

View file

@ -6,8 +6,6 @@ REAL_IP_HEADER=X-Forwarded-For
LOG_IP_VAR=http_x_forwarded_for
LIBRENMS_SNMP_COMMUNITY=librenmsdocker
MEMCACHED_HOST=memcached
MEMCACHED_PORT=11211
LIBRENMS_WEATHERMAP=false
LIBRENMS_WEATHERMAP_SCHEDULE=*/5 * * * *
LIBRENMS_WEATHERMAP_SCHEDULE="*/5 * * * *"

View file

@ -33,9 +33,7 @@ LISTEN_IPV6=${LISTEN_IPV6:-true}
REAL_IP_FROM=${REAL_IP_FROM:-"0.0.0.0/32"}
REAL_IP_HEADER=${REAL_IP_HEADER:-"X-Forwarded-For"}
LOG_IP_VAR=${LOG_IP_VAR:-remote_addr}
STANDALONE=${STANDALONE:-0}
MEMCACHED_PORT=${MEMCACHED_PORT:-11211}
MONOLITHIC=${MONOLITHIC:-0}
DB_PORT=${DB_PORT:-3306}
DB_NAME=${DB_NAME:-librenms}
@ -173,7 +171,7 @@ EOL
fi
# Config : RRDcached
if [ -n "${STANDALONE}" ]; then
if [ -n "${MONOLITHIC}" ]; then
RRDCACHED_SERVER="127.0.0.1:42217"
fi

View file

@ -28,7 +28,7 @@ DB_NAME=${DB_NAME:-librenms}
DB_USER=${DB_USER:-librenms}
DB_TIMEOUT=${DB_TIMEOUT:-60}
STANDALONE=${STANDALONE:-0}
MONOLITHIC=${MONOLITHIC:-0}
SIDECAR_DISPATCHER=${SIDECAR_DISPATCHER:-0}
#DISPATCHER_NODE_ID=${DISPATCHER_NODE_ID:-dispatcher1}
@ -40,9 +40,9 @@ REDIS_SENTINEL_SERVICE=${REDIS_SENTINEL_SERVICE:-librenms}
file_env 'REDIS_PASSWORD'
REDIS_DB=${REDIS_DB:-0}
# If stand-alone or dispatcher sidecar, install the service
if [ "$STANDALONE" == "1" ]; then
echo "Configuring dispatcher in stand-alone mode"
# If monolithic or dispatcher sidecar, install the service
if [ "$MONOLITHIC" == "1" ]; then
echo "Configuring dispatcher in monolithic mode"
elif [ "$SIDECAR_DISPATCHER" != "1" ]; then
exit 0
else

View file

@ -1,11 +1,11 @@
#!/usr/bin/with-contenv sh
STANDALONE=${STANDALONE:-0}
MONOLITHIC=${MONOLITHIC:-0}
SIDECAR_SYSLOGNG=${SIDECAR_SYSLOGNG:-0}
# Continue only if sidecar syslogng container
if [ "$STANDALONE" == "1" ]; then
echo "Configuring syslog-ng in stand-alone mode"
if [ "$MONOLITHIC" == "1" ]; then
echo "Configuring syslog-ng in monolithic mode"
elif [ "$SIDECAR_SYSLOGNG" != "1" ]; then
exit 0
else

View file

@ -1,6 +1,6 @@
#!/usr/bin/with-contenv sh
STANDALONE=${STANDALONE:-0}
MONOLITHIC=${MONOLITHIC:-0}
SIDECAR_SNMPTRAPD=${SIDECAR_SNMPTRAPD:-0}
LIBRENMS_SNMP_COMMUNITY=${LIBRENMS_SNMP_COMMUNITY:-librenmsdocker}
SNMP_PROCESSING_TYPE=${SNMP_PROCESSING_TYPE:-log,execute,net}
@ -13,9 +13,9 @@ SNMP_SECURITY_LEVEL=${SNMP_SECURITY_LEVEL:-priv}
SNMP_ENGINEID=${SNMP_ENGINEID:-1234567890}
SNMP_DISABLE_AUTHORIZATION=${SNMP_DISABLE_AUTHORIZATION:-yes}
# Continue only if sidecar snmptrapd container or stand-alone
if [ "$STANDALONE" == "1" ]; then
echo "Configuring snmptrapd in stand-alone mode"
# Continue only if sidecar snmptrapd container or monolithic
if [ "$MONOLITHIC" == "1" ]; then
echo "Configuring snmptrapd in monolithic mode"
elif [ "$SIDECAR_SNMPTRAPD" != "1" ]; then
exit 0
else

View file

@ -1,11 +1,11 @@
#!/usr/bin/with-contenv sh
STANDALONE=${STANDALONE:-0}
MONOLITHIC=${MONOLITHIC:-0}
SIDECAR_RRDCACHED=${SIDECAR_RRDCACHED:-0}
# Continue only if sidecar rrdcached container
if [ "$STANDALONE" == "1" ]; then
echo "Configuring rrdcached in stand-alone mode"
if [ "$MONOLITHIC" == "1" ]; then
echo "Configuring rrdcached in monolithic mode"
elif [ "$SIDECAR_RRDCACHED" != "1" ]; then
exit 0
else