You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Containers/InfluxDB.md
+62-6Lines changed: 62 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -662,7 +662,9 @@ SSD-drives have pretty good controllers spreading out writes, so this isn't a th
662
662
663
663
This is especially important if you plan on having Grafana or Chronograf displaying up-to-date data on a dashboard, making queries all the time.
664
664
665
-
## Container won't start { #debugging }
665
+
### Debugging { #debugging }
666
+
667
+
### Container won't start { #debugInspection }
666
668
667
669
Sometimes you need start the container without starting influxdb to access its maintenance tools. Usually when influx crashes on startup.
668
670
@@ -677,18 +679,72 @@ influxdb:
677
679
Recreate the container using the new entrypoint:
678
680
679
681
``` console
680
-
pi@raspberrypi:~/IOTstack $ docker-compose up -d influxdb
682
+
$ docker-compose up -d influxdb
681
683
Recreating influxdb ... done
682
684
```
683
685
684
-
Now it should start and you can get a shell to poke around and try the `influx_inspect`:
686
+
Now the container should start and you can get a shell to poke around and try the `influx_inspect` command:
685
687
686
688
``` console
687
689
$ docker exec -it influxdb bash
688
-
root@5ecc8536174f:/# influx_inspect
690
+
# influx_inspect
689
691
Usage: influx_inspect [[command] [arguments]]
690
692
```
691
693
692
-
You may need to do `apt update` and `apt install` some tools you need. The container is pretty bare-bones by default.
694
+
Once you have finished poking around, you should undo the change by removing the custom entrypoint and `up -d` again to return to normal container behaviour where you can then test to see if your fixes worked.
695
+
696
+
### Adding packages { #debugPackages }
697
+
698
+
The container is pretty bare-bones by default. It is OK to install additional tools. Start by running:
699
+
700
+
``` console
701
+
# apt update
702
+
```
703
+
704
+
and then use `apt install` to add whatever you need. Packages you add will persist until the next time the container is re-created.
705
+
706
+
### Sniffing traffic { #debugSniff }
707
+
708
+
If you need to see the actual packets being sent to Influx for insertion into your database, you can set it up like this:
* `-i eth0` is the container's internal virtual Ethernet network interface (attached to the internal bridged network)
725
+
* `-s 0` means "capture entire packets"
726
+
* `-n` means "do not try to resolve IP addresses to domain names
727
+
* `-c 100` is optional and means "capture 100 packets then stop". If you omit this option, `tcpdump` will capture packets until you press <kbd>control</kbd>+<kbd>C</kbd>.
728
+
* `-w /var/lib/influxdb/capture.pcap` is the internal path to the file where captured packets are written. You can, of course, substitute any filename you like for `capture.pcap`.
729
+
* `dst port 8086` captures all packets where the destination port field is 8086, which is the InfluxDB internal port number.
730
+
731
+
The internal path:
732
+
733
+
```
734
+
/var/lib/influxdb/capture.pcap
735
+
```
736
+
737
+
maps to the external path:
738
+
739
+
```
740
+
~/IOTstack/volumes/influxdb/data/capture.pcap
741
+
```
742
+
743
+
You can copy that file to another system where you have a tool like WireShark installed. WireShark will open the file and you can inspect packets and verify that the information being sent to InfluxDB is what you expect.
744
+
745
+
Do not forget to clean-up any packet capture files:
693
746
694
-
Of course remove the custom entrypoint and "up -d" again to test if your fixes worked.
0 commit comments