# 進階功能

```
將節點改為 Manager：docker node promote <HOSTNAME>
降級為docker node demote <HOSTNAME>。
```

把樹梅派提昇為manager

```
sudo  docker node ls
ID                            HOSTNAME            STATUS              AVAILABILITY        MANAGER STATUS      ENGINE VERSION
x0544nvby7gt0zaxp30gjjqov *   pi-GB-BSi5A-6200    Ready               Active              Leader              18.09.9
pje55mj8gzj7q8obzz1la5c6s     raspberrypi4        Ready               Active                                  19.03.7
vz8vwt7bom9s2go59wtt04lbf     ubuntu-mate         Ready               Active                                  19.03.3

pi@pi-GB-BSi5A-6200:~$ sudo docker node promote raspberrypi4
Node raspberrypi4 promoted to a manager in the swarm.

```

```
docker service ps web
ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE             ERROR               PORTS
724wbwb9726s        web.1               httpd:latest        ubuntu-mate         Running             Running 2 minutes ago                         
gjxy4omk2l8z         \_ web.1           httpd:latest        ubuntu-mate         Shutdown            Shutdown 2 minutes ago                        
mmpqoj5utk8p         \_ web.1           httpd:latest        ubuntu-mate         Shutdown            Shutdown 31 minutes ago                       
lyvb8dv5wvhm        web.2               httpd:latest        pi-GB-BSi5A-6200    Running             Running 3 minutes ago                         
v0bxq1woot0z         \_ web.2           httpd:latest        pi-GB-BSi5A-6200    Shutdown            Shutdown 3 minutes ago                        
8x96uox5l6y7         \_ web.2           httpd:latest        pi-GB-BSi5A-6200    Shutdown            Shutdown 31 minutes ago                       
i973lbm3tk2p        web.3               httpd:latest        raspberrypi4        Running             Running 2 minutes ago                         
kv0zptya0hxk         \_ web.3           httpd:latest        raspberrypi4        Shutdown            Shutdown 2 minutes ago        
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kawsing.gitbook.io/opensystem/docker-swarm/untitled.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
