Advertisement
RobertBerger

tig stack no host network

Jan 30th, 2021
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.98 KB | None | 0 0
  1. version: "3.4"
  2. services:
  3. influxdb:
  4. container_name: influxdb
  5. image: influxdb:1.8.3
  6. # this needs to be accessible from outside (other telegrafs)
  7. # and from telegraf (inside)
  8. expose:
  9. - "8086"
  10. ports:
  11. - "8086:8086"
  12. volumes:
  13. - /home/student/projects/tig/data/influxdb:/var/lib/influxdb
  14. - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/influxdb:/etc/influxdb/
  15. restart: always
  16.  
  17. telegraf:
  18. container_name: telegraf
  19. image: telegraf:1.17.1
  20. depends_on:
  21. - influxdb
  22. volumes:
  23. - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf
  24. - /var/run/docker.sock:/var/run/docker.sock
  25. restart: always
  26.  
  27. grafana:
  28. container_name: grafana
  29. image: grafana/grafana:7.3.7
  30. depends_on:
  31. - influxdb
  32. user: "0"
  33. expose:
  34. - "3000"
  35. ports:
  36. # - "3000:3000"
  37. - '127.0.0.1:3000:3000'
  38. volumes:
  39. - /home/student/projects/tig/data/grafana:/var/lib/grafana
  40. - /home/student/projects/tig/log/grafana:/var/log/grafana
  41. - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/grafana/grafana.ini:/etc/grafana/grafana.ini
  42. links:
  43. - influxdb
  44. restart: always
  45.  
  46. mqtt:
  47. container_name: mqtt
  48. image: eclipse-mosquitto:latest
  49. user: "0"
  50. expose:
  51. - "1883"
  52. - "9001"
  53. ports:
  54. - "1883:1883"
  55. - "9001:9001"
  56. volumes:
  57. - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/mqtt/:/mosquitto/config/
  58. - /home/student/projects/tig/data/mqtt/:/mosquitto/data/
  59. - /home/student/projects/tig/log/mqtt/:/mosquitto/log/
  60. restart: always
  61.  
  62. on host:
  63.  
  64. # netstat -tuln
  65. Active Internet connections (only servers)
  66. Proto Recv-Q Send-Q Local Address Foreign Address State
  67. tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
  68. tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN
  69. tcp 0 0 0.0.0.0:5355 0.0.0.0:* LISTEN
  70. tcp 0 0 :::8086 :::* LISTEN
  71. tcp 0 0 :::22 :::* LISTEN
  72. tcp 0 0 :::1883 :::* LISTEN
  73. tcp 0 0 :::9001 :::* LISTEN
  74. tcp 0 0 :::5355 :::* LISTEN
  75. udp 0 0 127.0.0.53:53 0.0.0.0:*
  76. udp 0 0 192.168.42.71:68 0.0.0.0:*
  77. udp 0 0 192.168.42.71:123 0.0.0.0:*
  78. udp 0 0 127.0.0.1:123 0.0.0.0:*
  79. udp 0 0 0.0.0.0:123 0.0.0.0:*
  80. udp 0 0 0.0.0.0:5355 0.0.0.0:*
  81. udp 0 0 fe80::6076:3aff:fe2a:329a:123 :::*
  82. udp 0 0 fe80::38b3:73ff:feda:8e24:123 :::*
  83. udp 0 0 fe80::b882:c8ff:fefa:74ac:123 :::*
  84. udp 0 0 fe80::e448:cff:fe37:700a:123 :::*
  85. udp 0 0 fe80::522d:f4ff:fe09:cf4d:123 :::*
  86. udp 0 0 ::1:123 :::*
  87. udp 0 0 :::123 :::*
  88. udp 0 0 :::5355 :::*
  89.  
  90. # route -n
  91. Kernel IP routing table
  92. Destination Gateway Genmask Flags Metric Ref Use Iface
  93. 0.0.0.0 192.168.42.254 0.0.0.0 UG 10 0 0 eth0
  94. 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
  95. 172.18.0.0 0.0.0.0 255.255.0.0 U 0 0 0 br-7683d0016802
  96. 192.168.42.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
  97. 192.168.42.254 0.0.0.0 255.255.255.255 UH 10 0 0 eth0
  98.  
  99. # iptables -L
  100. Chain INPUT (policy ACCEPT)
  101. target prot opt source destination
  102.  
  103. Chain FORWARD (policy DROP)
  104. target prot opt source destination
  105. DOCKER-USER all -- anywhere anywhere
  106. DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere
  107. ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
  108. DOCKER all -- anywhere anywhere
  109. ACCEPT all -- anywhere anywhere
  110. ACCEPT all -- anywhere anywhere
  111. ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
  112. DOCKER all -- anywhere anywhere
  113. ACCEPT all -- anywhere anywhere
  114. ACCEPT all -- anywhere anywhere
  115.  
  116. Chain OUTPUT (policy ACCEPT)
  117. target prot opt source destination
  118.  
  119. Chain DOCKER (2 references)
  120. target prot opt source destination
  121. ACCEPT tcp -- anywhere 172.18.0.2 tcp dpt:8086
  122. ACCEPT tcp -- anywhere 172.18.0.3 tcp dpt:9001
  123. ACCEPT tcp -- anywhere 172.18.0.3 tcp dpt:1883
  124. ACCEPT tcp -- anywhere 172.18.0.5 tcp dpt:3000
  125.  
  126. Chain DOCKER-ISOLATION-STAGE-1 (1 references)
  127. target prot opt source destination
  128. DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
  129. DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
  130. RETURN all -- anywhere anywhere
  131.  
  132. Chain DOCKER-ISOLATION-STAGE-2 (2 references)
  133. target prot opt source destination
  134. DROP all -- anywhere anywhere
  135. DROP all -- anywhere anywhere
  136. RETURN all -- anywhere anywhere
  137.  
  138. Chain DOCKER-USER (1 references)
  139. target prot opt source destination
  140. ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
  141. DROP all -- anywhere anywhere
  142. RETURN all -- anywhere anywhere
  143.  
  144. # wget 127.0.0.1:3000
  145. Connecting to 127.0.0.1:3000 (127.0.0.1:3000)
  146. wget: error getting response: Connection reset by peer
  147.  
  148. BTW if I export 3000:3000 it looks like this and still does not work:
  149. tcp 0 0 :::3000 :::* LISTEN
  150.  
  151. # wget localhost:3000
  152. Connecting to localhost:3000 (127.0.0.1:3000)
  153. wget: error getting response: Connection reset by peer
  154. root@imx6q-phytec-mira-rdk-nand:/home/student/projects/mqtt-telegraf-influxdb-grafana# wget 192.168.42.71:3000
  155. Connecting to 192.168.42.71:3000 (192.168.42.71:3000)
  156. wget: can't connect to remote host (192.168.42.71): No route to host
  157.  
  158. containers can not ping each other:
  159.  
  160. # docker exec -ti influxdb /bin/sh
  161. # ping influxdb
  162. PING influxdb (172.18.0.2) 56(84) bytes of data.
  163. 64 bytes from e3fea5e19cd8 (172.18.0.2): icmp_seq=1 ttl=64 time=0.135 ms
  164. 64 bytes from e3fea5e19cd8 (172.18.0.2): icmp_seq=2 ttl=64 time=0.106 ms
  165. 64 bytes from e3fea5e19cd8 (172.18.0.2): icmp_seq=3 ttl=64 time=0.103 ms
  166. ^C
  167. --- influxdb ping statistics ---
  168. 3 packets transmitted, 3 received, 0% packet loss, time 2097ms
  169. rtt min/avg/max/mdev = 0.103/0.114/0.135/0.019 ms
  170. # ping grafana
  171. PING grafana (172.18.0.5) 56(84) bytes of data.
  172. From e3fea5e19cd8 (172.18.0.2) icmp_seq=1 Destination Host Unreachable
  173. From e3fea5e19cd8 (172.18.0.2) icmp_seq=2 Destination Host Unreachable
  174. From e3fea5e19cd8 (172.18.0.2) icmp_seq=3 Destination Host Unreachable
  175. ^C
  176. --- grafana ping statistics ---
  177. 6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5231ms
  178. pipe 4
  179. #
  180.  
  181.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement