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
@@ -49,6 +86,9 @@ To create a new database and set a limited retention policy, here for instance
49
86
any data older than 52 weeks is deleted:
50
87
51
88
```
89
+
$ iotstack_influx
90
+
Connected to http://localhost:8086 version 1.8.10
91
+
InfluxDB shell version: 1.8.10
52
92
> create database mydb
53
93
> show retention policies on mydb
54
94
name duration shardGroupDuration replicaN default
@@ -79,24 +119,55 @@ on your card. The goal is to avoid writing lots of small changes targeting the
79
119
same physical blocks. Here are some tips to mitigate SD-card wear:
80
120
81
121
* Don't use short retention policies. This may mask heavy disk IO without
82
-
increasing disk space usage. Depending on the file system used, new data may
83
-
be written to the same flash blocks that were freed by expiration, wearing
84
-
them out.
122
+
increasing disk space usage. Depending on the flash card and file system
123
+
used, new data may be re-written to the same blocks that were freed by the
124
+
expiration, wearing them out.
85
125
* Take care not to add measurements too often. If possible no more often than
86
-
once a minute. Add all measurements in one operation.
126
+
once a minute. Add all measurements in one operation. Even a small write
127
+
will physically write a whole new block and erase the previously used block.
87
128
* Adding measurements directly to Influxdb will cause a write on every
88
129
operation. If your client code can't aggregate multiple measurements into one
89
130
write, consider routing them via Telegraf. It has the
90
131
`flush_interval`-option, which will combine the measurements into one write.
91
132
* All InfluxDB queries are logged by default and logs are written to the
92
-
SD-card. To disable this, add to docker-compose.yml, next to the other
133
+
SD-card. To disable this, add into docker-compose.yml, next to the other
93
134
INFLUXDB_\* entries:
94
-
```
135
+
```yaml
95
136
- INFLUXDB_DATA_QUERY_LOG_ENABLED=false
96
137
- INFLUXDB_HTTP_LOG_ENABLED=false
97
138
```
98
139
This is especially important if you plan on having Grafana or Chronograf
99
-
displaying up-to-date data on a dashboard.
140
+
displaying up-to-date data on a dashboard, making queries all the time.
141
+
142
+
## Maintanance when container refuses to start
143
+
144
+
Sometimes you need start the container without starting influxdb to access
145
+
its maintenance tools. Usually when influx crashes on startup.
146
+
147
+
Add a new line below `influxdb:` to your docker-compose.yml:
148
+
```yaml
149
+
influxdb:
150
+
entrypoint: sleep infinity
151
+
```
152
+
153
+
Recreate the container using the new entrypoint:
154
+
``` console
155
+
pi@raspberrypi:~/IOTstack $ docker-compose up -d influxdb
156
+
Recreating influxdb ... done
157
+
```
158
+
159
+
Now it should start and you can get a shell to poke around and try the
160
+
influx_inspect:
161
+
``` console
162
+
$ docker exec -it influxdb bash
163
+
root@5ecc8536174f:/# influx_inspect
164
+
Usage: influx_inspect [[command] [arguments]]
165
+
```
166
+
You may need to do `apt-get update` and `apt-get install` some tools you need.
167
+
The container is pretty bare-bones by default.
168
+
169
+
Of course remove the custom entrypoint and "up -d" again to test if your fixes
170
+
worked.
100
171
101
172
## Old-menu branch
102
173
The credentials and default database name for influxdb are stored in the file called influxdb/influx.env . The default username and password is set to "nodered" for both. It is HIGHLY recommended that you change them. The environment file contains several commented out options allowing you to set several access options such as default admin user credentials as well as the default database name. Any change to the environment file will require a restart of the service.
0 commit comments