Skip to content

Commit 607d585

Browse files
author
Mary Anthony
committed
Updating the Introduction
- Clarifying two types of install - Splitting out release notes - Splitting out two install methods - Adding in comments from review - Adding release notes - Updating with abronan's comments - Updating for vieux - Updating with comments and pulling bash Signed-off-by: Mary Anthony <[email protected]>
1 parent c193492 commit 607d585

10 files changed

+708
-593
lines changed

docs/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ MAINTAINER Mary <[email protected]> (@moxiegirl)
55
COPY . /src
66

77
# Reset the /docs dir so we can replace the theme meta with the new repo's git info
8-
RUN git reset --hard
8+
# RUN git reset --hard
99

1010
RUN grep "VERSION =" /src/version/version.go | sed 's/.*"\(.*\)".*/\1/' > /docs/VERSION
1111

docs/discovery.md

+87-121
Original file line numberDiff line numberDiff line change
@@ -14,200 +14,170 @@ Docker Swarm comes with multiple Discovery backends.
1414

1515
First we create a cluster.
1616

17-
```bash
18-
# create a cluster
19-
$ swarm create
20-
6856663cdefdec325839a4b7e1de38e8 # <- this is your unique <cluster_id>
21-
```
17+
# create a cluster
18+
$ swarm create
19+
6856663cdefdec325839a4b7e1de38e8 # <- this is your unique <cluster_id>
20+
2221

2322
Then we create each node and join them to the cluster.
2423

25-
```bash
26-
# on each of your nodes, start the swarm agent
27-
# <node_ip> doesn't have to be public (eg. 192.168.0.X),
28-
# as long as the swarm manager can access it.
29-
$ swarm join --advertise=<node_ip:2375> token://<cluster_id>
30-
```
24+
# on each of your nodes, start the swarm agent
25+
# <node_ip> doesn't have to be public (eg. 192.168.0.X),
26+
# as long as the swarm manager can access it.
27+
$ swarm join --advertise=<node_ip:2375> token://<cluster_id>
28+
3129

3230
Finally, we start the Swarm manager. This can be on any machine or even
3331
your laptop.
3432

35-
```bash
36-
$ swarm manage -H tcp://<swarm_ip:swarm_port> token://<cluster_id>
37-
```
33+
$ swarm manage -H tcp://<swarm_ip:swarm_port> token://<cluster_id>
3834

3935
You can then use regular Docker commands to interact with your swarm.
4036

41-
```bash
42-
docker -H tcp://<swarm_ip:swarm_port> info
43-
docker -H tcp://<swarm_ip:swarm_port> run ...
44-
docker -H tcp://<swarm_ip:swarm_port> ps
45-
docker -H tcp://<swarm_ip:swarm_port> logs ...
46-
...
47-
```
37+
docker -H tcp://<swarm_ip:swarm_port> info
38+
docker -H tcp://<swarm_ip:swarm_port> run ...
39+
docker -H tcp://<swarm_ip:swarm_port> ps
40+
docker -H tcp://<swarm_ip:swarm_port> logs ...
41+
...
42+
4843

4944
You can also list the nodes in your cluster.
5045

51-
```bash
52-
swarm list token://<cluster_id>
53-
<node_ip:2375>
54-
```
46+
swarm list token://<cluster_id>
47+
<node_ip:2375>
48+
5549

5650
### Using a static file describing the cluster
5751

5852
For each of your nodes, add a line to a file. The node IP address
5953
doesn't need to be public as long the Swarm manager can access it.
6054

61-
```bash
62-
echo <node_ip1:2375> >> /tmp/my_cluster
63-
echo <node_ip2:2375> >> /tmp/my_cluster
64-
echo <node_ip3:2375> >> /tmp/my_cluster
65-
```
55+
echo <node_ip1:2375> >> /tmp/my_cluster
56+
echo <node_ip2:2375> >> /tmp/my_cluster
57+
echo <node_ip3:2375> >> /tmp/my_cluster
58+
6659

6760
Then start the Swarm manager on any machine.
6861

69-
```bash
70-
swarm manage -H tcp://<swarm_ip:swarm_port> file:///tmp/my_cluster
71-
```
62+
swarm manage -H tcp://<swarm_ip:swarm_port> file:///tmp/my_cluster
63+
7264

7365
And then use the regular Docker commands.
7466

75-
```bash
76-
docker -H tcp://<swarm_ip:swarm_port> info
77-
docker -H tcp://<swarm_ip:swarm_port> run ...
78-
docker -H tcp://<swarm_ip:swarm_port> ps
79-
docker -H tcp://<swarm_ip:swarm_port> logs ...
80-
...
81-
```
67+
docker -H tcp://<swarm_ip:swarm_port> info
68+
docker -H tcp://<swarm_ip:swarm_port> run ...
69+
docker -H tcp://<swarm_ip:swarm_port> ps
70+
docker -H tcp://<swarm_ip:swarm_port> logs ...
71+
...
8272

8373
You can list the nodes in your cluster.
8474

85-
```bash
86-
$ swarm list file:///tmp/my_cluster
87-
<node_ip1:2375>
88-
<node_ip2:2375>
89-
<node_ip3:2375>
90-
```
75+
$ swarm list file:///tmp/my_cluster
76+
<node_ip1:2375>
77+
<node_ip2:2375>
78+
<node_ip3:2375>
79+
9180

9281
### Using etcd
9382

9483
On each of your nodes, start the Swarm agent. The node IP address
9584
doesn't have to be public as long as the swarm manager can access it.
9685

97-
```bash
98-
swarm join --advertise=<node_ip:2375> etcd://<etcd_addr1>,<etcd_addr2>/<optional path prefix>
99-
```
86+
swarm join --advertise=<node_ip:2375> etcd://<etcd_addr1>,<etcd_addr2>/<optional path prefix>
87+
10088

10189
Start the manager on any machine or your laptop.
10290

103-
```bash
104-
swarm manage -H tcp://<swarm_ip:swarm_port> etcd://<etcd_addr1>,<etcd_addr2>/<optional path prefix>
105-
```
91+
swarm manage -H tcp://<swarm_ip:swarm_port> etcd://<etcd_addr1>,<etcd_addr2>/<optional path prefix>
92+
10693

10794
And then use the regular Docker commands.
10895

109-
```bash
110-
docker -H tcp://<swarm_ip:swarm_port> info
111-
docker -H tcp://<swarm_ip:swarm_port> run ...
112-
docker -H tcp://<swarm_ip:swarm_port> ps
113-
docker -H tcp://<swarm_ip:swarm_port> logs ...
114-
...
115-
```
96+
docker -H tcp://<swarm_ip:swarm_port> info
97+
docker -H tcp://<swarm_ip:swarm_port> run ...
98+
docker -H tcp://<swarm_ip:swarm_port> ps
99+
docker -H tcp://<swarm_ip:swarm_port> logs ...
100+
...
101+
116102

117103
You can list the nodes in your cluster.
118104

119-
```bash
120-
swarm list etcd://<etcd_addr1>,<etcd_addr2>/<optional path prefix>
121-
<node_ip:2375>
122-
```
105+
swarm list etcd://<etcd_addr1>,<etcd_addr2>/<optional path prefix>
106+
<node_ip:2375>
107+
123108

124109
### Using consul
125110

126111
On each of your nodes, start the Swarm agent. The node IP address
127112
doesn't need to be public as long as the Swarm manager can access it.
128113

129-
```bash
130-
swarm join --advertise=<node_ip:2375> consul://<consul_addr>/<optional path prefix>
131-
```
114+
swarm join --advertise=<node_ip:2375> consul://<consul_addr>/<optional path prefix>
132115

133116
Start the manager on any machine or your laptop.
134117

135-
```bash
136-
swarm manage -H tcp://<swarm_ip:swarm_port> consul://<consul_addr>/<optional path prefix>
137-
```
118+
swarm manage -H tcp://<swarm_ip:swarm_port> consul://<consul_addr>/<optional path prefix>
119+
138120

139121
And then use the regular Docker commands.
140122

141-
```bash
142-
docker -H tcp://<swarm_ip:swarm_port> info
143-
docker -H tcp://<swarm_ip:swarm_port> run ...
144-
docker -H tcp://<swarm_ip:swarm_port> ps
145-
docker -H tcp://<swarm_ip:swarm_port> logs ...
146-
...
147-
```
123+
docker -H tcp://<swarm_ip:swarm_port> info
124+
docker -H tcp://<swarm_ip:swarm_port> run ...
125+
docker -H tcp://<swarm_ip:swarm_port> ps
126+
docker -H tcp://<swarm_ip:swarm_port> logs ...
127+
...
148128

149129
You can list the nodes in your cluster.
150130

151-
```bash
152-
swarm list consul://<consul_addr>/<optional path prefix>
153-
<node_ip:2375>
154-
```
131+
swarm list consul://<consul_addr>/<optional path prefix>
132+
<node_ip:2375>
133+
155134

156135
### Using zookeeper
157136

158137
On each of your nodes, start the Swarm agent. The node IP doesn't have
159138
to be public as long as the swarm manager can access it.
160139

161-
```bash
162-
swarm join --advertise=<node_ip:2375> zk://<zookeeper_addr1>,<zookeeper_addr2>/<optional path prefix>
163-
```
140+
swarm join --advertise=<node_ip:2375> zk://<zookeeper_addr1>,<zookeeper_addr2>/<optional path prefix>
141+
164142

165143
Start the manager on any machine or your laptop.
166144

167-
```bash
168-
swarm manage -H tcp://<swarm_ip:swarm_port> zk://<zookeeper_addr1>,<zookeeper_addr2>/<optional path prefix>
169-
```
145+
swarm manage -H tcp://<swarm_ip:swarm_port> zk://<zookeeper_addr1>,<zookeeper_addr2>/<optional path prefix>
170146

171147
You can then use the regular Docker commands.
172148

173-
```bash
174-
docker -H tcp://<swarm_ip:swarm_port> info
175-
docker -H tcp://<swarm_ip:swarm_port> run ...
176-
docker -H tcp://<swarm_ip:swarm_port> ps
177-
docker -H tcp://<swarm_ip:swarm_port> logs ...
178-
...
179-
```
149+
150+
docker -H tcp://<swarm_ip:swarm_port> info
151+
docker -H tcp://<swarm_ip:swarm_port> run ...
152+
docker -H tcp://<swarm_ip:swarm_port> ps
153+
docker -H tcp://<swarm_ip:swarm_port> logs ...
154+
...
155+
180156

181157
You can list the nodes in the cluster.
182158

183-
```bash
184-
swarm list zk://<zookeeper_addr1>,<zookeeper_addr2>/<optional path prefix>
185-
<node_ip:2375>
186-
```
159+
swarm list zk://<zookeeper_addr1>,<zookeeper_addr2>/<optional path prefix>
160+
<node_ip:2375>
161+
187162

188163
### Using a static list of IP addresses
189164

190165
Start the manager on any machine or your laptop
191166

192-
```bash
193-
swarm manage -H <swarm_ip:swarm_port> nodes://<node_ip1:2375>,<node_ip2:2375>
194-
```
167+
swarm manage -H <swarm_ip:swarm_port> nodes://<node_ip1:2375>,<node_ip2:2375>
195168

196169
Or
197170

198-
```bash
199-
swarm manage -H <swarm_ip:swarm_port> <node_ip1:2375>,<node_ip2:2375>
200-
```
171+
swarm manage -H <swarm_ip:swarm_port> <node_ip1:2375>,<node_ip2:2375>
172+
201173

202174
Then use the regular Docker commands.
203175

204-
```bash
205-
docker -H <swarm_ip:swarm_port> info
206-
docker -H <swarm_ip:swarm_port> run ...
207-
docker -H <swarm_ip:swarm_port> ps
208-
docker -H <swarm_ip:swarm_port> logs ...
209-
...
210-
```
176+
docker -H <swarm_ip:swarm_port> info
177+
docker -H <swarm_ip:swarm_port> run ...
178+
docker -H <swarm_ip:swarm_port> ps
179+
docker -H <swarm_ip:swarm_port> logs ...
180+
211181

212182
### Range pattern for IP addresses
213183

@@ -217,23 +187,19 @@ addresses, i.e., `10.0.0.[10:200]` will be a list of nodes starting from
217187

218188
For example for the `file` discovery method.
219189

220-
```bash
221-
$ echo "10.0.0.[11:100]:2375" >> /tmp/my_cluster
222-
$ echo "10.0.1.[15:20]:2375" >> /tmp/my_cluster
223-
$ echo "192.168.1.2:[2:20]375" >> /tmp/my_cluster
224-
```
190+
$ echo "10.0.0.[11:100]:2375" >> /tmp/my_cluster
191+
$ echo "10.0.1.[15:20]:2375" >> /tmp/my_cluster
192+
$ echo "192.168.1.2:[2:20]375" >> /tmp/my_cluster
225193

226194
Then start the manager.
227195

228-
```bash
229-
swarm manage -H tcp://<swarm_ip:swarm_port> file:///tmp/my_cluster
230-
```
196+
swarm manage -H tcp://<swarm_ip:swarm_port> file:///tmp/my_cluster
197+
231198

232199
And for the `nodes` discovery method.
233200

234-
```bash
235-
swarm manage -H <swarm_ip:swarm_port> "nodes://10.0.0.[10:200]:2375,10.0.1.[2:250]:2375"
236-
```
201+
swarm manage -H <swarm_ip:swarm_port> "nodes://10.0.0.[10:200]:2375,10.0.1.[2:250]:2375"
202+
237203

238204
## Contributing a new discovery backend
239205

docs/images/virtual-box.png

105 KB
Loading

0 commit comments

Comments
 (0)