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

Review ซิม open (Open SIM)

สวัสดีครับ วันนี้ผมได้มีโอกาสไปงาน Thailand Mobile Expo 2016 ก็ได้ซิม open แจกฟรีมา พร้อมของแถมเป็นที่วางมือถือบราวน์ มา1ตัว

Arduino ตอน4 ภาษา C++ สําหรับ Arduino

สวัสดีครับ หลังจากที่เราได้เรียนรู้การใช้งาน Arduino ตั้งแต่ติดตั้งโปรแกรม Arduino IDE ไปจนถึง Upload โปรแกรมลง Arduino board ในบทความ Arduino ตอน3 ติดตั้ง Arduino IDE และเริ่มต้นเขียนโปรแกรมแรก กันไปแล้ว ในบทความนี้เราจะลงลึกการเขียนโปรแกรมควบคุม Arduino กันแบบจริงๆจังๆกันครับ โดยจะเน้นไปในส่วนของโครงสร้างของภาษา C++ สําหรับ Arduino

Vue.js เริ่มต้น ตอน2 (Component)

ในบทความตอนที่แล้ว "Vue.js เริ่มต้น ตอน1 (สร้าง Project)" ผมได้อธิบายถึงแนวทางการพัฒนาเว็บด้วย Vue.js ในแบบต่างๆ และการสร้าง Project ด้วย Vue-cli ถ้าใครยังไม่ได้อ่านกลับไปอ่านก่อนเนื่องจากเนื้อหาในบทความนี้เป็นเนื้อหาที่ต่อเนื่องจากบทความที่แล้ว


Copyright © 2019 - 2025 thiti.dev |  v1.56.0 |  Privacy policy | 

Build with ❤️ and Astro.

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