Enable tcp monitoring for libmongod in Linux
When you use virsh to connect to another server, tcp connections are used.
Virsh-c qemu + tcp: // host/system
If the tcp port listening of libmongod is not enabled on the target server
Error: unable to connect to server at 'host: 16509 ': Connection refused
Error: failed to connect to the hypervisor
Solution in Ubuntu
Sed-I's/# listen_tls = 0/listen_tls = 0/G'/etc/libvirt/lib1_d. conf
Sed-I's/# listen_tcp = 1/listen_tcp = 1/G'/etc/libvirt/lib1_d. conf
Sed-I's/# auth_tcp = "sasl"/auth_tcp = "none"/G'/etc/libvirt/lib1_d. conf
Vi/etc/default/libvirt-bin
Change to libpai_opts = "-d-l"
Add-l listener tcp
Service libvirt-bin restart
Solution in CentOS
Sed-I's/# listen_tls = 0/listen_tls = 0/G'/etc/libvirt/lib1_d. conf
Sed-I's/# listen_tcp = 1/listen_tcp = 1/G'/etc/libvirt/lib1_d. conf
Sed-I's/# auth_tcp = "sasl"/auth_tcp = "none"/G'/etc/libvirt/lib1_d. conf
Sed-I's/# lib1_d_args = "-- listen"/lib1_d_args = "-- listen"/G'/etc/sysconfig/lib1_d
Service libmongod restart
This article permanently updates the link address: