Skip to content

Commit

Permalink
DOCS-93 updated install PostGIS instructions (#448)
Browse files Browse the repository at this point in the history
Added RHEL UBI steps

modified:   docs/solutions/postgis-deploy.md
  • Loading branch information
nastena1606 authored Oct 12, 2023
1 parent ac9f157 commit 7ee03ce
Showing 1 changed file with 205 additions and 49 deletions.
254 changes: 205 additions & 49 deletions docs/solutions/postgis-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@

The following document provides guidelines how to install PostGIS and how to run the basic queries.

## Preconditions
## Considerations

1. We assume that you have the basic knowledge of spatial data, GIS (Geographical Information System) and of shapefiles.
2. For uploading the spatial data and querying the database, we use the same [data set](https://s3.amazonaws.com/s3.cleverelephant.ca/postgis-workshop-2020.zip) as is used in [PostGIS tutorial](http://postgis.net/workshops/postgis-intro/).


## Install PostGIS

1. Enable Percona repository
=== "On Debian and Ubuntu"

As other components of Percona Distribution for PostgreSQL, PostGIS is available from Percona repositories. Use the [`percona-release`](https://docs.percona.com/percona-software-repositories/installing.html) repository management tool to enable the repository.
1. Enable Percona repository

```{.bash data-prompt="$"}
$ sudo percona-release setup ppg15
```
As other components of Percona Distribution for PostgreSQL, PostGIS is available from Percona repositories. Use the [`percona-release`](https://docs.percona.com/percona-software-repositories/installing.html) repository management tool to enable the repository.

2. Install PostGIS packages
```{.bash data-prompt="$"}
$ sudo percona-release setup ppg15
```

=== "On Debian and Ubuntu"
2. Install PostGIS packages

```{.bash data-prompt="$"}
$ sudo apt install percona-postgis
```
```{.bash data-prompt="$"}
$ sudo apt install percona-postgis
```

This installs the set of PostGIS extensions. To check what extensions are available, run the following query from the `psql` terminal:
3. The command in the previous step installs the set of PostGIS extensions. To check what extensions are available, run the following query from the `psql` terminal:

```sql
SELECT name, default_version,installed_version
FROM pg_available_extensions WHERE name LIKE 'postgis%' or name LIKE 'address%';
```
```sql
SELECT name, default_version,installed_version
FROM pg_available_extensions WHERE name LIKE 'postgis%' or name LIKE address%';
```

!!! note

Expand All @@ -41,58 +41,214 @@ The following document provides guidelines how to install PostGIS and how to run
$ sudo apt-get install libsfcgal1
```

=== "On RHEL and derivatives"
=== "On RHEL and derivatives"

1. Install `epel` repository
For Red Hat Enterprise Linux 8 and derivatives, replace the operating system version in the following commands accordingly.

```{.bash data-prompt="$"}
$ sudo yum install epel-release
```
=== "RHEL 9"

1. Enable Percona repository

As other components of Percona Distribution for PostgreSQL, PostGIS is available from Percona repositories. Use the [`percona-release`](https://docs.percona.com/percona-software-repositories/installing.html) repository management tool to enable the repository.

```{.bash data-prompt="$"}
$ sudo percona-release setup ppg15
```

2. Install `epel` repository

```{.bash data-prompt="$"}
$ sudo yum install epel-release
```

2. Enable the `llvm-toolset dnf` module
3. Enable the `llvm-toolset dnf` module

```{.bash data-prompt="$"}
$ sudo dnf module enable llvm-toolset
```

3. Enable the codeready builder repository to resolve dependencies conflict. For Red Hat Enterprise Linux 8, replace the operating system version in the following commands accordingly.
4. Enable the codeready builder repository to resolve dependencies conflict.

```{.bash data-prompt="$"}
$ sudo dnf config-manager --set-enabled codeready-builder-for-rhel-9-x86_64-rpms
```

5. Install the extension

```{.bash data-prompt="$"}
$ sudo yum install percona-postgis33 percona-postgis33-client
```

=== "CentOS 9"

1. Enable Percona repository

As other components of Percona Distribution for PostgreSQL, PostGIS is available from Percona repositories. Use the [`percona-release`](https://docs.percona.com/percona-software-repositories/installing.html) repository management tool to enable the repository.

```{.bash data-prompt="$"}
$ sudo percona-release setup ppg15
```
2. Install `epel` repository

```{.bash data-prompt="$"}
$ sudo yum install epel-release
```

3. Enable the `llvm-toolset dnf` module

```{.bash data-prompt="$"}
$ sudo dnf module enable llvm-toolset
```

4. Enable the codeready builder repository to resolve dependencies conflict.

```{.bash data-prompt="$"}
$ sudo dnf config-manager --set-enabled crb
```

5. Install the extension

```{.bash data-prompt="$"}
$ sudo yum install percona-postgis33 percona-postgis33-client
```

=== "Oracle Linux 9"

1. Enable Percona repository

As other components of Percona Distribution for PostgreSQL, PostGIS is available from Percona repositories. Use the [`percona-release`](https://docs.percona.com/percona-software-repositories/installing.html) repository management tool to enable the repository.

```{.bash data-prompt="$"}
$ sudo percona-release setup ppg15
```
2. Install `epel` repository

```{.bash data-prompt="$"}
$ sudo yum install epel-release
```

3. Enable the `llvm-toolset dnf` module

```{.bash data-prompt="$"}
$ sudo dnf module enable llvm-toolset
```

4. Enable the codeready builder repository to resolve dependencies conflict.

```{.bash data-prompt="$"}
$ sudo dnf config-manager --set-enabled ol9_codeready_builder
```

5. Install the extension

=== "RHEL 9"
```{.bash data-prompt="$"}
$ sudo yum install percona-postgis33 percona-postgis33-client
```

```{.bash data-prompt="$"}
$ sudo dnf config-manager --set-enabled codeready-builder-for-rhel-9-x86_64-rpms
```
=== "Rocky Linux 9"

=== "CentOS 9"
1. Enable Percona repository

```{.bash data-prompt="$"}
$ sudo dnf config-manager --set-enabled crb
```
As other components of Percona Distribution for PostgreSQL, PostGIS is available from Percona repositories. Use the [`percona-release`](https://docs.percona.com/percona-software-repositories/installing.html) repository management tool to enable the repository.

=== "Oracle Linux 9"
```{.bash data-prompt="$"}
$ sudo percona-release setup ppg15
```
2. Install `epel` repository

```{.bash data-prompt="$"}
$ sudo dnf config-manager --set-enabled ol9_codeready_builder
```
```{.bash data-prompt="$"}
$ sudo yum install epel-release
```

=== "Rocky Linux 9"
3. Enable the `llvm-toolset dnf` module

```{.bash data-prompt="$"}
$ sudo dnf install dnf-plugins-core
$ sudo dnf config-manager --set-enabled powertools
```
```{.bash data-prompt="$"}
$ sudo dnf module enable llvm-toolset
```

4. Enable the codeready builder repository to resolve dependencies conflict.

```{.bash data-prompt="$"}
$ sudo dnf install dnf-plugins-core
$ sudo dnf config-manager --set-enabled powertools
```
4. Install the extension
```{.bash data-prompt="$"}
$ sudo yum install percona-postgis33 percona-postgis33-client
```
5. Install the extension
```{.bash data-prompt="$"}
$ sudo yum install percona-postgis33 percona-postgis33-client
```

=== "RHEL UBI 9"

1. Configure the Oracle-Linux repository. Create the `/etc/yum.repos.d/oracle-linux-ol9.repo` file to install the required dependencies:

```init title="/etc/yum.repos.d/oracle-linux-ol9.repo"
[ol9_baseos_latest]
name=Oracle Linux 9 BaseOS Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL9/baseos/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol9_appstream]
name=Oracle Linux 9 Application Stream ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL9/appstream/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1

[ol9_codeready_builder]
name=Oracle Linux 9 CodeReady Builder ($basearch) - Unsupported
baseurl=https://yum.oracle.com/repo/OracleLinux/OL9/codeready/builder/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
```

2. Download the right GPG key for the Oracle Yum Repository:

```{.bash data-prompt="$"}
$ wget https://yum.oracle.com/RPM-GPG-KEY-oracle-ol9 -O /etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
```

3. Enable Percona repository

As other components of Percona Distribution for PostgreSQL, PostGIS is available from Percona repositories. Use the [`percona-release`](https://docs.percona.com/percona-software-repositories/installing.html) repository management tool to enable the repository.

```{.bash data-prompt="$"}
$ sudo percona-release setup ppg15
```

This installs the set of PostGIS extensions. To check what extensions are available, run the following query from the `psql` terminal:
4. Install `epel` repository

```{.bash data-prompt="$"}
$ sudo yum install epel-release
```

5. Disable the upstream `postgresql` package:

```{.bash data-prompt="$"}
$ sudo dnf module disable postgresql
```

6. Install the extension
```{.bash data-prompt="$"}
$ sudo yum install percona-postgis33 percona-postgis33-client
```

This installs the set of PostGIS extensions. To check what extensions are available, run the following query from the `psql` terminal:

```sql
SELECT name, default_version,installed_version
FROM pg_available_extensions WHERE name LIKE 'postgis%' or name LIKE 'address%';
```

```sql
SELECT name, default_version,installed_version
FROM pg_available_extensions WHERE name LIKE 'postgis%' or name LIKE 'address%';
```
## Enable PostGIS extension

3. Create a database and a schema for this database to store your data. A schema is a container that logically segments objects (tables, functions, views, and so on) for better management. Run the following commands from the `psql` terminal:

Expand Down

0 comments on commit 7ee03ce

Please sign in to comment.