perfsonar / perfsonar-testpoint-docker

Apache License 2.0
12 stars 15 forks source link

postgres config for pScheduler #1

Closed bltierney closed 7 years ago

bltierney commented 7 years ago

Still need to add commands to initialize postgress for pscheduler use

bltierney commented 7 years ago

If you look at the docker build output, you'll see lots of errors on the pscheduler stuff.

Looks like this sort of stuff will need to be scripted and added to the DockerFile:

see: pscheduler-server.spec; the 'build', 'install', 'pre', and 'post' section all have commands that will need to be executed, I think.

bltierney commented 7 years ago

see if running "pscheduler internal db-update" will do this.

bltierney commented 7 years ago

The above command does not work, and gives this error:

 Unable to determine PostgreSQL user.

I assume this script assumes default locations for files, but all files will need to be in something other than /var

Full log of install errors is available here: https://hub.docker.com/r/bltierney/perfsonar4.0-testpoint-docker/builds/bwvswmmk8c4dlw5ebhf59qb/

mfeit-internet2 commented 7 years ago

That error happens when postgresql-load attempts to determine what user is running PostgreSQL by looking for the server in the process table. Pg needs to be running for the database to be set up.

During the build of the container, try this:

RUN /usr/pgsql-9.5/bin/pg_ctl start
RUN pscheduler internal db-update
RUN /usr/pgsql-9.5/bin/pg_ctl stop
bltierney commented 7 years ago

Now it gives this error:

cannot be run as root Please log in (using, e.g., "su") as the (unprivileged) user that will own the server process.  I think a script that wraps the init stuff together will be needed.

mfeit-internet2 commented 7 years ago

Probably all you need to do here is run it as postgres.

bltierney commented 7 years ago

Step 8/14 : RUN su postgres -c "/usr/pgsql-9.5/bin/pg_ctl start"

---> Running in d64567def4ff

pg_ctl: no database directory specified and environment variable PGDATA unset Try "pg_ctl --help" for more information.

bltierney commented 7 years ago

probably need to do something like this: https://github.com/zokeber/docker-postgresql/blob/master/Dockerfile

But I'm not sure what all 'pscheduler internal db-update' is doing for us.

bltierney commented 7 years ago

I updated the Dockerfile, but now I'm getting this error:

RUN pscheduler internal db-update Unable to determine PostgreSQL user.

mfeit-internet2 commented 7 years ago

But I'm not sure what all 'pscheduler internal db-update' is doing for us.

That's what builds or updates the database. The script that does it is structured so you can run it as many times as you want and you'll always wind up with the current version of the database whether you're starting from nothing, have an existing-but-older version or are fully current.

Maybe we should just get together and work on this.

bltierney commented 7 years ago

seems to be working now, but more testing needed before closing.