Page 2 of 2

Re: Omero.server installation on OSX

PostPosted: Tue Jan 25, 2011 5:39 pm
by afraser
hrm...
Code: Select all
bin/omero config get

prints nothing.

Just in case, I just reinstalled PostgreSQL 8.3
Code: Select all
sudo port uninstall postgresql83-server
sudo port uninstall postgresql83
sudo port install postgresql83-server

dropped the omero database
Code: Select all
afraser$ pgstart
afraser$ sudo su postgres -c psql
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Permission denied
could not identify current directory: Permission denied
could not identify current directory: Permission denied
Welcome to psql 8.3.10, the PostgreSQL interactive terminal.
postgres=# DROP DATABASE omero;
DROP DATABASE
postgres=# ^C

and I'm now trying to recreate the db, but...
Code: Select all
gm1f6-3a4:omero afraser$ sudo -u postgres createdb -O omero omero
Password:
could not identify current directory: Permission denied
gm1f6-3a4:omero afraser$ sudo -u postgres createdb -O omero omero
could not identify current directory: Permission denied
createdb: database creation failed: ERROR:  database "omero" already exists
gm1f6-3a4:omero afraser$

Oddly, it looks like the command worked but the permission error is unnerving. Here are the permissionss on ~/Desktop/omero/ again... this shouldn't be owned by postgres should it? I have to admit, the reason for having these different users is lost on me.
Code: Select all
drwxr-xr-x@  12 afraser  CHARLES\domain users       408 Jan 14 13:50 omero

Re: Omero.server installation on OSX

PostPosted: Tue Jan 25, 2011 6:25 pm
by jmoore
What's pgstart? Is that a script you wrote? Have you tried starting your server with "sudo port load postgresql83-server" ?

~Josh

Re: Omero.server installation on OSX

PostPosted: Tue Jan 25, 2011 6:54 pm
by afraser
Oh, sorry, I thought I already sent this, but I guess I didn't.
pgstart is an alias that the PostgreSQL installation instructions suggest you make:
in my .bash_profile:
Code: Select all
export PATH=/opt/local/lib/postgresql83/bin/:$PATH
alias pgstart="sudo su postgres -c 'pg_ctl -D /Users/afraser/postgres -l /Users/afraser/postgres/logfile start'"
alias pgstop="sudo su postgres -c 'pg_ctl -D /Users/afraser/postgres stop -m fast'"
alias pgstatus="sudo su postgres -c 'pg_ctl status -D /Users/afraser/postgres'"


Previously, I had done the following to start the server:
sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql83-server.plist

Code: Select all
omero afraser$ sudo port load postgresql83-server
Password:
Error: Target org.macports.load returned: org.macports.postgresql83-server: Already loaded
Error: Status 1 encountered during processing.
Before reporting a bug, first run the command again with the -d flag to get complete output.


OK, so it's already loaded... doing it your way works too:
Code: Select all
gm1f6-3a4:omero afraser$ sudo launchctl unload -w /Library/LaunchDaemons/org.macports.postgresql83-server.plist
gm1f6-3a4:omero afraser$ sudo port load postgresql83-server


Looking into those pg_ctl aliases now... I guess I don't understand what postgres -D is actually doing

Re: Omero.server installation on OSX

PostPosted: Tue Jan 25, 2011 7:27 pm
by jmoore
Hey Adam,

pg_ctl -D is starting a PostgreSQL server looking at files in your directory. Since the postgres user doesn't have the rights to see them, you are getting errors. If you want to manage your own directory, then just remove "sudo su postgres -c" from all of those commands, and run PostgreSQL as yourself. That should work. Alternatively, stop your own server, and use the central one via "sudo port load". But only one of the two. Based on which you choose, you will probably need to configure pg_hba.conf and postgreql.conf in either /Users/afraser/postgres or /opt/local/var/db/postgresql83/defaultdb.

Cheers,
~Josh

Re: Omero.server installation on OSX

PostPosted: Wed Jan 26, 2011 3:03 pm
by afraser
Well, I finally got the OMERO database built and the server running yesterday after trashing the /Users/afraser/postgres and apparently running the right commands from the right places.

So there's progress... I was able to create a new session in Python. I was able to look at the schema in Postgres.

Unfortunately trying to replicate what I did proved difficult. After dropping the database, and mucking around a bit more I was able to do everything again, this time running postgresql as myself (rather than postgres).

Maybe if I start over enough times I'll get this down pat. I think today I'll try again on a fresh computer.

Thanks so much for your help in getting this far,
Adam