all-in-one installer

Hi!

Forgive me for my ignorance, can you give me an idea how to create an all-in-one installer? Basically it will be a file(setup.exe) that will install the application server, create the application database(sybase), run db scripts to create tables etc, create the repository_server(postgresql), run the servoy server, import the solution.

Thanks!

rogel:
Hi!

Forgive me for my ignorance, can you give me an idea how to create an all-in-one installer? Basically it will be a file(setup.exe) that will install the application server, create the application database(sybase), run db scripts to create tables etc, create the repository_server(postgresql), run the servoy server, import the solution.

Thanks!

You can create an installer (with some external tool), that will just copy an installed Servoy. You just have to include different files for database taking into account the OS. Maybe should use sybase for repository also so that you don’t have to copy two database engines.

lvostinar:
You can create an installer (with some external tool), that will just copy an installed Servoy. You just have to include different files for database taking into account the OS. Maybe should use sybase for repository also so that you don’t have to copy two database engines.

Cool. Thanks! Do you mean the application server folder? Our application uses it2be components as well. Will I still need to run the it2be-manager?

rogel:

lvostinar:
You can create an installer (with some external tool), that will just copy an installed Servoy. You just have to include different files for database taking into account the OS. Maybe should use sybase for repository also so that you don’t have to copy two database engines.

Cool. Thanks! Do you mean the application server folder? Our application uses it2be components as well. Will I still need to run the it2be-manager?

Yes, an application server installation. Not sure about it2be components but I think it should work to just copy the whole installation.

lvostinar:
Yes, an application server installation. Not sure about it2be components but I think it should work to just copy the whole installation.

Thank you. I will try it out.

lvostinar:
Yes, an application server installation. Not sure about it2be components but I think it should work to just copy the whole installation.

I installed a new servoy 6 application server only. copied the postgres_db and database folder from the developer installation.

nativeShutdownLauncher=C\:\\local_installation\\servoy6\\application_server\\postgres_db\\bin\\pg_ctl|stop|-D|database|-l|postgres_db\\postgres_log.txt
nativeStartupLauncher=C\:\\local_installation\\servoy6\\application_server\\postgres_db\\bin\\pg_ctl|start|-D|database|-l|postgres_db\\postgres_log.txt
#start database engine
waitForNativeStartup=true

I tried to run the application server using the postgresql servoy_repository but getting this error in the servoy logs

2011-09-01 11:41:48,554 ERROR [main] com.servoy.j2db.util.Debug - Cannot start repository: 
com.servoy.j2db.persistence.RepositoryException: Error checking repository
	at com.servoy.j2db.server.Za.Za.Zb(Za.java:1992)
	at com.servoy.j2db.server.Za.Za.<init>(Za.java:50)
	at com.servoy.j2db.server.Za.Za.<init>(Za.java:134)
	at com.servoy.j2db.server.Za.Zo.Za(Zo.java:1413)
	at com.servoy.j2db.server.main.ApplicationServer.main(ApplicationServer.java:144)
Caused by: org.postgresql.util.PSQLException: Connection refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:136)
	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:66)
	at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:125)
	at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
	at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
	at org.postgresql.Driver.makeConnection(Driver.java:393)
	at org.postgresql.Driver.connect(Driver.java:267)
	at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)
	at com.servoy.j2db.Za.Zo.createConnection(Zo.java:3)
	at com.servoy.j2db.Za.Zd.createConnection(Zd.java:5)
	at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582)
	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1158)
	at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106)
	at com.servoy.j2db.Za.Za.getConnection(Za.java:68)
	at com.servoy.j2db.server.Za.Zo.getRawConnection(Zo.java:642)
	at com.servoy.j2db.server.Za.Zo.Zf(Zo.java:1532)
	at com.servoy.j2db.server.Za.Za.Zb(Za.java:41)
	... 4 more
Caused by: java.net.ConnectException: Connection refused: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
	at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
	at java.net.Socket.connect(Socket.java:525)
	at java.net.Socket.connect(Socket.java:475)
	at java.net.Socket.<init>(Socket.java:372)
	at java.net.Socket.<init>(Socket.java:186)
	at org.postgresql.core.PGStream.<init>(PGStream.java:62)
	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:76)
	... 20 more
2011-09-01 11:41:48,570 ERROR [main] com.servoy.j2db.util.Debug - Do note Servoy server does not start any database!

However, it worked well when I tried to run this command ```
postgres_db\bin\pg_ctl start -D database -l postgres_db\postgres_log.txt


Please advice.

Thanks!

Hi,

Only Developer will start/stop your local PostgreSQL instance for you. Server will never start or stop any database instance so you need to launch it your self.
Also for Server deployments it’s recommended to use the EnterpriseDB (EDB) installer instead of the bundled version. The EDB version just takes care of a lot of things for you (makes it a daemon, etc) and is secure ‘out of the box’ (unlike Servoy’s bundled version wich is totally accessible in the filesystem).
Of course copying over the postgres_db directory won’t work then, you will need to dump (backup) the database and restore it in the EDB instance. PgAdmin is the perfect tool for this.

Hope this helps.

ROCLASI:
Hi,

Only Developer will start/stop your local PostgreSQL instance for you. Server will never start or stop any database instance so you need to launch it your self.
Also for Server deployments it’s recommended to use the EnterpriseDB (EDB) installer instead of the bundled version. The EDB version just takes care of a lot of things for you (makes it a daemon, etc) and is secure ‘out of the box’ (unlike Servoy’s bundled version wich is totally accessible in the filesystem).
Of course copying over the postgres_db directory won’t work then, you will need to dump (backup) the database and restore it in the EDB instance. PgAdmin is the perfect tool for this.

Hope this helps.

Thanks! What do you mean by daemon? This is my first time to use PostgreSQL and I am not yet familiar how to do it. Basically, the requirement is to minimize manual configuration and installation of additional softwares. The clients will be hosting their own server and they are not that computer savvy. If the application will only be used by 1 or 2 people will the bundled version serve its purpose?

Your thoughts please.

Regards.

Hi,

A daemon is a process running as a service instead of as a user program. So it launches at boot time.
The EDB installer is essentially a one-click installer (well you need to go through some screens) and takes care of everything for you including setting PostgreSQL up as a service (and launches it for you as well)
Also when there are any PostgreSQL updates you simply run the new EDB installer and your PostgreSQL instance will be updated in seconds. Very easy.
Servoy right now doesn’t have an easy update procedure for new PostgreSQL updates for the bundled PostgreSQL instance.

As for the difference between the bundled PostgreSQL and the EDB version. It’s just configured differently. The EDB version is just setup more securely with the data directory (including the logs and config files) only being accessible by a specific system user (Postgres) that doesn’t have a password. The PostgreSQL process will also only run under this system user. All this to make your data (and the server in general) as secure as possible.
Especially in (internet facing) server environments you want this level of security.

Hope this explains things for you.

ROCLASI:
Hi,

A daemon is a process running as a service instead of as a user program. So it launches at boot time.
The EDB installer is essentially a one-click installer (well you need to go through some screens) and takes care of everything for you including setting PostgreSQL up as a service (and launches it for you as well)
Also when there are any PostgreSQL updates you simply run the new EDB installer and your PostgreSQL instance will be updated in seconds. Very easy.
Servoy right now doesn’t have an easy update procedure for new PostgreSQL updates for the bundled PostgreSQL instance.

As for the difference between the bundled PostgreSQL and the EDB version. It’s just configured differently. The EDB version is just setup more securely with the data directory (including the logs and config files) only being accessible by a specific system user (Postgres) that doesn’t have a password. The PostgreSQL process will also only run under this system user. All this to make your data (and the server in general) as secure as possible.
Especially in (internet facing) server environments you want this level of security.

Hope this explains things for you.

Is EDB for free?

Hi Rogel,

Yes the PostgreSQL installer is free.
EDB does have 2 other products of which one is commercial (PostgreSQL Plus Advanced).

Just select any platform from the PostgreSQL 9.0 column.
http://www.enterprisedb.com/downloads/p … -downloads

Hope this helps.

ROCLASI:
Hi Rogel,

Yes the PostgreSQL installer is free.
EDB does have 2 other products of which one is commercial (PostgreSQL Plus Advanced).

Just select any platform from the PostgreSQL 9.0 column.
http://www.enterprisedb.com/downloads/p … -downloads

Hope this helps.

If you install the application server with the bundled sample databases does the postgresql database server and data reside in the application_server folder as well?

Hi Rogel,

The EDB installer will have it’s binaries and data directory in a seperate place. So completely outside the Servoy directory.

ROCLASI:
Hi Rogel,

The EDB installer will have it’s binaries and data directory in a seperate place. So completely outside the Servoy directory.

If I were not to use EDB. And I copy the application_server folder, containing postgres_db and database folder, in one machine, does the database server and databases be installed and created respectively when I start servoy_server.bat? I have this line to start the postgres in servoy_server.bat

postgres_db\bin\pg_ctl start -D database -l postgres_db\postgres_log.txt

Hi Rogel,

If you copy from a 32-bit to a 32-bit OS or a 64-bit to a 64-bit OS then I see no issue with that.
If you copy from 32-bit to 64-bit OS (or vice versa) then you are required to dump the database (using pg_dumpall or PgAdmin) and load it into the other install.

ROCLASI:
Hi Rogel,

If you copy from a 32-bit to a 32-bit OS or a 64-bit to a 64-bit OS then I see no issue with that.
If you copy from 32-bit to 64-bit OS (or vice versa) then you are required to dump the database (using pg_dumpall or PgAdmin) and load it into the other install.

is there a way to automate the edb installer?

rogel:
is there a way to automate the edb installer?

EDB uses the installer from Bitrock. I suggest you check their website: http://bitrock.com/

ROCLASI:

rogel:
is there a way to automate the edb installer?

EDB uses the installer from Bitrock. I suggest you check their website: http://bitrock.com/

saw this command:

postgresql-9.0.4-1-windows_x64.exe --mode unattended

thanks!

next agenda is to create script to the databases. put it together in my application installer.

ROCLASI:
Hi Rogel,

If you copy from a 32-bit to a 32-bit OS or a 64-bit to a 64-bit OS then I see no issue with that.
If you copy from 32-bit to 64-bit OS (or vice versa) then you are required to dump the database (using pg_dumpall or PgAdmin) and load it into the other install.

Thanks Robert!

I was trying to Run PostgreSQL as a Service

postgres_db\bin\pg_ctl register -N PostgreSQL -D database

But was unsuccessful…

pg_ctl: could not open service manager