Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: "3.4"
- services:
- influxdb:
- container_name: influxdb
- image: influxdb:1.8.3
- # this needs to be accessible from outside (other telegrafs)
- # and from telegraf (inside)
- expose:
- - "8086"
- ports:
- - "8086:8086"
- volumes:
- - /home/student/projects/tig/data/influxdb:/var/lib/influxdb
- - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/influxdb:/etc/influxdb/
- restart: always
- telegraf:
- container_name: telegraf
- image: telegraf:1.17.1
- depends_on:
- - influxdb
- volumes:
- - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf
- - /var/run/docker.sock:/var/run/docker.sock
- restart: always
- grafana:
- container_name: grafana
- image: grafana/grafana:7.3.7
- depends_on:
- - influxdb
- user: "0"
- expose:
- - "3000"
- ports:
- # - "3000:3000"
- - '127.0.0.1:3000:3000'
- volumes:
- - /home/student/projects/tig/data/grafana:/var/lib/grafana
- - /home/student/projects/tig/log/grafana:/var/log/grafana
- - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/grafana/grafana.ini:/etc/grafana/grafana.ini
- links:
- - influxdb
- restart: always
- mqtt:
- container_name: mqtt
- image: eclipse-mosquitto:latest
- user: "0"
- expose:
- - "1883"
- - "9001"
- ports:
- - "1883:1883"
- - "9001:9001"
- volumes:
- - /home/student/projects/mqtt-telegraf-influxdb-grafana/conf/mqtt/:/mosquitto/config/
- - /home/student/projects/tig/data/mqtt/:/mosquitto/data/
- - /home/student/projects/tig/log/mqtt/:/mosquitto/log/
- restart: always
- on host:
- # netstat -tuln
- Active Internet connections (only servers)
- Proto Recv-Q Send-Q Local Address Foreign Address State
- tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
- tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN
- tcp 0 0 0.0.0.0:5355 0.0.0.0:* LISTEN
- tcp 0 0 :::8086 :::* LISTEN
- tcp 0 0 :::22 :::* LISTEN
- tcp 0 0 :::1883 :::* LISTEN
- tcp 0 0 :::9001 :::* LISTEN
- tcp 0 0 :::5355 :::* LISTEN
- udp 0 0 127.0.0.53:53 0.0.0.0:*
- udp 0 0 192.168.42.71:68 0.0.0.0:*
- udp 0 0 192.168.42.71:123 0.0.0.0:*
- udp 0 0 127.0.0.1:123 0.0.0.0:*
- udp 0 0 0.0.0.0:123 0.0.0.0:*
- udp 0 0 0.0.0.0:5355 0.0.0.0:*
- udp 0 0 fe80::6076:3aff:fe2a:329a:123 :::*
- udp 0 0 fe80::38b3:73ff:feda:8e24:123 :::*
- udp 0 0 fe80::b882:c8ff:fefa:74ac:123 :::*
- udp 0 0 fe80::e448:cff:fe37:700a:123 :::*
- udp 0 0 fe80::522d:f4ff:fe09:cf4d:123 :::*
- udp 0 0 ::1:123 :::*
- udp 0 0 :::123 :::*
- udp 0 0 :::5355 :::*
- # route -n
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 0.0.0.0 192.168.42.254 0.0.0.0 UG 10 0 0 eth0
- 172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
- 172.18.0.0 0.0.0.0 255.255.0.0 U 0 0 0 br-7683d0016802
- 192.168.42.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
- 192.168.42.254 0.0.0.0 255.255.255.255 UH 10 0 0 eth0
- # iptables -L
- Chain INPUT (policy ACCEPT)
- target prot opt source destination
- Chain FORWARD (policy DROP)
- target prot opt source destination
- DOCKER-USER all -- anywhere anywhere
- DOCKER-ISOLATION-STAGE-1 all -- anywhere anywhere
- ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
- DOCKER all -- anywhere anywhere
- ACCEPT all -- anywhere anywhere
- ACCEPT all -- anywhere anywhere
- ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
- DOCKER all -- anywhere anywhere
- ACCEPT all -- anywhere anywhere
- ACCEPT all -- anywhere anywhere
- Chain OUTPUT (policy ACCEPT)
- target prot opt source destination
- Chain DOCKER (2 references)
- target prot opt source destination
- ACCEPT tcp -- anywhere 172.18.0.2 tcp dpt:8086
- ACCEPT tcp -- anywhere 172.18.0.3 tcp dpt:9001
- ACCEPT tcp -- anywhere 172.18.0.3 tcp dpt:1883
- ACCEPT tcp -- anywhere 172.18.0.5 tcp dpt:3000
- Chain DOCKER-ISOLATION-STAGE-1 (1 references)
- target prot opt source destination
- DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
- DOCKER-ISOLATION-STAGE-2 all -- anywhere anywhere
- RETURN all -- anywhere anywhere
- Chain DOCKER-ISOLATION-STAGE-2 (2 references)
- target prot opt source destination
- DROP all -- anywhere anywhere
- DROP all -- anywhere anywhere
- RETURN all -- anywhere anywhere
- Chain DOCKER-USER (1 references)
- target prot opt source destination
- ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
- DROP all -- anywhere anywhere
- RETURN all -- anywhere anywhere
- # wget 127.0.0.1:3000
- Connecting to 127.0.0.1:3000 (127.0.0.1:3000)
- wget: error getting response: Connection reset by peer
- BTW if I export 3000:3000 it looks like this and still does not work:
- tcp 0 0 :::3000 :::* LISTEN
- # wget localhost:3000
- Connecting to localhost:3000 (127.0.0.1:3000)
- wget: error getting response: Connection reset by peer
- root@imx6q-phytec-mira-rdk-nand:/home/student/projects/mqtt-telegraf-influxdb-grafana# wget 192.168.42.71:3000
- Connecting to 192.168.42.71:3000 (192.168.42.71:3000)
- wget: can't connect to remote host (192.168.42.71): No route to host
- containers can not ping each other:
- # docker exec -ti influxdb /bin/sh
- # ping influxdb
- PING influxdb (172.18.0.2) 56(84) bytes of data.
- 64 bytes from e3fea5e19cd8 (172.18.0.2): icmp_seq=1 ttl=64 time=0.135 ms
- 64 bytes from e3fea5e19cd8 (172.18.0.2): icmp_seq=2 ttl=64 time=0.106 ms
- 64 bytes from e3fea5e19cd8 (172.18.0.2): icmp_seq=3 ttl=64 time=0.103 ms
- ^C
- --- influxdb ping statistics ---
- 3 packets transmitted, 3 received, 0% packet loss, time 2097ms
- rtt min/avg/max/mdev = 0.103/0.114/0.135/0.019 ms
- # ping grafana
- PING grafana (172.18.0.5) 56(84) bytes of data.
- From e3fea5e19cd8 (172.18.0.2) icmp_seq=1 Destination Host Unreachable
- From e3fea5e19cd8 (172.18.0.2) icmp_seq=2 Destination Host Unreachable
- From e3fea5e19cd8 (172.18.0.2) icmp_seq=3 Destination Host Unreachable
- ^C
- --- grafana ping statistics ---
- 6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5231ms
- pipe 4
- #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement