Installation Hints
The following installation instructions for Linux are thought as installation hint / example and do not come with any guarantee by Ergon/Airlock. Free support for the H2 database is not included in the Airlock SSU.
It has been tested with H2 version "h2-2017-06-10".
- Make sure a Java runtime compatible with H2 is installed on the system (we use /usr/bin/java in the following example).
- Download a stable version of H2 from http://www.h2database.com/html/download.html
- Create an OS user and directory for h2:
- Unzip the downloaded h2 zip file in the h2 users's home:
- Create a data directory:
- To start the database "iamdb" in foreground, use the following example:
# start database server with web console in foreground java -cp h2/bin/h2-1.4.196.jar org.h2.tools.Server -tcp -tcpPort 9001 -web -webPort 9000 -baseDir ~/data
- If it did not yet exist, it will create an empty database.
- Connect to it using the browser (e.g. http://localhost:9000/) - use the following values (example):
- Use the option "-webAllowOthers" to allow remote connections to the web console
- Please refer to http://www.h2database.com/html/tutorial.html for more options and further information
- After opening the web console, add the IAM database schema by executing SQL files from here: (Schema and initial admin). Skip this step, if you opened an existing database, of course.
- After this step, the database should be ready for usage. In the IAM database configuration, use the same settings (JDBC URL, username, password and driver) as when connecting with the web console above.
If a new database is created, the username and password entered above are used as database user and password for future connections.
Alternative to using the H2 Web Console
Instead of using the web console (H2 web application) you may use the following H2 command:
# Print usage of H2 RunScript $ java -cp h2/bin/h2*.jar org.h2.tools.RunScript -h # Install schema SQL example java -cp h2/bin/h2*.jar org.h2.tools.RunScript \ -url jdbc:h2:tcp://localhost:9001/iamdb \ -user iam -password password \ -script create-medusa-schema.sql \ -showResults # Add initial admin java -cp h2/bin/h2*.jar org.h2.tools.RunScript \ -url jdbc:h2:tcp://localhost:9001/iamdb \ -user iam -password password \ -script insert-admin.sql \ -showResults
- To install the H2 database as a Linux service (using systemd), the following examples for database "iamdb" may be used:
- Create a systemd service file
/home/h2database/iamdb.service
with the following contents: - Install the service and start it (you must be "root" to do that):
- We recommend to reboot the system to make sure that the database is started after reboot.
The above service definition assumes that you intend to use "/usr/bin/java" as Java runtime. If specifying a different Java runtime, make sure to provide an absolute path.