postgresql database in truenas scale

Feydreva

Cadet
Joined
Jan 20, 2022
Messages
3
Hello,

I used to have, with freenas, an iocage with postgresql and my DBs, so other computeurs / programs in the house, could connect to databases.

How do I do that in truenas scale ?
how can I install postgresql container and set it up ?

anybody could help me ?
thank you
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
head over to TrueCharts... truecharts.org

Follow their instructions for getting it set up on SCALE and then deploy their postgresql app.
 

Feydreva

Cadet
Joined
Jan 20, 2022
Messages
3
Hello,
I have TrueCharts installed.
I didn't see it at 1st. You need to at the dependency train to have it.
when you configure it, you configure it for 1 user, 1 db.
what if you want multiple DB ? you run multiple container ? is that not ressource wasting ?

thank you for your help
 

TheEugeneKam

Cadet
Joined
Mar 6, 2022
Messages
5
How did you even install this on the scale, I looked on truecharts and its showing PostgreSQL as "Still to be added to TrueCharts"
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Postrgresql is in the dependency train, so maybe you need to add that train to your TrueCharts catalog.

I think you're mis-reading their site if you think it's not available.

 

TheEugeneKam

Cadet
Joined
Mar 6, 2022
Messages
5
Ah okay, I have stable and core, i guess i needed to add the dependency for it to work. Thank you for the help!
 

TheEugeneKam

Cadet
Joined
Mar 6, 2022
Messages
5
Got it installed, version 14 seems to work with the latest resolve instance. For anyone having an issue will just leave the steps, I made to create it.
1. Installed pgadmin and postresql
2. Setup username password and database name in Postgres, leaving everything else default
3. Linked Postgres to pg admin using trends IP and username and password from the previous step. Said password incorrect a few times but then worked, not sure why.
4. Went to resolve and went to create a new database with the name, user and password set up in step 2. Got an error that database already exists, at this point could create a database with a new name. Instead, I went to pg admin, right-click and drop the database with the name I created in step 2, hit create a new database in resolve. and all went smoothly. Didn't need to mount any shared partition to create any edits like you have to do with QNAP. Seems like everything works so far.

I think that looks about right, not sure if I missed any steps here, but feel free to add it, doesn't seem like there is a plethora of information on this of how to set this up on scale so hopefully, this will help others migrating to scale.
 

clueluzz

Dabbler
Joined
May 17, 2019
Messages
24
Got it installed, version 14 seems to work with the latest resolve instance. For anyone having an issue will just leave the steps, I made to create it.
1. Installed pgadmin and postresql
Hi,

I managed to install pgadmin but postresql is not in the catalog. Is it supposed to be in TrueCharts or am I missing a step?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
The dependency train?
 

clueluzz

Dabbler
Joined
May 17, 2019
Messages
24

cirsten

Cadet
Joined
May 3, 2022
Messages
8
HI

I've tried to install the app but the following error:
Back-off restarting failed container

The log has:
2022-05-21T09:15:26.776431994Z [38;5;6mpostgresql [38;5;5m17:15:26.77 [0m
2022-05-21T09:15:26.777618326Z [38;5;6mpostgresql [38;5;5m17:15:26.77 [0m[1mWelcome to the Bitnami postgresql container[0m
2022-05-21T09:15:26.778892021Z [38;5;6mpostgresql [38;5;5m17:15:26.77 [0mSubscribe to project updates by watching [1mhttps://github.com/bitnami/bitnami-docker-postgresql[0m
2022-05-21T09:15:26.780439988Z [38;5;6mpostgresql [38;5;5m17:15:26.78 [0mSubmit issues and feature requests at [1mhttps://github.com/bitnami/bitnami-docker-postgresql/issues[0m
2022-05-21T09:15:26.781675104Z [38;5;6mpostgresql [38;5;5m17:15:26.78 [0m
2022-05-21T09:15:26.796302176Z [38;5;6mpostgresql [38;5;5m17:15:26.79 [0m[38;5;2mINFO [0m ==> ** Starting PostgreSQL setup **
2022-05-21T09:15:26.828304409Z [38;5;6mpostgresql [38;5;5m17:15:26.82 [0m[38;5;2mINFO [0m ==> Validating settings in POSTGRESQL_* env vars..
2022-05-21T09:15:26.834451382Z [38;5;6mpostgresql [38;5;5m17:15:26.83 [0m[38;5;2mINFO [0m ==> Loading custom pre-init scripts...
2022-05-21T09:15:26.840189138Z [38;5;6mpostgresql [38;5;5m17:15:26.83 [0m[38;5;2mINFO [0m ==> Initializing PostgreSQL database...
2022-05-21T09:15:26.856276296Z [38;5;6mpostgresql [38;5;5m17:15:26.85 [0m[38;5;2mINFO [0m ==> pg_hba.conf file not detected. Generating it...
2022-05-21T09:15:26.857864775Z [38;5;6mpostgresql [38;5;5m17:15:26.85 [0m[38;5;2mINFO [0m ==> Generating local authentication configuration
2022-05-21T09:15:26.858589192Z /opt/bitnami/scripts/libpostgresql.sh: line 222: /opt/bitnami/postgresql/conf/pg_hba.conf: Permission denied
2022-05-21T09:15:26.865956306Z /opt/bitnami/scripts/libfile.sh: line 39: /opt/bitnami/postgresql/conf/postgresql.conf: Permission denied

I have a similar issue if I try to install MariaDB with TrueCharts

ANy help would be apppreciated
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Permission denied
Maybe due to a read-only filesystem or lack of correct permissions in your persistent storage config.

TrueCharts has a Discord support system, so maybe best to connect with them on that if it's problems with a plain install.
 

cirsten

Cadet
Joined
May 3, 2022
Messages
8
I have, re TrueCharts. And they can't seem to replicate my problem. My permissions seem to be fine, they've gone through it.

In the end I deleted and recreates the ix-applications folder as the permissions were set odd. But now seem normal, as per what the guys at truechart have and none but me have the issue (ie it's not repeatable).

I'll check again for permission on the chart but pretty sure read only is not selected

I'll post the new logs for next set-up in case someone can see the issue
 

PackElend

Explorer
Joined
Sep 23, 2020
Messages
60
Hey there,
The database configuration is a Blackbox to me.
I cannot find anything in the documentation.
Can you please let me know where to find details about it?
Based on https://youtu.be/TQlmYxPnSrU I can only guess that PostgresSQL is the default database and you have to change the helm chart file manually, if you want to use a different database.
 

MeuhSly

Dabbler
Joined
Jun 19, 2020
Messages
21
Did any one get a good documentation of how to install Postgresql and its adminer on scale ?
Looked in truecharts but it doesn't offer that much information about the installation an the requirement of postgres. I discover on Docker website that postgresql need some environment variables that are not indicate in truecharts page.

I tryed top follow this but with no success.
 

dloister

Cadet
Joined
Nov 28, 2023
Messages
1
The way I got this working one Scale (23.10.0.1) is by installing a docker image (Custom App) via Apps > Discover Apps > Custom App. Fill in:
  • Application name, choose one e.g. postgres
  • Version: I could choose only one value from the drop-down, so I picked that one
  • Image Repository: postgres
  • Image Tag: I left this blank
  • Image Pull Policy: Only pull image if not present on system
  • Container Environment Variables, POSTGRES_PASSWORD is the only one that is required. Choose this as the name and a password as the value.
  • Under Networking, you can either add a host interface so the container gets it's own IP or leave it blank to use the hosts IP
  • If you use the host IP, then you should add port forwarding to the container, I've entered 5432 (the Postgres default TCP port) as the container port and 9543 as the Node port.
  • Clik install and the Postgresql app will be created. I've had to start it manually but then I was able to connect from a Postgresql client to the hosts IP on port 9543 using postgres as user and the password set as the Environment Var value.
Also off course think about the storage of the DB and other things, but the instructions above may help you to at least get a working Postgresql container on Scale.
 
Top