在Debian虚拟机VM上安装consul之后,我运行了“consul agent -dev”来启动代理。标准看起来很好。
然后我在另一个终端输入“consul members”,发现它正在侦听127.0.0.1:8301而不是非环回地址。
root@debian02:/home/steven# consul members
Node Address Status Type Build Protocol DC Segment
debian02 127.0.0.1:8301 alive server 1.0.1 2 dc1 <all>
我可以运行另一个可以侦听所有地址的程序,因此网络配置应该适用于VM。
可能出现什么问题?
这是ip地址的输出:
root@debian02:/home/steven# ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 08:00:27:9d:a7:7e brd ff:ff:ff:ff:ff:ff
inet 10.0.2.4/24 brd 10.0.2.255 scope global dynamic enp0s3
valid_lft 812sec preferred_lft 812sec
inet6 fe80::a00:27ff:fe9d:a77e/64 scope link
valid_lft forever preferred_lft forever
netstat的输出:
root@debian02:/home/steven# netstat -lntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:8302 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8500 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8600 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8300 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:8301 0.0.0.0:* LISTEN
tcp6 0 0 ::1:631 :::* LISTEN
udp 0 0 0.0.0.0:631 0.0.0.0:*
udp 0 0 0.0.0.0:5353 0.0.0.0:*
udp 0 0 0.0.0.0:1900 0.0.0.0:*
udp 0 0 0.0.0.0:47046 0.0.0.0:*
udp 0 0 0.0.0.0:68 0.0.0.0:*
udp 0 0 127.0.0.1:8301 0.0.0.0:*
udp 0 0 127.0.0.1:8302 0.0.0.0:*
udp 0 0 127.0.0.1:8600 0.0.0.0:*
udp6 0 0 :::52337 :::*
udp6 0 0 :::5353 :::*
谢谢,
史蒂芬
答案 0 :(得分:0)
你看过文件吗? https://www.consul.io/docs/agent/options.html#_client
它默认绑定到0.0.0.0
并且可以更改。你可以使用$PathBackup = Test-Path Env:\systemroot\software -IsValid
If ($PathBackup -eq $true) {Write-host "There is backup's"}
Else {write-Verbose "There is no backup's of folder \software*"}