Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
docker-py
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
docker-py
Commits
df31f9a8
Kaydet (Commit)
df31f9a8
authored
Agu 04, 2016
tarafından
Joffrey F
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Update Swarm documentation
Signed-off-by:
Joffrey F
<
joffrey@docker.com
>
üst
1f055796
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
22 deletions
+62
-22
swarm.md
docs/swarm.md
+62
-22
No files found.
docs/swarm.md
Dosyayı görüntüle @
df31f9a8
#
Using swarm for API version 1.24 or higher
#
Swarm management
Swarm initialization is done in two parts. Provide a listen_addr and
`force_new_cluster`
(OPTIONAL) to
the
`Client().swarm_init()`
method, and declare mappings in the
`swarm_opts`
section.
Starting with Engine version 1.12 (API 1.24), it is possible to manage the
engine's associated Swarm cluster using the API.
## Initializing a new Swarm
You can initialize a new Swarm by calling
`Client.init_swarm`
. An advertising
address needs to be provided, usually simply by indicating which network
interface needs to be used. Advanced options are provided using the
`swarm_spec`
parameter, which can easily be created using
`Client.create_swarm_spec`
.
```
python
swarm_id
=
cli
.
swarm_init
(
listen_addr
=
"0.0.0.0:4500"
,
swarm_opts
=
{
"AcceptancePolicy"
:
{
"Policies"
:
[
{
"Role"
:
"MANAGER"
,
"Autoaccept"
:
True
}
]
}
})
spec
=
client
.
create_swarm_spec
(
snapshot_interval
=
5000
,
log_entries_for_slow_followers
=
1200
)
client
.
init_swarm
(
advertise_addr
=
'eth0'
,
listen_addr
=
'0.0.0.0:5000'
,
force_new_cluster
=
False
,
swarm_spec
=
spec
)
```
Join another swarm, by providing the remote_address, listen_address(optional),
secret(optional), ca_cert_hash(optional, manager(optional)
## Joining an existing Swarm
If you're looking to have the engine your client is connected to joining an
existing Swarm, this ca be accomplished by using the
`Client.join_swarm`
method. You will need to provide a list of at least one remote address
corresponding to other machines already part of the swarm. In most cases,
a
`listen_address`
for your node, as well as the
`secret`
token are required
to join too.
```
python
cli
.
swarm_join
(
remote_address
=
"swarm-master:2377"
,
manager
=
True
cli
ent
.
join_swarm
(
remote_addresses
=
[
'192.168.14.221:2377'
],
secret
=
'SWMTKN-1-redacted'
,
listen_address
=
'0.0.0.0:5000'
,
manager
=
True
)
```
## Leaving the Swarm
To leave the swarm you are currently a member of, simply use
`Client.leave_swarm`
. Note that if your engine is the Swarm's manager,
you will need to specify
`force=True`
to be able to leave.
```
python
client
.
leave_swarm
(
force
=
False
)
```
## Retrieving Swarm status
Leave swarm
You can retrieve information about your current Swarm status by calling
`Client.inspect_swarm`
. This method takes no arguments.
```
python
cli
.
swarm_leave
()
cli
ent
.
inspect_swarm
()
```
## Swarm API documentation
### Client.init_swarm
#### Client.create_swarm_spec
#### docker.utils.SwarmAcceptancePolicy
#### docker.utils.SwarmExternalCA
### Client.inspect_swarm
### Client.join_swarm
### CLient.leave_swarm
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment