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
@@ -38,10 +39,10 @@ You only get the opportunity to change the `MQSL_` prefixed environment variable
38
39
$ docker-compose rm --force --stop -v mariadb
39
40
$ sudo rm -rf ./volumes/mariadb
40
41
```
41
-
42
+
42
43
* Edit `docker-compose.yml` and change the variables.
43
44
* Bring up the container:
44
-
45
+
45
46
```
46
47
$ docker-compose up -d mariadb
47
48
```
@@ -63,6 +64,103 @@ To close the terminal session, either:
63
64
* type "exit" and press <kbd>return</kbd>; or
64
65
* press <kbd>control</kbd>+<kbd>d</kbd>.
65
66
67
+
## <aname="healthCheck"> Container health check </a>
68
+
69
+
### <aname="healthCheckTheory"> theory of operation </a>
70
+
71
+
A script , or "agent", to assess the health of the MariaDB container has been added to the *local image* via the *Dockerfile*. In other words, the script is specific to IOTstack.
72
+
73
+
The agent is invoked 30 seconds after the container starts, and every 30 seconds thereafter. The agent:
74
+
75
+
1. Runs the command:
76
+
77
+
```
78
+
mysqladmin ping -h localhost
79
+
```
80
+
81
+
2. If that command succeeds, the agent compares the response returned by the command with the expected response:
82
+
83
+
```
84
+
mysqld is alive
85
+
```
86
+
87
+
3. If the command returned the expected response, the agent tests the responsiveness of the TCP port the `mysqld` daemon should be listening on (see [customising health-check](#healthCheckCustom)).
88
+
89
+
4. If all of those steps succeed, the agent concludes that MariaDB is functioning properly and returns "healthy".
You can customise the operation of the health-check agent by editing the `mariadb` service definition in your *Compose* file:
127
+
128
+
1. By default, the `mysqld` daemon listens to **internal** port 3306. If you need change that port, you also need to inform the health-check agent via an environment variable. For example, suppose you changed the **internal** port to 12345:
129
+
130
+
```yaml
131
+
environment:
132
+
- MYSQL_TCP_PORT=12345
133
+
```
134
+
135
+
Notes:
136
+
137
+
* The `MYSQL_TCP_PORT` variable is [defined by MariaDB](https://mariadb.com/kb/en/mariadb-environment-variables/), not IOTstack, so changing this variable affects more than just the health-check agent.
138
+
* If you are running "old menu", this change should be made in the file:
139
+
140
+
```
141
+
~/IOTstack/services/mariadb/mariadb.env
142
+
```
143
+
144
+
2. The `mysqladmin ping` command relies on the root password supplied via the `MYSQL_ROOT_PASSWORD` environment variable in the *Compose* file. The command will not succeed if the root password is not correct, and the agent will return "unhealthy".
145
+
146
+
3. If the health-check agent misbehaves in your environment, or if you simply don't want it to be active, you can disable all health-checking for the container by adding the following lines to its service definition:
147
+
148
+
```yaml
149
+
healthcheck:
150
+
disable: true
151
+
```
152
+
153
+
Note:
154
+
155
+
* The mere presence of a `healthcheck:` clause in the `mariadb` service definition overrides the supplied agent. In other words, the following can't be used to re-enable the supplied agent:
Copy file name to clipboardExpand all lines: docs/Containers/NextCloud.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -263,6 +263,12 @@ You can silence the warning by editing the Nextcloud service definition in `dock
263
263
264
264
Nextcloud traffic is not encrypted. Do **not** expose it to the web by opening a port on your home router. Instead, use a VPN like Wireguard to provide secure access to your home network, and let your remote clients access Nextcloud over the VPN tunnel.
265
265
266
+
## <a name="healthCheck"> Container health check </a>
267
+
268
+
A script , or "agent", to assess the health of the MariaDB container has been added to the *local image* via the *Dockerfile*. In other words, the script is specific to IOTstack.
269
+
270
+
Because it is an instance of MariaDB, Nextcloud_DB inherits the health-check agent. See the [IOTstack MariaDB](https://sensorsiot.github.io/IOTstack/Containers/MariaDB/) documentation for more information.
0 commit comments