-
#1
Hello, I installed a cluster with two nodes (Prox1 and Prox2) in unicast mode.
when I access the gui of Prox1 I can not see or install anything on node 2 and vice versa equal, if I access next2 I can not do anything in prox 1. Tells me:
Error: Connection Error 595: Connection refused
thank you very much
root@prox1:~# cat /etc/pve/cluster.conf
<?xml version=»1.0″?>
<cluster name=»TELCAT» config_version=»5″><cman keyfile=»/var/lib/pve-cluster/corosync.authkey» transport=»udpu»>
</cman><clusternodes>
<clusternode name=»prox2″ votes=»1″ nodeid=»1″/>
<clusternode name=»prox1″ votes=»1″ nodeid=»2″/></clusternodes></cluster>
root@prox1:~# pvecm status
Version: 6.2.0
Config Version: 5
Cluster Name: TELCAT
Cluster Id: 4882
Cluster Member: Yes
Cluster Generation: 300
Membership state: Cluster-Member
Nodes: 2
Expected votes: 2
Total votes: 2
Node votes: 1
Quorum: 2
Active subsystems: 5
Flags:
Ports Bound: 0
Node name: prox1
Node ID: 2
Multicast addresses: 255.255.255.255
root@prox1:~# pvecm nodes
Node Sts Inc Joined Name
1 M 300 2014-01-21 23:58:22 prox2
2 M 296 2014-01-21 23:57:57 prox1
Last edited: Feb 3, 2014
udo
Famous Member
-
#2
Re: Error: Connection Error 595: Connection refused
Hi,
are both nodes in the GUI «green», or only the one where you logged in?
Any output in the logfile?
Udo
-
#3
Re: Error: Connection Error 595: Connection refused
Yes, both nodes ara «green» and i see storange and vm in left side, baut when i do «click» in the node or vm: Connection Error 595: Connection refused
the accés log:
213.96.32.175 — root@pam [22/Jan/2014:08:12:16 +0100] «GET /api2/json/nodes/prox2/openvz/100/status/current HTTP/1.1» 200 338
213.96.32.175 — root@pam [22/Jan/2014:08:12:17 +0100] «GET /api2/json/nodes/prox2/openvz/100/config HTTP/1.1» 200 341
213.96.32.175 — root@pam [22/Jan/2014:08:12:18 +0100] «GET /api2/json/nodes/prox2/openvz/100/status/current HTTP/1.1» 200 337
213.96.32.175 — root@pam [22/Jan/2014:08:12:18 +0100] «GET /api2/json/cluster/resources HTTP/1.1» 200 697
213.96.32.175 — root@pam [22/Jan/2014:08:12:18 +0100] «GET /api2/json/cluster/tasks HTTP/1.1» 200 1318
213.96.32.175 — root@pam [22/Jan/2014:08:12:21 +0100] «GET /api2/json/nodes/prox1/tasks?errors=0&start=0&limit=500 HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:21 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:21 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:22 +0100] «GET /api2/json/cluster/resources HTTP/1.1» 200 699
213.96.32.175 — root@pam [22/Jan/2014:08:12:22 +0100] «GET /api2/json/cluster/tasks HTTP/1.1» 200 1318
213.96.32.175 — root@pam [22/Jan/2014:08:12:22 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:24 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:26 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:26 +0100] «GET /api2/json/cluster/tasks HTTP/1.1» 200 1318
213.96.32.175 — root@pam [22/Jan/2014:08:12:27 +0100] «GET /api2/json/cluster/resources HTTP/1.1» 200 697
213.96.32.175 — root@pam [22/Jan/2014:08:12:27 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:29 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:30 +0100] «GET /api2/json/cluster/resources HTTP/1.1» 200 695
213.96.32.175 — root@pam [22/Jan/2014:08:12:30 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:31 +0100] «GET /api2/json/cluster/tasks HTTP/1.1» 200 1318
213.96.32.175 — root@pam [22/Jan/2014:08:12:32 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:33 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:34 +0100] «GET /api2/json/cluster/resources HTTP/1.1» 200 695
213.96.32.175 — root@pam [22/Jan/2014:08:12:34 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
213.96.32.175 — root@pam [22/Jan/2014:08:12:35 +0100] «GET /api2/json/cluster/tasks HTTP/1.1» 200 1318
213.96.32.175 — root@pam [22/Jan/2014:08:12:36 +0100] «GET /api2/json/nodes/prox1/status HTTP/1.1» 595 —
-
#4
Re: Error: Connection Error 595: Connection refused
what is the output of:
# cat /etc/pve/.members
-
#5
Re: Error: Connection Error 595: Connection refused
{
«nodename»: «prox2»,
«version»: 5,
«cluster»: { «name»: «TELCAT», «version»: 5, «nodes»: 2, «quorate»: 1 },
«nodelist»: {
«prox2»: { «id»: 1, «online»: 1, «ip»: «x.x.x.x»},
«prox1»: { «id»: 2, «online»: 1, «ip»: «x.x.x.x»}
}
}
The ips ara correct
-
#6
Re: Error: Connection Error 595: Connection refused
I have this issue as well. I can see some of the graphs for a Host when logged into the other host of the cluster, but I can’t see the summary.
I think it has something to do with multicast since this is the only server not located on the exact same switch, however, I’m not sure.
When I am logged into zwtProx1 — 2 — 3 I cannot access zwtTEST.
And when I am in zwtTEST, I cannot access zwtProx1 — 2 — 3. zwtTEST is the only host not on the same physical switch, however, zwtTEST is connect via an unmanaged switched.
-
#7
Re: Error: Connection Error 595: Connection refused
Hi, my two nodes are in the same switch and not use multicast. Use unicast. My error is «Connection refused» and your error is «no route to host»
I don’t find the problem.
any idea?
-
#8
Re: Error: Connection Error 595: Connection refused
In order to properly cluster Proxmox Host, you must have multicast enabled.
-
#9
Re: Error: Connection Error 595: Connection refused
i can’t. In the datacenter don’t permit multicast i the switch
I make test with 2 server in my office and work fine in unicast.
-
#10
Re: Error: Connection Error 595: Connection refused
Hi, i don’t find the problem…
I check all! any idea?
do you believe that it can be a problem whit the swicth? The problem is exclusive in pveproxy. The cluster, the corosync works fine.
-
#11
Re: Error: Connection Error 595: Connection refused
Hi I had the same problem, please check /etc/hosts at every node you have in cluster. IP address in hosts file must be same as real IP on machine. My problem was that I changed IPs after installation proxmox on nodes.
-
#12
Re: Error: Connection Error 595: Connection refused
/etc/host is correct in both servers
-
#13
Re: Error: Connection Error 595: Connection refused
the problem was the switch. Arrrrrrrr!!!
-
#14
Unfortunately I ran into this error too.
I like to run a two node cluster in a hosted environment.
Good news: the cluster is running both nodes are «green» in the webgui, pvecm status looks good etc etc
both nodes have two interfaces, one facing the public internet, and one connected via a crosslink cabel to the other host (10G)
I created the cluster with:
pvecm create <clustername> —bindnet0_addr <ip> —ring0_addr <ip>
directing the cluster internal traffic to the cross linked interface
the firewall allows all traffic between these both (cross linked) interfaces AND all traffic between the two external addresses
IGMP is accepted between the the cross linked interfaces.
Now when I log into the webgui of host A there are both hosts marked «green» on the left menu,
when I click on host A everything works as expected (attributes are displayed in the main window)
when I click on host B I get the «Connection Error 595: Connection refused»
(AND vice versa, I can log into webgui of host B but from there can’t access host A)
I have multicast ONLY between then cross linked interfaces,
my provider doesn’t allow multicast over the external addresses.
Might the be the reason (and if so that would be … sad and bad ?
Or do I miss any special config operation to make it work?
Any hint is appreciated!
TIA
-
#15
Is there no way to get this working?
As mentioned I have the two systems connected via a crosslink cabel and only the ip address of those interfaces configured as
—bindnet0_addr <ip> —ring0_addr <ip>
-
#16
same problem, for me pveproxy was stoped, need to run systemctl restart pveproxy.service
-
#17
same problem, for me pveproxy was stoped, need to run systemctl restart pveproxy.service
That Fixed my issue !!!!!!!!!! Thanks Alot i thought I was screwed!!!
-
#18
If anyone is facing this Connection Error 595 after creating the Proxmox Cluster, this thread may help you to resolve the RCOTI.
Содержание
- [SOLVED] VM giving error 595 connection refused after power outage
- wertyy102
- Connection error 595 . again
- tim taler
- [Solved]Error: Connection Error 595: Connection refused
- ygolonac
- ygolonac
- dietmar
- ygolonac
- Raymond Burns
- ygolonac
- Raymond Burns
- ygolonac
- ygolonac
- sitius
- ygolonac
- ygolonac
- tim taler
- [SOLVED] Change the IP address of one node inside a cluster
- Mephisto aD
- вЂNo Route to Host’ Error in Linux – What To Do
- Are Your Network Settings Correct?
- Is the Host Server Online?
- Are You Connecting to the Right Port?
- Is the Host Name Right?
- Is iptables Blocking the Connection?
- Closing Thoughts
[SOLVED] VM giving error 595 connection refused after power outage
wertyy102
New Member
Here’s where i’m at. I had to rebuild the hostnames file after the power went out as my router had issued 10.x.x.x IP’s, and the new replacement router issues IPs under 192.168.1.x, and since i rebooted after editing my hostnames file, my VM is unreachable. It throws «Connection error 595: Connection Refused» I can’t SSH to it as it is not up. I can however ssh into the host and use the web panel.
VM i’m trying to connect to is id 100. Worst comes to worse, If I can just pull the virtual disk image and load it in a new VM that works too. I just need the data that is in there.
I’ve searched and attempted to figure this out, and I’m at my wits end. Any and all help is greatly appreciated.
bpo90
glusterfs-client: 3.8.8-1
ksm-control-daemon: 1.2-2
libjs-extjs: 6.0.1-2
libpve-access-control: 5.0-8
libpve-common-perl: 5.0-28
libpve-guest-common-perl: 2.0-14
libpve-http-server-perl: 2.0-8
libpve-storage-perl: 5.0-17
libqb0: 1.0.1-1
lvm2: 2.02.168-pve6
lxc-pve: 2.1.1-2
lxcfs: 2.0.8-2
novnc-pve: 0.6-4
proxmox-widget-toolkit: 1.0-11
pve-cluster: 5.0-20
pve-container: 2.0-19
pve-docs: 5.1-16
pve-firewall: 3.0-5
pve-firmware: 2.0-3
pve-ha-manager: 2.0-5
pve-i18n: 1.0-4
pve-libspice-server1: 0.12.8-3
pve-qemu-kvm: 2.9.1-9
pve-xtermjs: 1.0-2
qemu-server: 5.0-22
smartmontools: 6.5+svn4324-1
spiceterm: 3.0-5
vncterm: 1.5-3
zfsutils-linux: 0.7.6-pve1
Источник
Connection error 595 . again
tim taler
Member
Hi all,
I know this has been discussed before, but I ran into this error too and have an additional question/different set up.
I like to run a two node cluster in a hosted environment.
Good news: the cluster is running, both nodes are «green» in the webgui, pvecm status looks good etc etc.
Both nodes have two interfaces, one facing the public internet, and one connected via a crosslink cabel to the other host (10G)
I created the cluster with:
pvecm create —bindnet0_addr —ring0_addr
directing the cluster internal traffic to the cross linked interface
the firewall allows all traffic between these both (cross linked) interfaces AND all traffic between the two external addresses
IGMP is accepted between the the cross linked interfaces.
Now when I log into the webgui of host A there are both hosts marked «green» on the left menu,
when I click on host A everything works as expected (attributes are displayed in the main window)
when I click on host B I get the «Connection Error 595: Connection refused»
(AND vice versa, I can log into webgui of host B but from there can’t access host A)
I have multicast ONLY between then cross linked interfaces,
my provider doesn’t allow multicast over the external addresses.
Might that be the reason (and if so that would be . sad and bad 😉 ?
Or do I miss any special config operation to make it work?
Источник
[Solved]Error: Connection Error 595: Connection refused
ygolonac
New Member
Hello, I installed a cluster with two nodes (Prox1 and Prox2) in unicast mode.
when I access the gui of Prox1 I can not see or install anything on node 2 and vice versa equal, if I access next2 I can not do anything in prox 1. Tells me:
Error: Connection Error 595: Connection refused
thank you very much
# pvecm status
Version: 6.2.0
Config Version: 5
Cluster Name: TELCAT
Cluster Id: 4882
Cluster Member: Yes
Cluster Generation: 300
Membership state: Cluster-Member
Nodes: 2
Expected votes: 2
Total votes: 2
Node votes: 1
Quorum: 2
Active subsystems: 5
Flags:
Ports Bound: 0
Node name: prox1
Node ID: 2
Multicast addresses: 255.255.255.255
# pvecm nodes
Node Sts Inc Joined Name
1 M 300 2014-01-21 23:58:22 prox2
2 M 296 2014-01-21 23:57:57 prox1
Famous Member
Re: Error: Connection Error 595: Connection refused
Hi,
are both nodes in the GUI «green», or only the one where you logged in?
Any output in the logfile?
ygolonac
New Member
Re: Error: Connection Error 595: Connection refused
Yes, both nodes ara «green» and i see storange and vm in left side, baut when i do «click» in the node or vm: Connection Error 595: Connection refused
dietmar
Proxmox Staff Member
Re: Error: Connection Error 595: Connection refused
what is the output of:
Best regards,
Dietmar
Do you already have a Commercial Support Subscription? — If not, Buy now and read the documentation
ygolonac
New Member
Re: Error: Connection Error 595: Connection refused
Raymond Burns
Member
Re: Error: Connection Error 595: Connection refused
I have this issue as well. I can see some of the graphs for a Host when logged into the other host of the cluster, but I can’t see the summary.
I think it has something to do with multicast since this is the only server not located on the exact same switch, however, I’m not sure.
When I am logged into zwtProx1 — 2 — 3 I cannot access zwtTEST.
And when I am in zwtTEST, I cannot access zwtProx1 — 2 — 3. zwtTEST is the only host not on the same physical switch, however, zwtTEST is connect via an unmanaged switched.
ygolonac
New Member
Re: Error: Connection Error 595: Connection refused
Hi, my two nodes are in the same switch and not use multicast. Use unicast. My error is » Connection refused» and your error is «no route to host»
I don’t find the problem.
Raymond Burns
Member
Re: Error: Connection Error 595: Connection refused
In order to properly cluster Proxmox Host, you must have multicast enabled.
ygolonac
New Member
Re: Error: Connection Error 595: Connection refused
i can’t. In the datacenter don’t permit multicast i the switch
I make test with 2 server in my office and work fine in unicast.
ygolonac
New Member
Re: Error: Connection Error 595: Connection refused
Hi, i don’t find the problem.
I check all! any idea?
do you believe that it can be a problem whit the swicth? The problem is exclusive in pveproxy. The cluster, the corosync works fine.
sitius
New Member
Re: Error: Connection Error 595: Connection refused
Hi I had the same problem, please check /etc/hosts at every node you have in cluster. IP address in hosts file must be same as real IP on machine. My problem was that I changed IPs after installation proxmox on nodes.
ygolonac
New Member
Re: Error: Connection Error 595: Connection refused
/etc/host is correct in both servers
ygolonac
New Member
Re: Error: Connection Error 595: Connection refused
the problem was the switch. Arrrrrrrr.
tim taler
Member
Unfortunately I ran into this error too.
I like to run a two node cluster in a hosted environment.
Good news: the cluster is running both nodes are «green» in the webgui, pvecm status looks good etc etc
both nodes have two interfaces, one facing the public internet, and one connected via a crosslink cabel to the other host (10G)
I created the cluster with:
pvecm create —bindnet0_addr —ring0_addr
directing the cluster internal traffic to the cross linked interface
the firewall allows all traffic between these both (cross linked) interfaces AND all traffic between the two external addresses
IGMP is accepted between the the cross linked interfaces.
Now when I log into the webgui of host A there are both hosts marked «green» on the left menu,
when I click on host A everything works as expected (attributes are displayed in the main window)
when I click on host B I get the «Connection Error 595: Connection refused»
(AND vice versa, I can log into webgui of host B but from there can’t access host A)
I have multicast ONLY between then cross linked interfaces,
my provider doesn’t allow multicast over the external addresses.
Might the be the reason (and if so that would be . sad and bad 😉 ?
Or do I miss any special config operation to make it work?
Источник
[SOLVED] Change the IP address of one node inside a cluster
Mephisto aD
New Member
I’m recently having a two nodes Cluster of PVE in my home environment.
Caused by some accidents i needed to change the IP address of one node (the other one remained where it was on the IP-range)
On both nodes (while they still had quorum) i changed the corosync.conf running :
and finally restarting the service on both nodes (just in case 😉
after that i needed to change the nodes IP-address:
[This is the point where I am right now]
So now i have two issues which seem to be leftovers from the IP-change:
1. When I now move anything to the node with the new IP I receive this output in the Migration window:
If i get this correctly for the migrations there must be another config file storing the IP-adresses of the other nodes. Does anyone know where I need to edit this?
2. Logging into the webinterface on the node which didn’t change I usually also saw the stats of the VMs from the other node (where I changed the IP-address). Unfortunately this looks like that now:
On the web-ui of the node with changed address anyway this doesn’t occur and i cann see all the stats from both nodes.
So maybe in this second case it also tries to still connect to the old address of this node? How can fix this?
Thanks a lot already
This forum with all the help i found here reading in your threads is simply great!
Источник
вЂNo Route to Host’ Error in Linux – What To Do
Have you come across the ‘No Route to Host’ while trying to reach a server on Linux? This service connection error may be annoying, but you can fix it once you identify the cause.
‘No Route to Host’ denotes a network problem, usually one which shows up when the server or host is not responding. This may happen because of network issues or because of an inappropriate setup.
We’ll cover how to troubleshoot and remedy your network situation in this article.
Are Your Network Settings Correct?
Before we look at the more specific causes for this problem, make sure that your network settings are correct. Can you connect to the web? Is your DNS properly configured?
- Let’s start by running this command to find out: systemd-resolve –status
- If you spot any DNS problems there, go back to your network configuration and redo it if you have to. If you are using a standard network with a dynamic IP, the DNS numbers should update automatically.
- To manually configure your DNS, go to Network Manager and manually enter the IP address in the IPv4 tab.
- If your Linux distribution doesn’t have a graphical desktop, go to “/etc/systemd/resolved.conf”, find the DNS line and change the numbers with the numbers of the DNS you want and make other configurations if you have to.
- Also, if you have set up a static IP, you may want to revert to a dynamic IP and let your network get the connection information through DHCP.
Don’t forget to restart your computer before trying to connect to the host again. If you are still getting ‘No Route to Host’ keep on reading.
Is the Host Server Online?
The next step is to check that the host you are trying to connect to is actually online. After all, one of the most frequent causes for the error is that the service isn’t running as a result of maintenance or some other issue.
If the service is not online, check whether the host is. Sometimes the service may have stopped or not been started to begin with, even if there’s nothing wrong with the server itself.
- Using systemd, run the command: sudo systemctl status servicename
If the service is running, you need to look for another cause.
Are You Connecting to the Right Port?
Double check any documentation the host may have provided. It’s a common practice for server managers to lock down ports that aren’t used to improve server security. Attackers often use common ports to target Linux services.
If you are trying to connect to your own server, you can trace back the service to the correct port. To do this, you need to install a security tool that can help you see open ports – NMAP.
Here are the commands for installing NMAP across different Linux distributions:
CentOS: yum install nmap
Debian: apt-get install nmap
Ubuntu: sudo apt-get install nmap
Once you’ve installed NMAP, check to see open ports with the following command: sudo nmap -sS target-server-ip
If you don’t have direct access to the server, you’ll have to contact the host. But before you do that, take a look at some of the other possible causes for the ‘No Route to Host’ error in Linux.
Is the Host Name Right?
You may also get the ‘No Route to Host’ error if your computer and the server you are trying to connect to use different host names. Both machines should be configured to connect to one another.
Apart from the usual hosts configuration, you want to pay attention to the hosts.deny and hosts.allow files in “/etc”. If you are trying to connect to a new server, make sure you get the hostname of the server right.
Is iptables Blocking the Connection?
iptables is pretty useful when you want to configure the Linux kernel firewall tables. The full control it gives you over traffic that comes in and out of your computer is great.
But through a simple configuration mistake, iptables could block the connection to the port you want to reach and give rise to the ‘No Route to Host’ error.
- First, print out a list of your iptables and its connections by typing sudo iptables -L and hitting Enter.
- To check whether iptables is to blame, run the following command: sudo iptables -S. This will allow you to see whether the iptables rules that you have set block the connection. You may have to add an accept rule to the default INPUT chain.
- To clear up the firewall rules for an external firewall, you can use this command: sudo iptables -F
Closing Thoughts
As you can see, it may take a while to get to the bottom of the ‘No Route to Host’ error, but the steps above should help you. While it may look like a complex problem, often it’s the result of conflicting configurations or simple network issues.
Have you come across any other potential causes and fixes for this error? Drop us a comment and tell us about it.
Источник
When you’re trying to connect to a service on Linux, “No route to host” is one of the last things you want to hear. It’s a broad message that means your computer can’t reach the target server, whether a local server daemon running on your system or a remote server that you can’t access for whatever reason. Here we show you how to fix the “no route to host” connection error in Linux.
Why Am I Getting the “No Route to Host” error?
There are many reasons why you could be getting that error. Networking in Linux is a somewhat complicated stack that’s pretty intricate, and as a result, it’s tough to determine exactly where the issue is.
Host Is Offline/Service Isn’t Running
It may seem painfully obvious, but you should first check that the server that you’re trying to connect to is even online. It might have been taken down for maintenance or be experiencing issues.
The service itself might not have been started. If it’s your server, you can check to see if the service has been started and is running properly. To do that with Systemd, run the following command.
sudo systemctl status SERVICENAME
Wrong Port
You may be trying to connect on the incorrect port. Many system administrators choose to run commonly targeted services like SSH on different ports to help thwart would-be attackers.
If the server isn’t your own, check the available documentation or contact their support services.
For your own server, you can try using NMAP to figure out where you started your service.
sudo nmap -sS your.server.ip
If you think you used a really obscure port, you can use the -p-
flag to scan them all. It will take a while though.
Iptables Is Blocking the Connection
You may have accidentally configured iptables to block connections on that port. You would receive the same message whether you configured iptables on the server or your desktop, so it’s worth checking both. To see your iptables rules, run the following command.
Your DNS Is Improperly Configured
If all else fails, you should try to ping
the IP address that you’re looking to connect to. It could be that your computer isn’t connecting to a DNS server properly.
If the ping works but connecting a domain name doesn’t, you’re looking at a DNS issue.
Systemd users can run systemd-resolve --status
to check the DNS servers that your system is using. It’s broken down by interface, so make sure to check the one that you’re actually trying to connect through.
In most cases your computer will discover the relevant DNS information over DHCP. If you’re using a static IP or something on your network is configured differently, you may have to set your DNS manually.
Open “/etc/systemd/resolved.conf.” In that file, uncomment the DNS
line and add either the IP of your router or another known DNS server. The default fallback DNS for Systemd is Google’s DNS servers listed under FallbackDNS
.
If you’re using OpenRC or another Systemd alternative, you can find your DNS information in “/etc/resolv.conf.”
If there’s nothing there, enter the IP address of your router or any other known DNS server that you’d prefer to use.
After, either restart networking or your entire computer.
The GUI Way
If you’re using a graphical desktop with Network Manager, you can edit your connection information that way. Open the applet or go through your system settings. Select your connection and find the “IPv4” tab. Switch the connection to “Manual” and manually enter in the IP address of your computer and the IP of your router as the gateway. Then, in the DNS field below, enter your router’s IP or the IP of another DNS server.
Incorrect Network or Host Configuration
There are several other configuration options that may be incorrect. Any of them would make it impossible for your computer to connect to the server.
First, make sure that your computer’s network configuration is correct. Double-check the configuration files themselves and, of course, see if you can connect to the Internet another way.
If you’re using a specific hostname to connect or you’ve set up specific hosts on either the server or the client, you need to make sure both machines can connect to each other. Check the configurations of “/etc/hosts,” “/etc/hosts.allow,” and “/etc/hosts.deny.”
Finally, check your server configuration. Something may be improperly configured on the server, preventing clients from connecting properly.
Hopefully, using these tips has allowed you to fix whatever issues were happening that caused the “No Route to Host” error. Meanwhile, you can learn how to control your Wi-Fi network in Linux or check if your firewall is blocking any incoming and outgoing connection.
John Perkins
John is a young technical professional with a passion for educating users on the best ways to use their technology. He holds technical certifications covering topics ranging from computer hardware to cybersecurity to Linux system administration.
Subscribe to our newsletter!
Our latest tutorials delivered straight to your inbox
Linux is more often than not a hassle-free operating system to use. However, no OS on the planet is immune to networking issues, and the same stands true for Linux.
In this article, we’re looking at the “no route to host” error in Linux, its causes and how you can fix the problem.
What causes the ‘no route to host’ issue?
The error is primarily triggered when the network, server or host you’re trying to connect to you is not responding. It could indicate an inactive internet connection, incorrectly set up router profiles or any number of settings that can restrict your access to the particular server you’re trying to reach.
Also read: How to change file permissions recursively using Chmod in Linux?
How to fix the ‘no route to host’ issue?
Here are six solutions to try out and fix the no route to host issue.
Check your internet connection
Minecraft requires an active internet connection to work. If you have an unstable internet connection, chances are you’re going to miss out on notifications. Suppose you’re on WiFi check to see if you’ve got internet access and strong signals. If you’re on mobile data, check to see if data is enabled and that you’ve got good network coverage.
Incorrect network or host configuration files
Linux uses a bunch of configuration files to define several rules, which it then uses to connect to either the internet or a dedicated host over the internet or even your local network. Check to see if these files are in order and allow outgoing connections. Be sure to check the following three files at least:
/etc /hosts /etc /hosts.allow /etc /hosts.deny
Check your services
The most obvious thing can be whether the service you’re trying to connect to you is running or not. If you’re trying to connect to an external server, check its status to see if it’s running or not.
If you’re operating a server yourself, use the systemctl command to see if the service is running.
sudo systemctl status [service name]
Also read: How to rename a directory in Linux?
Check the port
If the service is online, the next point of failure is most likely the port you’re connecting to. Most services change their default port as a security measure to avoid attackers from snooping in and causing damage. Check to see if you’re using the right port number.
If you’re using your server, try using NMAP to determine which port your service is running using the following command.
sudo nmap -sS [your server's IP]
Check IPTables
Another possible reason for the error could be IPTables blocking connections on the port the service is trying to communicate through. Check to see if the service is allowed to get through IPTables.
sudo iptables -S
DNS issues
If you can ping your server’s IP address but can’t resolve the domain name, you’re most likely facing a DNS issue. In most cases, your PC will fetch DNS information automatically using DHCP, but things can be different if you’re using static IP assignments.
Here’s how you can set up your DNS manually.
Step 1: Navigate to the following directory and open the resolved.conf file.
/etc/systemd/
Step 2: Uncomment the DNS= line and add your router’s default IP.
If you’re using OpenRC or any other systemd alternative, your DNS files will be in /etc/resolve.conf. Once you’ve updated the rules, try restarting your router and PC.
Also read: How to access command line history on Linux?
Someone who writes/edits/shoots/hosts all things tech and when he’s not, streams himself racing virtual cars.
You can contact him here: [email protected]
Содержание
- 1 Правильны ли настройки вашей сети?
- 2 Хост-сервер подключен к сети?
- 3 Вы подключаетесь к нужному порту?
- 4 Правильно ли указано имя хоста?
- 5 Iptables блокирует соединение?
- 6 Заключительные мысли
Сталкивались ли вы с «No Route to Host» при попытке получить доступ к серверу в Linux? Эта ошибка подключения к услуге может раздражать, но вы можете исправить ее, как только определите причину.
«No Route to Host» (Нет маршрута к хосту) обозначает проблему в сети, обычно возникающую, когда сервер или хост не отвечает. Это может произойти из-за проблем с сетью или из-за неправильной настройки.
Правильны ли настройки вашей сети?
Прежде чем мы рассмотрим более конкретные причины этой проблемы, убедитесь в правильности настроек вашей сети. Можете ли вы подключиться к сети? Ваш DNS правильно настроен?
Запустите эту команду, чтобы узнать:
systemd-resolv –status
Если вы обнаружите там какие-либо проблемы с DNS, вернитесь к конфигурации вашей сети и, если потребуется, повторите ее. Если вы используете стандартную сеть с динамическим IP, номера DNS должны обновляться автоматически.
Чтобы вручную настроить DNS, перейдите в Network Manager и вручную введите IP-адрес на вкладке IPv4.
Если в вашем дистрибутиве Linux нет графического рабочего стола, перейдите в «/etc/systemd/resolved.conf» и найдите строку DNS.
Измените номера на номера DNS, которые вы хотите, и при необходимости сделайте другие конфигурации.
Кроме того, если вы настроили статический IP-адрес, вы можете захотеть вернуться к динамическому IP-адресу и разрешить вашей сети получать информацию о соединении через DHCP.
Не забудьте перезагрузить компьютер, прежде чем пытаться снова подключиться к хосту. Если вы по-прежнему получаете «No Route to Host», продолжайте читать.
Хост-сервер подключен к сети?
Следующим шагом является проверка того, что хост, к которому вы пытаетесь подключиться, действительно подключен. В конце концов, одной из наиболее частых причин ошибки является то, что служба не работает в результате обслуживания или какой-либо другой проблемы.
Если служба не в сети, проверьте, есть ли хост. Иногда служба может быть остановлена или не запущена с самого начала, даже если с самим сервером все в порядке.
Используя systemd, запустите команду…
sudo systemctl status servicename
Если служба работает, вам нужно искать другую причину.
Вы подключаетесь к нужному порту?
Дважды проверьте любую документацию, которую может предоставить хост. Обычно администраторы серверов блокируют порты, которые не используются для повышения безопасности сервера. Злоумышленники часто используют общие порты для нацеливания на службы Linux.
Если вы пытаетесь подключиться к своему собственному серверу, вы можете отследить службу до правильного порта. Для этого вам нужно установить средство безопасности, которое поможет вам увидеть открытые порты — NMAP.
Вот команды для установки NMAP в разных дистрибутивах Linux:
CentOS: ням установить nmap
Debian: apt-get установить nmap
Ubuntu: sudo apt-get установить nmap
После установки NMAP проверьте наличие открытых портов с помощью следующей команды:
sudo nmap -sS target-server-ip
Если у вас нет прямого доступа к серверу, вам придется связаться с хостом. Но прежде чем сделать это, рассмотрим некоторые другие возможные причины ошибки «No Route to Host» в Linux.
Правильно ли указано имя хоста?
Вы также можете получить ошибку «No Route to Host», если ваш компьютер и сервер, к которому вы пытаетесь подключиться, используют разные имена хостов. Обе машины должны быть настроены на соединение друг с другом.
Помимо обычной конфигурации хостов, вы должны обратить внимание на файлы hosts.deny и hosts.allow в «/ etc». Если вы пытаетесь подключиться к новому серверу, убедитесь, что вы правильно указали имя хоста сервера.
Iptables блокирует соединение?
iptables очень полезен, когда вы хотите настроить таблицы брандмауэра ядра Linux. Полный контроль над трафиком, который входит и выходит из вашего компьютера, великолепен.
Но из-за простой ошибки конфигурации iptables может заблокировать соединение с портом, к которому вы хотите подключиться, и вызвать ошибку «No Route to Host».
Чтобы проверить, виноват ли iptables, выполните следующую команду:
sudo iptables -S
Посмотрите, блокируют ли установленные вами правила iptables соединение. Возможно, вам придется добавить правило принятия в цепочку INPUT по умолчанию.
Чтобы очистить правила брандмауэра для внешнего брандмауэра, вы можете использовать эту команду:
iptables -F
Заключительные мысли
Как видите, может потребоваться некоторое время, чтобы добраться до сути ошибки «No Route to Host», но описанные выше шаги должны помочь вам. Хотя это может выглядеть как сложная проблема, часто это является результатом конфликтующих конфигураций или простых сетевых проблем.
Вы сталкивались с другими потенциальными причинами и исправлениями этой ошибки? Оставьте нам комментарий и расскажите нам об этом.
Есть группа контейнеров, которая поднимается похожим файлом:
version: "3"
services:
ff_corecomp:
restart: always
build: ./corecomp
depends_on:
- ff_postgres
ff_postgres:
restart: always
image: "postgres"
environment:
- POSTGRES_PASSWORD=pass
В ff_corecomp есть такой процесс создания пула для asyncpg:
await asyncpg.create_pool(
dsn="postgres://postgres:pass@ff_postgres:5432/")
Неожиданно код начал падать на этой строчке. Traceback:
spoiler
File «./utils/db.py», line 13, in init_pool
ff_corecomp_1 | db.pool = await asyncpg.create_pool(
ff_corecomp_1 | File «/usr/local/lib/python3.8/site-packages/asyncpg/pool.py», line 398, in _async__init__
ff_corecomp_1 | await self._initialize()
ff_corecomp_1 | File «/usr/local/lib/python3.8/site-packages/asyncpg/pool.py», line 426, in _initialize
ff_corecomp_1 | await first_ch.connect()
ff_corecomp_1 | File «/usr/local/lib/python3.8/site-packages/asyncpg/pool.py», line 125, in connect
ff_corecomp_1 | self._con = await self._pool._get_new_connection()
ff_corecomp_1 | File «/usr/local/lib/python3.8/site-packages/asyncpg/pool.py», line 468, in _get_new_connection
ff_corecomp_1 | con = await connection.connect(
ff_corecomp_1 | File «/usr/local/lib/python3.8/site-packages/asyncpg/connection.py», line 1668, in connect
ff_corecomp_1 | return await connect_utils._connect(
ff_corecomp_1 | File «/usr/local/lib/python3.8/site-packages/asyncpg/connect_utils.py», line 663, in _connect
ff_corecomp_1 | raise last_error
ff_corecomp_1 | File «/usr/local/lib/python3.8/site-packages/asyncpg/connect_utils.py», line 652, in _connect
ff_corecomp_1 | con = await _connect_addr(
ff_corecomp_1 | File «/usr/local/lib/python3.8/site-packages/asyncpg/connect_utils.py», line 621, in _connect_addr
ff_corecomp_1 | tr, pr = await asyncio.wait_for(
ff_corecomp_1 | File «/usr/local/lib/python3.8/asyncio/tasks.py», line 483, in wait_for
ff_corecomp_1 | return fut.result()
ff_corecomp_1 | File «uvloop/loop.pyx», line 1974, in create_connection
ff_corecomp_1 | File «uvloop/loop.pyx», line 1951, in uvloop.loop.Loop.create_connection
ff_corecomp_1 | OSError: [Errno 113] No route to host
No route to host вызвала у меня ровно две идеи: сеть внутри докера маршрутизирует что то неверно, или контейнер с постргесом не поднялся.
Первая идея отпала быстро: я открыл шелл в контейнере ff_corecomp, и из него спокойно идут пинги до ff_postgres. Вторая идея тоже оказалась неверной: к моменту запуска контейнера ff_corecomp постгрес уже пишет, что готов принимать соединения. Что еще здесь может быть не так?