Attach and Detach Public IP in AWS
This script is used for detach elastic ip from one server and attach it to the secondary private ip of the other server.
We have two servers with same content named “server01” and “server02” with primary and secondary private IP in AWS and each instance have a public IP (ie. Elastic IP). This two public IP’s are pointed to the DNS.
If “server01” goes down, only you need to detach the elastic IP and attached it to the “server02” to the secondary private IP.
You can find the script in the below link:-
I hope you have installed nodejs. Then you need to install “forever”
forever, developed by nodejitsu, has functions to create applications that are always running—”forever” running. If the application dies, forever brings it back. It has built-in functionality to monitor processes. It also offers an API you can use to incorporate its features into your own code.
forever can be installed using npm. npm should have been installed as part of Node.js:
Running the app
Create the file index.js with the following contents:
Point your browser to http://127.0.0.1 or http://localhost. It should display the index.html”
Now we can use forever to manage our application:, instead of running the above command.
To check, open the browser and point it to the http://127.0.0.1 or http://localhost. It should display the index.html
Stopping the app is similar: