Page 1 of 6

OMERO.server creation questions

PostPosted: Tue Nov 29, 2016 11:48 pm
by shaneklumpp
Hello All,

I'm new to Ubuntu and OMERO but am working on creating an OMERO.server instillation on ubuntu 14.04 with ICE3.5

I'm following this guide: https://www.openmicroscopy.org/site/sup ... rough.html

and have some questions regarding the procedure.

When I create the directory "$OMERO_DATA_DIR" is this supposed to be in my home directory? I'm not sure where to put this...

on the Create a database user and initialize a new database for OMERO section when I run:
echo "CREATE USER $OMERO_DB_USER PASSWORD '$OMERO_DB_PASS'" | \
su - postgres -c psql


I got an error that said "su must be run in a terminal"
To correct this issue I tried running the command one line at a time as root (so seperating the commands and inputing them one by one without the "\" symbol)

The first line went thorugh... but now the new error has changed to:

ERROR: syntax error at or near "'OMERO_DB_PASS'"
LINE 1: CREATE USER PASSWORD 'OMERO_DB_PASS'
^ symbol is below the single quote mark


I'm not sure what I messed up or how to correct this situation... thanks for any help received!

Shane

Re: OMERO.server creation questions

PostPosted: Tue Nov 29, 2016 11:49 pm
by shaneklumpp
Okay I ran everything one line at a time in this

echo "CREATE USER $OMERO_DB_USER PASSWORD '$OMERO_DB_PASS'" | \
su - postgres -c psql
su - postgres -c "createdb -E UTF8 -O '$OMERO_DB_USER' '$OMERO_DB_NAME'"

psql -P pager=off -h localhost -U "$OMERO_DB_USER" -l


and everything worked!

but I am not really sure what I did... I know that I created a DB user with a password but can someone explain the Postgres psql code to me? I am very new to this and am trying to understand the process.

Everything works and worked when I ran it.

Re: OMERO.server creation questions

PostPosted: Wed Nov 30, 2016 7:19 am
by jmoore
Hi Shane,

here in brief:

echo "CREATE USER ...'" | su - postgres -c psql


As postgres who is the admin for a PostgreSQL installation, run the command "create user" etc.

su - postgres -c "createdb -E UTF8 -O '$OMERO_DB_USER' '$OMERO_DB_NAME'"


Again as postgres, create a new database and make the 'O'wner OMERO_DB_USER so that it can later initialize the DB without needing to be the postgres user. (The encoding is UTF8 to deal with unicode symbols)

psql -P pager=off -h localhost -U "$OMERO_DB_USER" -l



List the current databases.

Cheers,
~Josh.

Re: OMERO.server creation questions

PostPosted: Wed Nov 30, 2016 4:05 pm
by shaneklumpp
Thanks for the clarification!

Shane

Re: OMERO.server creation questions

PostPosted: Wed Nov 30, 2016 6:56 pm
by shaneklumpp
I have another question. I am currently installing the OMERO server, when I run the command

psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql


it asks for a password for my omero system user (I believe), although I haven't set one. When I push enter (for no password) I get the error:

psql: FATAL: passworth authentication failed for a user "omero"
FATAL: password authentication failed for a user "omero"


I had not set a password at that point and still got that error. When I went and set a password for my omero system user "omero" and tried again I got an error even when I know that i typed in my password perfectly...

I am not sure what is wrong. Any help?

Re: OMERO.server creation questions

PostPosted: Wed Nov 30, 2016 7:16 pm
by rleigh
You will need to look at pg_hba.conf to configure PostgreSQL authentication. For example, https://www.postgresql.org/docs/9.6/sta ... -conf.html.

However, you will find it easier going to follow the instructions and set a password as recommended. The instructions don't cover non-standard stuff, and not using a password isn't covered. It's obviously insecure, and the instructions cover setting up a secure production system.

You can set a password using ALTER ROLE: https://www.postgresql.org/docs/9.6/sta ... rrole.html


Regards,
Roger

Re: OMERO.server creation questions

PostPosted: Wed Nov 30, 2016 7:22 pm
by jmoore
How did you try to reset your password? I'd try:

Code: Select all
su - postgres -c "ALTER USER omero WITH PASSWORD 'somethingyoudonttellus';


Then until you get:

Code: Select all
psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME"


working (with no other arguments) you won't be able to make any progress.(Note: you can exit that shell by using \q)

Cheers,
~Josh

Re: OMERO.server creation questions

PostPosted: Wed Nov 30, 2016 11:11 pm
by shaneklumpp
Alright I got my password to work and no longer get the fatal password error message...

now when I enter my password I get a

psql: FATAL: database "omero" does not exist


should I be using Createdb within PostgreSQL with a database named omero to fix this?

Re: OMERO.server creation questions

PostPosted: Wed Nov 30, 2016 11:21 pm
by jmoore
My guess is that something is going wrong with a combination of the quotation marks and the copying-n-pasting of the commands. I'd go back to this step:

Code: Select all
su - postgres -c "createdb -E UTF8 -O '$OMERO_DB_USER' '$OMERO_DB_NAME'"


and replace the variables with the values you want, likely something akin to:

Code: Select all
su - postgres -c "createdb -E UTF8 -O omero omero"


Cheers,
~Josh

Re: OMERO.server creation questions

PostPosted: Wed Nov 30, 2016 11:45 pm
by shaneklumpp
Okay awesome that worked thank you so much!

... or at least I think it did.

I get connected after I type in my password and get:

psql (9.4.10)

So I believe that means I'm connceted...

then I get an SSL connection message which looks all good.

Thank you so much for your help throughout all of this.

Shane