Configure the Linux Firewall for Docker Swarm on Ubuntu

15 Dec 2017,
Share: 

บทความนี้จะเกี่ยวข้องกับการ Config Linux Firewall ให้สามารถใช้งาน Docker swarm ได้ ถ้าไม่ได้ Config เราจะเจอกับ Error นี้ “Timeout was reached before node was joined. The attempt to join the swarm will continue in the background. Use the “docker info” command to see the current swarm status of your node.” ในขั้นตอนการ Join Swarm เพราะว่า Docker Swarm ใช้งาน port ดังต่อไปนี้

  • TCP port 2376 for secure Docker client communication. This port is required for Docker Machine to work. Docker Machine is used to orchestrate Docker hosts.
  • TCP port 2377. This port is used for communication between the nodes of a Docker Swarm or cluster. It only needs to be opened on manager nodes.
  • TCP and UDP port 7946 for communication among nodes (container network discovery).
  • UDP port 4789 for overlay network traffic (container ingress networking).

ดังนั้นเราจึงต้องไป config firewall เพื่อให้สามารถใช้งานได้ มีขั้นตอนดังนี้ ใช้คําสั่งตามลําดับดังนี้ได้เลยครับ

ufw allow 22/tcp
ufw allow 2376/tcp
ufw allow 2377/tcp
ufw allow 7946/tcp
ufw allow 7946/udp
ufw allow 4789/udp

reload UFW ด้วยคําสั่ง

ufw reload

Enable UFW ด้วยคําสั่ง

ufw enable

Restart docker engin

systemctl restart docker

เท่านี้เราก็สามารถใช้งาน Docker Swarm ได้แล้วครับ :)

Suggestion blogs

sql update

sql update เป็นคําสั่งที่ใช้สําหรับแก้ไขข้อมูลในตาราง สามารถแก้ไขข้อมูลได้หลาย Field และหลาย Record โดยจะขึ้นอยู่กับ Where ที่ผู้ใช้กําหนดDatabase supportMySQL,Microsoft Access,SQL Server,Oracleรูปแบบการใช้

Go EP.6 Go Channel

สวัสดีครับ ในบทความนี้ก็เป็น EP.6 แล้วนะครับ โดยเนื้อหาจะเป็นเรื่องเกี่ยวกับ Go Channel ซึ่งเป็นเรื่องที่ต่อเนื่องจาก Go EP.5 Go Routine ครับสําหรับท่านใดที่ยังไม่ได้อ่าน EP.5 ท่านสามารถกลับไปอ่านก่อนได้นะครับที่นี่ Go EP.5 Go Routineมาเริ่มเรียนรู้ไปด้วยกันตามหัวข้อด้านล่างเลยครับ

การเข้ารหัสข้อมูลแบบอสมมาตร (Asymmetric key)

อัลกอริทึมนี้จะใช้กุญแจสองตัวเพื่อทำงาน ตัวหนึ่งใช้ในการเข้ารหัสและอีกตัวหนึ่งใช้ในการถอดรหัสข้อมูลที่เข้ารหัสมา โดยกุญแจตัวแรก คือ กุญแจสาธารณะ (Public keys) ซึ่งจะเป็นกุญแจที่ใช้ในการเข้ารหัสข้อมูล กุญแจตัวที่สองคือ กุญแจส่วนตัว (Private keys) ซึ่งจะเป็นกุญแจที่ใช้ในการถอดรหัส อ่านๆไปแล้วอาจจะงงว่าจะเอาไปใช้ได้อย่างไร เรามาดูการทํางานกันดีกว่า


Copyright © 2019 - 2026 thiti.dev |  v1.60.0 |  Privacy policy | 

Build with ❤️ and Astro.

Github profile   Linkedin profile   Instagram   X profile   Nostr   Youtube channel   Telegram   Email contact   วงแหวนเว็บ