If you open the “servoy_server.bat” with a text editor, you will see that all you need to do to start PostgreSQL with the Servoy server from the command line is to uncomment this line:
postgres_db\bin\pg_ctl start -D database -l postgres_db\postgres_log.txt
Alternatively you can install PostgreSQL (you can download an installer from EnterpriseDB for example - http://www.enterprisedb.com/ - you will need to register) and you will be able to install it as a service.
ptalbot:
Alternatively you can install PostgreSQL (you can download an installer from EnterpriseDB for example - http://www.enterprisedb.com/ - you will need to register) and you will be able to install it as a service.
Do note that they offer 3 flavors of PostgreSQL installers. PostgreSQL, Postgres Plus and Postgres Plus Advanced.
It’s the PostgreSQL (8.4) installer you want to download.
I am trying out postgres 8.4 on a new win7 os machine with a new install of Servoy 5.2.1
I can start the developer ok with the built in postgres supplied.
I amended the server.bat to start postgres in the application_server folder and that works ok.
I want to start postgres supplied with Servoy as a service as well as starting Servoy as a service. That is where it is failing. I did check and change the window firewall to allow port 5432 (default postgres) but it is not starting the postgres as a service.
I examined the wiki and this forum and the postgres community forum but not exactly getting the specific answer to my problem.
Do I use pgctrl register ? What parameters should I use?
Nothing in the log.
I should backtrack a little to clarify the issue.
I have installed Servoy5 as a brand new install (as an admin user on Win 7).
I am able to use pg_ctl to start and stop the database that Servoy has under the application_server folder.
Now I want to make this machine a server and want to have postgresql start as a windows service as well as Servoy.
Servoy will not start as a service since there is no Postgres database service running.
If I is use the pg_ctl -register command as follows:
pg_ctl -register -N PostgresServoy -U <my login name> -P <my login password> -D <the database folder under the application_server folder of Servoy>)
Then I get an error message “could not open service manager”
I do not know if I should be using another username/password.
So the question is this: what should the syntax be for starting the postgres server as a service using the pg_ctl register command (assuming this is the correct approach)?
So I hacked around and around and around and finally did the correct things in the correct sequence.
For others this is what worked for me: (perhaps this could be put into the wiki for WIN7 users?)
The correct command to use is:
pg_ctl register -N <name of the service> -U <user> -P <password> -D <database location>
For me the key was the win7 issue of “could not open service manager” which is a M$ way of saying “access denied” or similar.
What I had done was to open a cmd window and typed in the above command.
What I SHOULD have done is to open the cmd window RUN AS ADMINISTRATOR even though I was logged in as myself as an administrator.
Once I had the cmd open properly then the pg_ctl register will work … almost.
What I had to do was to specify a little better the database and the log file as follows:
in the cmd window navigate to the directory where the bin directory is for postgres_db (note that I installed Servoy in to D:\Servoy5):
7.in the control panel services change the start up to automatic. Test by rebooting and examining the service to see that it actually started. Check the log file too.
8. I also changed the Servoy Application Server service to start up automatically - delayed. I assume the Postgres might take some time - not sure if this is needed though.
Other notes: relative paths might work - I did not try.
Please amend this with better instructions for win7 users wanting to set up using the Servoy provided postgres as a server.
(Again I think this should go into the wiki once improvements are made!)
thanks for the walkthrough, I’m sure it will be useful and you are right that something should be put in the wiki!
I have one small suggestion: for you step 8, instead of adding a delay to start the Servoy service, why not add postgres as a dependency?
In the wrapper.conf file of /Servoy/application_server/service/ you could add:
# Service dependencies. Add dependencies as needed starting from 1
wrapper.ntservice.dependency.1=PostgresForServoy
# Mode in which the service is installed. AUTO_START or DEMAND_START
wrapper.ntservice.starttype=AUTO_START
Where PostgresForServoy is the name you used to register the postgres service, I believe?
Then uninstall the “Servoy Application Server” service
Paul, could you have a look at that?
It’s true that running the server as a service/daemon is the kind of information that should be readily available: running from the command line on a server is not really an option on Windows.
ptalbot:
If you open the “servoy_server.bat” with a text editor, you will see that all you need to do to start PostgreSQL with the Servoy server from the command line is to uncomment this line:
postgres_db\bin\pg_ctl start -D database -l postgres_db\postgres_log.txt
I did exactly as Patrick indicated but it did not work! While the Windows Command shows up (trying to start the server) it says:
The system cannot execute the specified program.
Debug class loaded with class org.apache.commons.logging.LogFactory
Debug log initialized
The problem it’s that now I have the situation where I HAVE to install PostgreSQL with Servoy. I can’t do a separate installation of PostgreSQL in this machine.
I followed the wiki instructions of installing the Servoy Application Server (http://wiki.servoy.com/display/public/DOCS/Running+the+All-In-One+Installer). I am trying this installation of Servoy Server with its bundled PostgreSQL db in a Windows XP machine. I will install in the same way in a Windows 2003 Server (once I figured this out.)
These are the error lines in servoy_log.txt:
2010-09-22 01:51:36,675 ERROR [main] com.servoy.j2db.util.Debug - Cannot start repository: com.servoy.j2db.persistence.RepositoryException: Error checking repository
2010-09-22 01:51:36,675 ERROR [main] com.servoy.j2db.util.Debug - Do note Servoy server does not start any database!
One thing that I am curious about: the database directory inside application_server is empty after installation. I don’t know if this has something to do with the problem. Any ideas?
jcarlos:
One thing that I am curious about: the database directory inside application_server is empty after installation. I don’t know if this has something to do with the problem. Any ideas?
jcarlos:
One thing that I am curious about: the database directory inside application_server is empty after installation. I don’t know if this has something to do with the problem. Any ideas?
Agree, but all I did was a regular Servoy Server installation using servoy_installer.exe. I am trying the installation again. (This time I’ll try servoy_installer.jar)
Thanks a lot for the link. Very informative, I hope that’s not the problem. The initdb should have run with the installation.
I tried the installation again. The database directory is still empty.
I also tried to create a new database cluster. I used: initdb [option…] --pgdata | -D directory (with no options)
C:\Program Files\Servoy\application_server\postgres_db\bin>initdb --pgdata | -D "C:\Program Files\Servoy\application_server\database"
The system cannot execute the specified program.
This probably needs some options. No sure about that.
The database cluster should have been created. Can be there something wrong with Servoy 5.2.1 installation in Windows XP?
–pgdata is for using the environment variable PGDATA instead of the -D argument (so use one or the other).
But normally the program would simply yell at you with a proper error msg. Your error msg sounds more like the program can’t be run at all.
What version of XP is this ?
Just installed Servoy 5.2.1 using the .jar installer on XP Prof. and the database cluster gets nicely created.
Do you use the .exe or the .jar installer ?
Ok, this is good news. I used the .exe installer first. Then after removing everything I used the .jar installer.
As for the version of XP, I believe it is Pro. I am responding to this post from my iPhone (trying to go to sleep). I will check version and installation in another machine tomorrow. Thank you very much!
ROCLASI:
Just installed Servoy 5.2.1 using the .jar installer on XP Prof. and the database cluster gets nicely created.
Do you use the .exe or the .jar installer ?
The version of Windows is XP Professional, Service Pack 3. I run the Windows Update and it says “No high-priority updates for your computer are available.” This computer checks for update everyday at 3 AM.
We now know that my installation is failing because the database cluster is not being created as expected -after installation the database directory is empty.