Summary: CAST does not provide a CAST Storage Server (CSS) installer for Linux environments, however, CAST recommends installing the equivalent PostgreSQL version on a Linux server to take advantage of the superior performance over CSS installed on Windows - please follow the instructions below to do so.
Note that these instructions are for deploying PostgreSQL 10 or above.
Installation via YUM
PostgreSQL can be installed using RPMs (binary) or SRPMs (source) managed by YUM. This is available for the following Linux distributions (CAST recommends using only 64-bit platforms):
- Recommended versions of Linux:
- all Linux distributions based on (or derived from) Red Hat
Configure your YUM repository
Locate and edit your distribution .repo file, located:
- On CentOS: /etc/yum.repos.d/CentOS-Base.repo, [base] and [updates] sections
- On Red Hat: /etc/yum/pluginconf.d/rhnplugin.conf [main] section
To the section(s) identified above, you need to append a line (otherwise dependencies might resolve to the postgresql supplied by the base repository):
Update the RPM package
A PGDG file is available for each distribution. Browse https://yum.postgresql.org/repopackages.php and find your correct RPM. There is only one single repo RPM for all PostgreSQL versions for each platform. Ensure you modify the link to the rpm file in the command below: this command will download the RPM package for the latest release of Red Hat:
First run the following command to view the available releases:
Then run the install, for example to install PostgreSQL 11:
Configure data storage location
The default location for PostgreSQL data storage is set to (where <name> is the release number):
To customize this location, you need to edit the following file (where <name> is the release number):
Initialize the PostgreSQL database server to configure data storage location
Once installed, please run the following command to initialize the server (where <name> is the release number):
Configuring the server/database
Edit the pg_hba.conf file to allow clients/users
Before clients/users connect, you may wish to secure your PostgreSQL instance using the pg_hba.conf file. There are many ways to do this which will entirely depend on your own environment and organization - for example you may wish to allow access only from certain IP addresses/hosts, or specific PostgreSQL users. The pg_hba.conf file is explained in more detail here: https://www.postgresql.org/docs/10/auth-pg-hba-conf.html.
Edit the pg_hba.conf file at /usr/local/pgsql/data using the vi command:
A default set of rules is provided, which will look similar to the following:
This default configuration only allows connections from localhost using IPv4 and IPv6, therefore to allow any client to connect, you could add the following line:
Or to allow a specific subnet:
You can also restrict access to specific databases and logins. For example, to allow only the operator login to access the postgres database from any client, add the following like:
Check server configuration
To check if the server itself is configured correctly for CAST AIP, we need to verify and modify certain parameters in the postgresql.conf (the file is in the postgresql directory \db_data).
The postgresql.conf settings listed below are directly related to available RAM for the PostgreSQL instance - and as such their configuration is specific to the host machine. Please use http://pgtune.leopard.in.ua/ on the host machine to identify the correct settings and then modify postgresql.conf with the settings provided by pgtune. You should update the following settings with the values provided by pgtune:
When running pgtune, choose the following:
- Set the DB version to the installed version
- Set the DB Type to Mixed type of applications
- Set the Number of connections to 300
Some of the values suggested by pgtune are somewhat low. Therefore, please calculate the following postgresql.conf settings as follows:
- shared_buffers - value should be 25% of available RAM with a max of 8 GB
maintenance_work_mem= 512 MB
The following settings should also be modified to the values listed below:
|Instead of localhost by default. Enables connectivity from other machines.
|'%t [%p]: [%l-1] '
|Don't forget the space before final quote mark.
|Ensure that this option is active (it may already be active).
|Higher value than 64 by default.
PostgreSQL database server actions (start/stop/restart etc.)
Where <name> is the release number:
By default PostgreSQL will create a system account user named postgres with the role postgres. The equivalent CAST Storage Service provided by CAST includes two default users as follows:
|Note that in the CAST AIP ≥ 8.3.11, the "guest" user is no longer used.
If you would like to create these users, use the following commands:
CAST AIP ≥ 8.3.12 - custom users
If you are using CAST AIP ≥ 8.3.12, you are also free to create your own users and then use them with CAST AIP and related software - you need to have a minimum of one user with the SUPERUSER permission and then grant the "postgres" role to this user. For example:
When using CAST AIP ≥ 8.3.30, it is possible to create custom users that do NOT require the SUPERUSER permission if you prefer not to grant this. For example, this script creates a role "my_role" with the password "my_password" that can login. The role has not been granted the SUPERUSER permission and instead only the minimum permissions required to operate CAST AIP are granted:
The "postgres" database is created by default in PostgreSQL. CAST products will, by default, expect to create/connect to schemas in this database. However, it is also possible to configure CAST products to connect to a custom database other than "postgres". See Using a custom CAST Storage Service or PostgreSQL database other than the default postgres.
How to log all statement's plan
Change the following parameters in the configuration file (..\db_data\postgresql.conf):
Set this parameter to off when only actual row counts, and not exact times, are needed: