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
Stop gap measure to fix data persistence part of the tutorial (docker#4725)
* stop gap measure to fix data persistence part of the tutorial
Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
* improved note about data directory and scp
Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
3. Re-run the `docker stack deploy`command on the manager, and
117
129
whatever services need updating will be updated:
118
130
@@ -189,6 +201,7 @@ Redis service. Be sure to replace `username/repo:tag` with your image details.
189
201
deploy:
190
202
placement:
191
203
constraints: [node.role == manager]
204
+
command: redis-server --appendonly yes
192
205
networks:
193
206
- webnet
194
207
networks:
@@ -219,10 +232,7 @@ Redis service. Be sure to replace `username/repo:tag` with your image details.
219
232
220
233
- The placement constraint you put on the Redis service, ensuring that it
221
234
always uses the same host.
222
-
- The volume you created that lets the container access `./data` (on the host)
223
-
as `/data` (inside the Redis container). While containers come and go, the
224
-
files stored on `./data` on the specified host will persist, enabling
225
-
continuity.
235
+
- The volume you created that lets the container access `./data` (on the host) as `/data` (inside the Redis container). While containers come and go, the files stored on `./data` on the specified host will persist, enabling continuity.
226
236
227
237
You are ready to deploy your new Redis-using stack.
228
238
@@ -232,16 +242,23 @@ Redis service. Be sure to replace `username/repo:tag` with your image details.
232
242
docker-machine ssh myvm1 "mkdir ./data"
233
243
```
234
244
235
-
3. Make sure your shell is configured to talk to `myvm1` (examples are [here](part4.md#configure-a-docker-machine-shell-to-the-swarm-manager)).
245
+
3. This time, we need to copy over the new `docker-compose.yml` file with `docker-machine scp`:
236
246
237
-
* Run `docker-machine ls` to list machines and make sure you are connected to `myvm1`, as indicated by an asterisk next it.
247
+
```shell
248
+
$ docker-machine scp docker-compose.yml myvm1:~
249
+
```
238
250
239
-
* If needed, re-run `docker-machine env myvm1`, then run the given command to configure the shell.
251
+
> **Note**: Windows users will need a Linux terminal emulator like [Git
252
+
Bash](https://git-for-windows.github.io/){: target="_blank" class="_"} in order
253
+
for `docker-machine scp` to work. We are researching a better solution here, one
254
+
without the need to copy files over to the VM, but for now it seems that the
255
+
Compose file needs to be located on the VM so that it looks for `./data` in the
256
+
right place.
240
257
241
-
4. Run `docker stack deploy` one more time.
258
+
4. Run `docker stack deploy` one more time, this time wrapped in `docker-machine ssh myvm1` to specifically send it to the Compose file we just placed on the manager.
5. Check the web page at one of your nodes (e.g. `http://192.168.99.101`) and you'll see the results of the visitor counter, which is now live and storing information on Redis.
0 commit comments