Have an AWS EC2 instance which is running Amazon Linux AMI 2. Installed PostgreSQL using
sudo amazon-linux-extras install postgresql13
Now, how to start it and configure it?
I can see
Package postgresql-13.3-2.amzn2.0.1.aarch64 already installed...
The command
sudo amazon-linux-extras install postgresql13
installs only the client. This is not server. You still have to setup server separately apart from the client yourself.
Thus, to install postgresql 13, you have install the client (if you haven't done so yet). It is needed as Amazon Linux 2 will install matching server (v13), not default version 9.
sudo amazon-linux-extras install postgresql13
and now install server (this should install v13, as it matches your client):
sudo yum install postgresql-server
now you enable it:
sudo systemctl enable postgresql
initialize it:
sudo /usr/bin/postgresql-setup --initdb
start it:
sudo systemctl start postgresql
and finally check its status:
sudo systemctl status postgresql
You can use below command to start the installed service in AML-2
$ sudo systemctl start postgresql-13
$ sudo systemctl status postgresql-13
Now to configure the postgresql server you need to configure postgresql.conf file which you can find by
$ find / -name postgresql.conf
or you can ask postgresql where is postgresql.conf
$ psql -U postgres -c 'SHOW config_file'
you can begin with postgresql configurations
also refer install pg13 on amzl-2 and validate your installation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With