8/12/2023 0 Comments Timescaledb postgresql 13![]() 5113 for Timescale with PG 13, 5112 for Timescale with PG 12 and so on. I like port 5112 because this makes it easy to distinguish different Postgres versions. timescale/timescaledb:latest-pg12 describes the Docker image we want to use.-d makes the container run in detached mode (in the background).-e POSTGRES_PASSWORD=postgres sets the connection password for the postgres user to postgres.-v $HOME/docker/volumes/timescale-pg-12:/var/lib/postgresql/data mounts the data directory we created earlier into the correct place inside the Timescale Docker container.-name timescale-pg-12 gives the container its name.-rm makes Docker delete this container when it is stopped.docker run is the command to start a container (and download it if it isn't cached locally).Next, we'll create and start a Docker container with Postgres 13: docker run -rm -name timescale-pg-12 -p 127.0.0.1:5112:5432 -v $ HOME/docker/volumes/timescale-pg-12:/var/lib/postgresql/data -e POSTGRES_PASSWORD=postgres -d timescale/timescaledb:latest-pg12 We'll start by creating a folder for our persistent Docker volume: mkdir -p $ HOME/docker/volumes/timescale-pg-12 Now we can install Timescale with PostgreSQL 12. Then, update Brew and install libpq: brew update brew install libpqĪs a last step, symlink psql and the other libpq tools to your local binaries ( /usr/local/bin): brew link -force libpq Installing Timescale If you haven't already, install the Brew package manager. You may need to restart your shell for the docker cli command to work. Follow the instructions on to install the official Docker for Mac.Īlso, start the Docker application and go through their Getting Started guide to make sure everything works. Installing Dockerįirst, we need to install Docker on macOS. TL DR: # create folder for docker volume mkdir -p $ HOME/docker/volumes/timescale-pg-12 # create and start timescale postgres 12 docker container docker run -rm -name timescale-pg-12 -p 127.0.0.1:5112:5432 -v $ HOME/docker/volumes/timescale-pg-12:/var/lib/postgresql/data -e POSTGRES_PASSWORD=postgres -d timescale/timescaledb:latest-pg12 # connect psql -h localhost -p 5112 -U postgres # stop docker stop timescale-pg-12 Prerequisitesīefore we get to TimescaleDB, we need two things installed before we start. In this article, we'll set up Timescale with Postgres 12 on macOS Big Sur with Docker. There's an easier way to set up PostgreSQL with Timescale on Mac and to manage multiple versions: by using Docker. If you need multiple local Timescale versions or you already have installed Postgres before, you're out of luck. Simply install Timescale via Homebrew and you're all set up.Įxcept you're not.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |