Docker advice please

Currently reading
Docker advice please

Influxdb 2.x uses the query language "Flux", while Influxdb 1.x uses the query language "InfluxQL". The two query languages are completly differet and existing InfluxQL queries need to be migrated to Flux queries.

I tested it yesterday while turning Rusty's blogpost into a docker-compose.yml. It was quite straight forward, except when it came to register the InfluxDB in Grafana and of course the surprise when I imported prexisting dashboards and figured none of them actualy uses Flux queries under the hood. A dashboard usualy has many panels, each panal has one or more metrics.. each query needs to be migrated from InfluxQL to Flux to make it work.

Thus said, for the sake of comfort I would advice to stay with inflxdb 1.x for time :)
Well pointed, I was looking for this kind of information before pulling the trigger on influx 2.0... For now I'll stick with influx 1.8.
Also migrated my GIT to a stack in portainer (adapting my commandline to fit in compose)
 
I’ve gone back to the blackvoid GIT setup page and kind of muddling my way through. On the docker commands I had to specify influxdb:1.8.5 to stop it automatically downloading the latest version and stick to 1.8.5.

Got past that and I have influxdb running now but I’m stuck on telegraf. I can only seem to find the latest version of telegraf.conf and I think it’s changed since 1.x

Does anyone have a telegraf.conf they can share or can someone let me know how I could get hold of one?

thanks
 
Last edited:
You can generate one and use it while creating the container:
https://hub.docker.com/_/telegraf said:

Using a custom config file​

First, generate a sample configuration and save it as telegraf.conf on the host:

$ docker run --rm telegraf telegraf config > telegraf.conf
Once you've customized telegraf.conf, you can run the Telegraf container with it mounted in the expected location:

$ docker run -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro telegraf
Modify $PWD to the directory where you want to store the configuration file.

Read more about the Telegraf configuration here.

1. execute the first "docker run" command, but replace > telegraf.conf with > /volume1/docker/GIT/telegraf.conf or wherever the host path of your volume is, to generate the config file.

2. modify the file (hint: it's on a share, access it from your local computer with a decent editor like notepad++, sublimetext, visualstudio code,...) according your needs (your might want to use the editors "find" function and search for influx as the file has thousands of lines).

3. execute the second "docker run" command, but replace v $PWD/telegraf.conf with -v /volume1/docker/GIT/telegraf.conf when creating the container.
-- post merged: --

I have seen that early influxdb 2.x (<2.0.5) had a transpile function that migrated InfluxQL queries to Flux queries. haven't test it though.
I just realized that you can login into the influxdb dashboard and use it to generate queries. The queries it creates can be used as is in grafana.

I just replaced
Code:
SHOW TAG VALUES CARDINALITY FROM docker WITH KEY = "host"
with
Code:
from(bucket:  v.bucket)
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => 
    r["_measurement"] == "docker" and
    r["_field"] == "n_images")
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
  |> yield(name: "mean")

The query builder is a nice thing to get things started. While I am used to the prometheus query builder in Grafana, I was suprised there is none for Flux.
 
Does anyone have a telegraf.conf they can share or can someone let me know how I could get hold of one?
Here is a working version that works with Influx 1.8.x (link is valid for a week). Also, this is the full config file but some elements are "active" (uncommented) and most are not. Depending on what you want to push towards Influx. Change your Influx IP and port. As @one-eyed-king said, use a proper editor that can detect and identify elements in a conf file. You will have a much better experience than using a plan "notepad" like app.
 
Managed to get this working thanks to the help above. Just a few little things that caught me out but nothing too difficult to fix.

I had an issue where grafana couldn’t write to the persistent volume I had mapped. Resolved by chmod on the folder. Other than that just had to change port numbers etc correctly in the telegraf config file - also remembered that as I run all my containers on a new docker network I could refer to them by name instead of using an IP or local host in the config.

I’ve now imported a docker dashboard from those available on grafana’s website and all working fine. Going to play around with the config to get something similar for my synology itself.

Cheers
 
Taken a bit but I’ve finally managed to start working on a docker compose file. I’m a little limited in that I’m using an iPad for all the editing but the Textastic app seems to be good so far.

t’s taken a bit to work out the right syntax and how the docker compose blocks are nested but I’ve now got a working version for two test containers.


got a few questions if anyone can advise please.

1 - 99.9% sure I know this but I assume if I setup a docker compose for all my containers with the restart always tag then even if my NAS reboots or if the container goes down for any reason then docker will automatically try to bring it back up. There’s no need to run the docker compose after a reboot?

2 - Is anyone aware of a change in the synoservice commands with dsm7? If I had issues where containers didn’t show in the synology docker UI I used to be able to run the following:

sudo synoservice—restart pkgctl-Docker

when I try that now on DSM 7 I get an error saying the synoservice command is not found?

When I do switch to compose fully I’ll not really need this as I’ll likely use portainer but just wanted to know for now.

3 - I’ve got an iseries coding background and used to be really keen on adding comments and blank lines to separate code to make it more readable. I’ve tried adding a line starting with # as a comment but when I run the docker compose up command it doesn’t like this. Is there a way to space out blocks and add comments?

4 - Is there any benefit to splitting containers over multiple compose files so I could have multiple stacks in portainer?

Cheers
 
correct, docker will boot them up

/usr/syno/sbin# synopkgctl stop Docker /usr/syno/sbin# synopkgctl start Docker usage: synopkgctl <command> [...] command: enable <package> disable <package> setup <package> start <package> stop <package> teardown <package> check-startable <package> systemctl restart pkgctl-WebStation systemctl restart nginx

# is the comment character
Screenshot 2021-07-19 at 10.23.01.png


If you want to use that container with other containers that are not part of that stack? Like on the same or another docker host for example. Maybe you have a shared platform, like a dedicated MySQL container that is shared with other containers in other stacks.
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Similar threads

Gluetun works fine. I'm using it both for several other containers, and for proxying my browser through my...
Replies
3
Views
454
Thanks... I tried something similar with rsync. The docker volume lived in...
Replies
7
Views
620
I can’t find any option to restore just the settings. 1710356648 Phew, managed to fix it. Within the...
Replies
4
Views
503
Good to hear. Deluge has not been updated for almost two years now as an app, nevertheless. But it gives...
Replies
12
Views
1,104
  • Question
Open an issue on that GitHub page. The developers will be glad to assist. OP has posted two threads on...
Replies
5
Views
1,095
I'm happy with email notifications but in v0.3.3 of dockcheck the author added apprise notifications...
Replies
4
Views
1,231
I am also trying to setup a Z-wave USB dongle and am getting stuck after following the same steps as...
Replies
1
Views
1,143

Welcome to SynoForum.com!

SynoForum.com is an unofficial Synology forum for NAS owners and enthusiasts.

Registration is free, easy and fast!

Trending threads

Back
Top