Change new server ip address

You might want to change the ip address of your new server to the old ones. Do the following,

To change the server's main IP address, perform the following steps:
Open the /etc/sysconfig/network-scripts/ifcfg-eth0 file with a text editor.
Edit the IPADDR and GATEWAY lines to use the IP address and gateway of your old server.
Open the /etc/ips file with a text editor.
Add your old server's primary IP address, net mask, and gateway to the file.
Note:
Remove the new server’s primary IP address from this file if it is present.
Restart the network service with the following commands:
For CentOS, CloudLinux™, and Red Hat® Enterprise Linux (RHEL) 6 and earlier, and Amazon Linux, run the service network restart command.
Note:
Amazon Linux always runs in a NAT configuration.
For CentOS, CloudLinux, and RHEL 7 and later, run the systemctl restart network command.
Run the /scripts/mainipcheck command to add the IP address to the /var/cpanel/mainip file.
Run the /scripts/fixetchosts command to add the IP address and hostname of your server to the /etc/hosts file.

and you should be good to go. Test it out and enjoy your new environment!

Google around and you get scary stuff like reinstalling the cluster and stuff like that. But what really works for me without jumping off the building was that the cluster logs in /var/log/cluster was deleted and causes the corosync to die. Hence, you might want to check your log is there before doing some fanciful work of redoing everything.

This is more like my issue which i give myself today. Hence, i better write out how to save my ass later on. Basically i have a Window Server 2012r2 in KVM and after i adjust the hard drive by expanding it, something bad happen and i get the following error

0xc000000f – The Boot Selection Failed Because A Required Device Is Inaccessible

Yeah, I can't restart my server. Hence, i downloaded Window Server 2012r2 iso and boot from it hoping that my server is able to repair and reboot again. I was wrong. It wasn't that easy. Lucky i manage to do it somehow, hence, here, i will be writing how i did it.

Repairing Window Server 2012r2 in KVM

The first thing you need to do is to attach the Window Server 2012r2 setup disc under the DVD drive,

Next head over to fedoraproject and download the virtio driver and also attach it to kvm.

You should have something like the one shown above. Now boot from Windows Server 2012r2 as show below,

Click on Repair Your Computer and you will see this

Click on Troubleshoot and you will see this

Click on System Recovery Image

You will see a warning, ignore it and click Next

Click on Install a driver

Now, select the drive that has virtio driver on it and find a folder call viostor and select the file u see above. Then exit this and go to command prompt,

then key in the following command

diskpart

and list out the volume and make sure you can see your hard disk here.

list volume

It will indicate the RAW volume, which is actually the NTFS partition and is responsible for the generation of boot error.

Now our main target is to convert this RAW volume into NTFS partition. To do so, type the following command:

chkdsk /r /f f:

Once this command used, the main partition now generates the error “The first NTFS boot sector is unreadable or corrupt.” But the good thing is that it actually repairs the second partition.

In this way RAW volume is converted into NTFS partition and the other errors involving indexes, master file table etc. are identified and repaired automatically. Reboot the machine and you should be able to access normally now. All fix!

Interestingly, i needed to setup a Replica Set on Ubuntu 15.10 for MongoDB 3.2 which is the latest Ubuntu and MongoDB version. This also serve as a tutorial for anyone who is interested in setting up a MongoDB Replica Set as well.

Import the public key used by the package management system.

Login to your server as root, we will need to import the public key use by the package manager for mongodb, just fire the following command,

This is to ensure all replica set can communicate with each other. Once you have generated the file above on the primary MongoDB server, copy the same file to other secondary server and update the /etc/mongod.conf on each secondary server along with it.

Aide stands for Advanced Intrusion Detection Environment which is one of the most popular tools for monitoring changes to a Unix or Linux system. Here i will list out how i am going to set this baby up on some of my server to secure on system.

Updating and Installing Aide

sudo apt-get update -y

Once you have update your repo, simply install Aide using the following command

sudo apt-get install aide

And aide is installed in your machine!

Configuring and Test out Aide

Next we are going to configure this baby. Initial the database with the command below,

sudo aideinit

It will take a while and once you have initial the database, Verify that the new aide database has been created