Connections Timeout to VM Linux - azure

We have 6 VM ubuntu linux in AZURE yesterday and the day 6 server lost connection , and generate Timeout error when connecting via SSH , the strange thing is that only happened with linux servers with windows servers did not happen , know that this occurred .

My Linux servers seem to be down more than up../ and I can't reach them to get it up lol I think their cpu throttling and firewall / loadblallancer sucks

Related

How can I link a C websocket server running on AWS Linux with the client on a virtual machine locally?

I recently wrote an echoserver / echoclient program in C for the online class I'm taking (Graduate Introduction to Operating Systems, here). I was able to complete it with the help of (and modification from Beej's Network guide (here). I can run it just fine on my Ubuntu 20.04 virtual machine, running on my Windows 10 laptop. However, I'm trying to run the echoserver on an AWS Linux instance and the echoclient from the Ubuntu VM, as my end goal is building a client program that has a central server data repository. However, I'm running into issues where I start the echoserver C code on the AWS EC2 instance through SSH-ing by PuTTy, then I run the echoclient on the Ubuntu VM, but it can't connect (the error I receive on the client side is that it failed the connect phase of the socket call). I've tried the following steps:
Editing the inbound rules of the security configuration of the EC2 instance to allow for 'All TCP' connections from the IP address that comes up when I run curl ifconfig.me on my Ubuntu machine
Changing the network setting of my Ubuntu VM from NAT to Bridged Network
Testing port access by telnet <AWS Public IP> <PortNo> - which led to "Connection Refused" error
Ensuring that my outgoing ports aren't blocked by following these instructions
I've looked through the AWS pages (here) as well as multiple developer / SO threads (best one I found so far here) and I just can't seem to figure out out. If anyone could help me out, I'd really appreciate it. I'm happy to post my server & client code if that would be of help.
Figured it out: was missing the following line of code in my server.
hints.ai_flags = AI_PASSIVE;

Ping General Failure In Windows 10

I have 2 computers connected via a TP-Link router on my LAN, a windows 7 ultimate 64bit and a windows 10 enterprise 64bit. On windows 7 I'm able to ping the wind windows 10 machine successfully but on the windows 10 I get an error "General Failure", even if I ping the gateway I still face the same error.
I need your help guys on this one.
I sort of had the same Issue. CouldnĀ“t ping my own ip or my gateway. For me it was the nord-Vpn service running in the background. Once i shut it down in the taskmanager, i could successfully ping again. So maybe check if there are VPN-Services running.

ActiveMq messaging between Windows and Linux apps using Virtualbox on same PC not working

We are using Active MQ to have applications message each other. We have applications running on both Windows and Linux. During development, the team uses their Windows PC with VirtualBox with a RHEL Linux image. We are trying to run the Active MQ broker on the Linux local VM. When we do, messages from Windows can't use it. If we run the broker on Windows, the windows applications can message each other, but not the Linux apps.
I have tried setting port-forwarding in VB for 61616 (though what should the guest port be?), but that doesn't seem to do it. I forwarded 8161 listed in jetty.xml and am able to connect my Windows browser to it.
The exception text I get in Windows is "Channel was inactive for too long". I tried setting maxInactivityDuration to 0 for both sides, but that hasn't done it.
Any ideas on how to get this set-up to work?
I just found a post on VirtualBox port forwarding that helped me. (Yes, I had searched like mad yesterday before posting my question this morning :)
Virtualbox "port forward" from Guest to Host
I set port forwarding as described in the section "Network communication Host -> Guest" of the post. I then updated my activemq.xml file...
<transportConnectors>
<transportConnector ... uri="[my VM guest IP which was 10.0.2.15]:61616..." ... />
</transportConnectors>
I still had to set wireFormat.maxInactivityDuration in the uri string for transportConnector, otherwise I was getting "Channel was inactive for too long" right away. I don't know why. Anyway, this is way further than I was yesterday.

Microsoft azure ssh connection to VM keeps dropping

I am connecting to virtual machine (ubuntu 14.04) hosted on Microsoft Azure using ssh. My problem is that my connection drops every couple minutes (same period) and I need to reconnect. This is not related to internet connection because it doesn't drop. I tried logging from different pc's, it's all the same.
Sometimes this is caused by inactivity: see http://www.cyberciti.biz/tips/open-ssh-server-connection-drops-out-after-few-or-n-minutes-of-inactivity.html
To summarize, an ssh connection is sometimes dropped after a few minutes.
From the OpenSSH man page:
This is usually the result of a packet filter or NAT device timing out your TCP connection due to inactivity. For security, reason most enterprises only use SSH protocol version 2. This problem only occurred with version 2.
You can try following the instructions in that article.

oracle thin jdbc connection receiving "connection reset" after inactivity

I have a new tomcat application server running on tomcat 6, java 6 (openjdk), centos 6.2. The server is a virtual machine running under qemu-kvm on a centos 6.2 host. Both host and guest are 64-bit.
I have a case where a connection is opened, (from a connection pool) then a "long computation" occurs for about 4 hours, during which the connection is not used. Finally, a "commit" is issued, and the server gives a "connection reset" exception, specifically:
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:185)
at oracle.net.ns.Packet.receive(Packet.java:282)
at oracle.net.ns.DataPacket.receive(DataPacket.java:103)
at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:230)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:175)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:100)
at oracle.net.ns.NetInputStream.read(NetInputStream.java:85)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readNextPacket(T4CSocketInputStreamWrapper.java:122)
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.read(T4CSocketInputStreamWrapper.java:78)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1179)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1155)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:279)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C7Ocommoncall.doOCOMMIT(T4C7Ocommoncall.java:75)
at oracle.jdbc.driver.T4CConnection.doCommit(T4CConnection.java:558)
The database server and the client are on the same subnet, except the server is a real physical host, and obviously the app-server is a guest running inside a physical machine on the same subnet.
The host used "bridged" networking.
This may not be a software problem at all but rather a linux os configuration (iptables?) issue, but I really don't know.
I have run into this a couple of times. Almost always caused by a network timeout (load balancer or firewall). But you have clearly mentioned that your servers are on the same subnet, so not really sure what is going on. Since you suspect iptables, can you turn it off, run the test and see if it works (too easy huh :)
Regardless, assuming you are connecting to an Oracle db, the following tweak helps
http://raibledesigns.com/rd/entry/tomcat_oracle_connectivity_problems
If you use a different db (say mysql) the setting might be different but the logic is the same. Setup a keepalive value to prevent the connection from being idle for too long. This way the firewal/load balancer/iptables software will not terminate it.
As you can see in this post in Oracle Forums, this can have more than one problem / solution.
Check if your JDBC driver version is correct
Check your ORACLE_HOME environment variable
try add the argument -Djava.security.egd=file:///dev/urandom
Your logic use a singleton to get the connection? In the post this are mentioned too
Hope this helps you.
#user is referring to a good workaround, by configuring "SQLNET.EXPIRE_TIME=10" in sqlnet.ora.
However, this workaround is only applicable if your application is using thick OCI (jdbc:oci), not thin (jdbc:thin) driver.
Linux has software firewall, i.e. iptables, which can drop idle network connection, so even you are in the same subnet, you have iptables software firewall. This is activated by default in all modern Linux, and up to Linux administrator to disable it.
By default, Linux iptables does not drop idle TCP/IP connections (jdbc belongs to TCP/IP protocol), so the Linux administrator must configured iptables to do so. Following is the detail explanation for any reader who are interested to know more:
http://www.digitage.co.uk/digitage/software/linux-security/cutter
Business users, security team, or architect often suggest network/OS admin to abort idle connection using firewall, as well as router. This is always a "recommendation" in the anti-hacking community, but it is not properly discussed, and causing application instability. Eventually, you should discuss with the team to find a balance

Resources