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

เขียนเกมส์ pacman ด้วย c/c++

สวัสดีครับ เมื่อไม่กี่วันมานี้มีน้องคนนึงมาให้สอนเขียนเกมส์ pacman ด้วยภาษาซี ผมจึงนํา source code มาแบ่งปัน เผื่อใครสนใจ ตัวเกมส์ก็ไม่มีอะไรมากครับเป็น console application มีตัว pacman และตัว bot โง่ๆ 4 ตัว เขียนบน visual studio 2013 ส่วนวิธีการเล่น คือใช้ w, s, a, d เป็นปุ่มบังคับทิศทาง

แก้ปัญหา url unicode ใน Google Analytics Post Pageviews wordpress

สําหรับคนที่ใช้ plugin Google Analytics Post Pageviews ใน wordpress จะเจอปัญหาเมื่อ url ของ post เป็นภาษาไทย(unicode) plugin จะไม่สามารถดึงข้อมูลจาก google analytic ออกมาได้ ทําให้ views เป็น 0 วิธีการแก้ไขคือ

เหรียญ 1 บาท เนื่องในวันอาหารโลก

เหรียญ 1 บาท เนื่องในวันอาหารโลก พ.ศ.2525 องค์การอาหารและเกษตรแห่งสหประชาชาติขอความร่วมมือให้กรมธนารักษ์จัดทำเหรียญกษาปณ์ที่ระลึกเนื่องในวันอาหารโลก องค์การอาหารและเกษตรแห่งสหประชาชาติเป็นองค์การระหว่างประเทศที่ดำเนินการเกี่ยวกับการเพิ่มผลผลิตในการเกษตรให้มากยิ่งขึ้น เพื่อมิให้ประชากรของโลกขาดแคลนอาหาร และเนื่องด้วยวันที่ 16 ตุลาคม พ.ศ. 2524 เป็นวันฉลองการก่อตั้งองค์การอาหารและการเกษตรแห่งสหประชาชาติ ครบปีที่ 36 องค์การ ฯ จึงถือเอาวันที่


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

Build with ❤️ and Astro.

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