Wednesday, February 18, 2015

AWS - Amazon - Stopping the instance changes my public IP

AWS - Public IP should not be changed

When you stop and start instance, it changes your public IP. If you do not want to change every time, Here is a solution for you.
You need to create Elastic IP for it. 
It will generate a new IP and it will not be changed.

EC2 > Elastic IPs (under network and security)
click on Allocate New address - A new IP will be generated
Now connect this IP to your instance.
Select the new created public IP. Click on the Associated Address.
Enter your instance name. It will show current private IP and current public IP in the drop down.
Now associated with it. Now your instance is connected to new created public IP.
Now if you stop or start your instance, public IP will not be changed.



Friday, January 2, 2015

Keep Python Server Running even after closing the terminal



Suppose you use following command to run your python server
python manage.py runserver
But once you close the terminal, process is killed and python server is stopped automatically.
This can be a bigger problem if server is placed remotely and you want to keep it running always whether your system is turned on or turned off.

Here is a solution for you. Use nohup with your command.
nohup your-command &

In this case, Run this command
nohup python manage.py runserver &
Now if you close the terminal, server still runs.

postgres: Postgres-XC: must start as either a Coordinator (--coordinator) or Datanode (--datanode)

Postgresql Server Error in Ubuntu :
postgres: Postgres-XC: must start as either a Coordinator (--coordinator) or Datanode (--datanode)

To remove this error, remove the package
apt-get --purge remove postgres-xc
But if you are not able to remove it because of an error, Find all processes of postgres using
ps aux | grep postgres
or
ps aux | grep psql

and kill all one by one. Now try to remove again.

Now install these packages:
apt-get install postgresql-client-common
apt-get install postgresql-common
apt-get install postgresql-9.3
apt-get install postgresql-client-9.3
apt-get install postgresql-contrib-9.3