Redhat Linux Network Interface Autostart - linux

We have a PostgreSQL cluster with 2 instances, one of them primary and other one is primary. Both of them are running on Red Hat Enterprise Linux release 8.5 (Ootpa). In order unify connection string we use virtual IP.
We have problem with managing virtual IP. We are managing VIP manually.
On the standby node content of my /etc/sysconfig/network-scripts/ifcfg-eth0:1 :
NAME="eth0:1"
DEVICE="eth0:1"
ONBOOT=no
NETBOOT=no
BOOTPROTO=none
IPADDR=$My-VIP
NETMASK="255.255.255.240"
TYPE=Ethernet
PEERDNS=no
When I reboot this standby server it tries to start "eth0:1" interface even though "ONBOOT=no" parameter and that cause trouble because same VIP, "$My-VIP", is already taken by primary instance.
Is there any other configuration that I should check?
If you need extra information or logs please let me know I will provide it as soon as possible.
Thank you in advance!

According to news that I got from my ex colleagues it is because of base interface, "eth0". After reboot eth0 starts all interfaces that depends on it. Only way to get rid of this commenting IPADDR out for eth0:1.

Related

Accidentally broke the network adapter on my VM by telling it to use wrong IP

I accidentally told my network adapter to use a bad ip address in my Internet Protocol Version 4 (TCP/IPv4) properties. A big oops look spread across my face as I pressed the OK button and immediately got disconnected from my remote session. Naturally I can't remote back in and even azure can't reboot the vm. Is there any way I can recover from this?
So things I would do include:
1. Redeploy
2. Try to change VM ip using the portal\powershell
3. Delete the VM and deploy new one using the same os\data disks.

Does vmware-tools restart have to be done in ESX as well as guest?

When restarting the vmware-tools service on the Linux Guest is it necessary to also restart the vmware-tools service on the ESX? I ask because I have 2 other guests running on this ESX/blade.
I'm trying to resolve an obscure issue with SNMP traps not indicating guest health and have to schedule all work accordingly since I manage hundreds of Linux guests on ESX hosts.
no. and there is no vmware-tools service on the ESX. since you are talking about SNMP, the corresponding service should be hostd. unless your change does not solve the issue there is no need to restart hostd.
Restarting the Management agents on an ESXi or ESX host (1003490)
https://kb.vmware.com/kb/1003490

How to access the Cassandra browser terminal running on VirtualBox?

I'm trying to access the Cassandra browser terminal but the reported IP is unreachable.
I'm following the instructions to install Cassandra on VirtualBox here, and have the following configuration:
And Cassandra appears to start up appropriately:
But I'm unable to hit the provided IP (10.0.0.2)
Any idea what's wrong?
Ok, so I went to Install Cassandra OVA on VirtualBox and followed the instructions (like you did). And it didn't work for me, either.
What did work, was messing with the network settings and ultimately switching to a "Bridged" network adapter:
This put the CassandraVM on my internal network, and I was then able to reach everything from an internal IP (192.168.0.103, in my case).
Also, not sure if it made a difference, but I set Promiscuous Mode to "Allow All."
Had the same issue. Here's what worked for me (the solution came from this VirtualBox forum post).
In Host-only Network Details select the Adapter tab and change the ipv4 address into something inside the 10.0.0.x range. I think you should avoid conflicts with settings in the DHCP Server tab, thus a suitable choice would be 10.0.0.254, for example.
Also, I think you should configure your virtual machine's network settings this way:
Attach to: select Host-only Adapter
Name: select vboxnet0
I've also set Allow All for Promiscous Mode, but I don't know if it's strictly required.

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

How can I develop using a local VM server without using URLs with ports in them?

I'm setting up a linux server in a VM for my development.
Previously I've had PHP, MySQL etc etc all installed locally on my Mac. Apart from being a security risk, it's a drag to maintain and keep up to date, and there's a risk that an OS upgrade will wipe part of your setup out as the changes you make are fairly non-standard.
Having the entire server contained within a VM makes it easily upgradable and portable between machines. It means I can have the same configuration as the destination server and with shared folders even if the VM gets corrupted my work is safe on the host machine.
Previously with the local installation I was able to develop on convenient URLs like http://site.dev. I'd quite like to carry this over to the VM way of development but I'm struggling to figure out how, if it's possible at all.
Here's the problem:
In Bridged mode, the VM is part of the same network as the host. This is great but I can't choose a fixed IP address as I may be joining other networks and that address may be taken already. I'd like a consistent way of addressing my VM.
In NAT mode I can't directly address the VM without using port forwarding. I can use http://site.dev if I use the hosts file to forward that to localhost and then localhost:8080 forwards to the vm:80. The trouble is I have to access http://site.dev:8080 which is inconvenient for URL construction.
Does anyone know a way around this? I'm using ubuntu server and virtualbox.
Thanks!
The answer is to define a separate host-only network adapter and use that for host->guest communication.
You can do this by powering down the guest and adding the adapter in the VM settings. Once that's done you can boot the guest again and configure the new network interface however suits you best. I chose a fixed IP address in an unused range.

Resources