1 Answer
- Newest
- Most votes
- Most comments
0
To install TimescaleDB on an EC2 instance running Amazon Linux 2023 with PostgreSQL 15, you'll need to follow these steps:
- First, ensure your system is up to date:
sudo dnf update -y
- If you haven't already installed PostgreSQL 15, you can do so with:
sudo dnf install -y postgresql15 postgresql15-server
- Initialize the PostgreSQL database:
sudo postgresql-setup --initdb
- Start and enable the PostgreSQL service:
sudo systemctl start postgresql
sudo systemctl enable postgresql
- To install TimescaleDB, you'll need to add the TimescaleDB repository. Create a new repository file:
sudo tee /etc/yum.repos.d/timescale_timescaledb.repo << EOL
[timescale_timescaledb]
name=timescale_timescaledb
baseurl=https://packagecloud.io/timescale/timescaledb/el/8/\$basearch
repo_gpgcheck=1
gpgcheck=0
enabled=1
gpgkey=https://packagecloud.io/timescale/timescaledb/gpgkey
sslverify=1
sslcacert=/etc/pki/tls/certs/ca-bundle.crt
metadata_expire=300
EOL
- Install TimescaleDB:
sudo dnf install -y timescaledb-postgresql-15
- After installation, you need to modify the PostgreSQL configuration to load TimescaleDB. Edit the postgresql.conf file:
sudo nano /var/lib/pgsql/data/postgresql.conf
Add the following line at the end of the file:
shared_preload_libraries = 'timescaledb'
- Restart PostgreSQL to apply the changes:
sudo systemctl restart postgresql
- Finally, connect to your PostgreSQL database and create the TimescaleDB extension:
sudo -u postgres psql
CREATE EXTENSION IF NOT EXISTS timescaledb;
After following these steps, TimescaleDB should be successfully installed and ready to use with your PostgreSQL 15 database on your EC2 instance running Amazon Linux 2023.
Sources
Connecting to a DB instance running the PostgreSQL database engine - Amazon Relational Database Service
Creating and connecting to a PostgreSQL DB instance - Amazon Relational Database Service
answered 9 months ago
Relevant content
- asked 2 years ago
- asked a year ago
- asked 2 years ago