Note that using PostgreSQL 9.2.x for CAST AIP is now considered "deprecated support".
Summary: CAST does not provide a CAST Storage Server (CSS) installer for Linux environments, however, it is possible to install the equivalent PostgreSQL version on a Linux server if you need to - please follow the instructions below.
Note that these instructions are for deploying PostgreSQL 9.2.x - equivalent to CSS2.
Download and install a release of PostgreSQL from http://www.enterprisedb.com/products-services-training/pgdownload
Once installed, please run the following command to configure the data storage location. The -D option indicates the location where the data will be stored:
[postgres@cssx postgresql-9.2.13]$ /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
Edit the pg_hba.conf file at /usr/local/pgsql/data using the vi command:
[postgres@cssx data]$ vi pg_hba.conf
Please replace the sample 192.168.x.x IP address below with the appropriate allows client IP addresses:
# TYPE DATABASE USER CIDR-ADDRESS METHOD local all all trust # IPv4 local connections: host all all 127.0.0.1/32 trust host all all 192.168.21.57/24 md5 # IPv6 local connections: host all all ::1/128 md5
Note that adding the following line will ensure ANY client can connect:
host all all 0.0.0.0/0 md5
[postgres@cssx postgresql-9.2.13]$ /usr/local/pgsql/bin/postmaster -D /usr/local/pgsql/data -i
|All CAST AIP products will expect the CAST AIP schemas to be members of the postgres database - i.e. all connections to a PostgreSQL instance will connect direct to the postgres database. This database is created by default during the installation of the PostgreSQL instance and should be retained. While you can create an alternative custom database, it is not possible to connect to a custom database using any CAST AIP products.|
When using the PostgreSQL installer from EnterpriseDB, the default 'postgres' database will be created with parameters that may cause issues when using the server to host CAST AIP schemas. As such, CAST highly recommends that you create another default database and remove the one created by the installer. You should use the pgAdmin tool to do this:
Now change the Maintenance Database option again, from template1 to postgres
The new database is now up and running with the correct parameters.
To check if the server itself is configured correctly CAST AIP, we need to verify the parameters below found in postgresql.conf (the file is in the postgresql directory\db_data):
|log_line_prefix||'%t [%p]: [%l-1] '||Don't forget the space before final quote mark|
|autovacuum||on (in windows installation, this is the default value)|
|client_encoding||sql_ascii (in windows installation, this is the default value)|
Please refer to the parameters in the attached postgresql.conf file - this is taken directly from the CAST AIP CSS2 setup.
The server needs to be restarted to take account the modification.
[postgres@cssx data]$ psql *create user operator with password 'CastAIP'; *create user guest with password 'WelcomeToAIP';
|Note that in the CAST AIP ≥ 8.3.11, the "guest" user is no longer used, therefore it is no longer necessary to create it.|
Grant the same privileges as the 'postgres' user to the 'operator' user. We can use the pgadmin tool to do so as shown below by right clicking on the 'operator' user. Please use the latest version of pgadmin > v1.16.X:
Using CAST Server Manager, connect to the 'postgres' database and follow the installation instructions in Install CAST schemas. Please make sure you are using the correct port and connection string when connecting to the PostgreSQL Server:
Note: When you execute CAST Server Manager to install the schemas, the Connection profile, including the user name and password, are stored in a CWSIProfileConnection.INI located in the CAST_ALL_USERS_PATH (refer to the CastGlobalSettings.ini file to set this variable). If any user executes CAST Server Manager on a machine where this file has been defined, they will see the list of Server Connection Profiles stored in CWSIProfileConnection.INI. The password of the SQL user (operator) is encrypted in this file. If you don’t want to share the password with all users, you can predefine the list of Server Connection Profiles and set this file as read-only for the users.
This will allow the CAST Management Studio to connect to the postgres database. We can use the pgAdmin tool to change the schema owner to 'operator' for each schema as shown below (right click on each schema):
Change the following parameters in the configuration file (..CAST\CASTStorageService2\db_data\postgresql.conf):
auto_explain.log_min_duration = '0s' # setting this to zero logs all plan auto_explain.log_nested_statements = on # log statements executed inside a function auto_explain.log_verbose = on # it's equivalent to the VERBOSE option of EXPLAIN auto_explain.log_buffers = on # it's equivalent to the BUFFERS option of EXPLAIN auto_explain.log_analyze = on # causes EXPLAIN ANALYZE output; when this parameter is on, per-plan-node timing occurs for all statements executed, whether or not they run long enough to actually get logged. This can have an extremely negative impact on performance. Turning off auto_explain.log_timing ameliorates the performance cost, at the price of obtaining less information. shared_preload_libraries = 'auto_explain' # change requires restart
Set this parameter to off when only actual row counts, and not exact times, are needed:
auto_explain.log_timing = off # this parameter has no effect unlessauto_explain.log_analyze is enabled