0:13 AM How to install PostgreSQL at Amazon EC2 |
Here is how to make a no frills installation of PostgreSQL to micro image Amazon Elastic Cloud Computing (ec2). Login to your virtual machine's ssh console. You need to be root at the first stage of the install: [root@ip ~]# sudo su - Then, create dedicated user for postgres (it is highly advised to have one separate user just for the DB, and postgresql won't let you proceed with some things if you are root): [root@ip ~]# adduser postgres Then we need to create our "cluster" folder, - place to keep actual data and logs. I prefer /var/pgsql instead of default /var/lib/pgsql [root@ip ~]# mkdir /var/pgsql Set postgres ownership to /var/pgsql (added as reminded in comments, thanks folks!): [root@ip ~]# chown postgres.postgres /var/pgsql Set permissions: chmod 750 /var/pgsql Now, let's proceed to actually installing PostgresSQL (I installed the stock EC2 one): [root@ip ~]# yum install postgresql-libs postgresql postgresql-server That's what appeared for the version info:
=================================================================== Now it is the time to deal with the cluster paths: [root@ip ~]# vi /etc/init.d/postgresql Edit to: PGDATA=/var/pgsql Finally it is the time to create the cluster. You got to be postgres user in order to do that: [root@ip ~]# su postgres Now we are back root, and it is time to actually start the postgresql service: [root@ip ~]# service postgresql start Confirm it is actually running: [root@ip ~]# service postgresql status If it is Ok, then it is fine to add it to "autostart" on boot: sudo chkconfig postgresql on Additional Info
|
|
Total comments: 7 | |||||||
| |||||||