“PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.” - postgresql.org
NOTE: Setting up and administering the database on your groov EPIC is only for advanced developers who are familiar with both Linux shell commands and database administration. Once you enable Secure Shell access, you are on your own and will have to solve any issues that arise through your own knowledge and online research. Opto 22 product support is limited to helping you reset the groov EPIC processor to factory defaults; our Product Support engineers cannot help you with programming, usage, or troubleshooting.
CAUTION: Before updating groov EPIC firmware, be sure you back up any files or applications you have created, including database table entries, as they will be deleted during the update. In addition, be aware that when you update EPIC firmware, your installation and PostgreSQL database setup will not be restored. You will need to repeat the steps in this guide after you have updated the firmware.
Installing PostgreSQL
- Log into shell and use apt to update the package repositories.
- Use apt to install
postgresql
,postgresql-client
, andpostgresql-doc
.
Configuring PostgreSQL
sudo postgresql-setup initdb
sudo nano /var/lib/postgresql/data/postgresql.conf
Uncomment and changelisten_address = '*'
sudo /etc/init.d/postgresql-server start
sudo update-rc.d -f postgresql-server remove
sudo update-rc.d postgresql-server start 64 2 3 4 5 . stop 36 1 6 .
- Add rule to groov Manage firewall:
Title: PostgreSQL
Protocol: tcp
Ports: 5432
eth0, tun0: enabled
eth1, wlan0: disabled sudo nano /var/lib/postgresql/data/pg_hba.conf
Add the following two lines at the end to allow all users to access via password from any host:
host all all 0.0.0.0/0 md5
host all all ::/0 md5
Create a user and a database
sudo su - postgres -c psql
create user [testuser] with encrypted password '[testpassword]';
create database [testdb] owner [testuser];
\q
sudo /etc/init.d/postgresql-server restart
You can now test remote connectivity to the database server.