![]() Please reach out to your account team for support.įor AWS RDS for Postgres, you have the option to use IAM database authentication to avoid using static database credentials. This method is experimental and may have performance implication. ![]() You may need to specify your actual machine IP address and not localhost or 127.0.0.1 as that refers to the Docker VM itself. NOTE: On Mac/Windows, if trying to connect to a PostgreSQL server on the same host machine, remember that Sourcegraph is running inside a Docker container inside of the Docker virtual machine. Most standard PostgreSQL environment variables may be specified ( PGPORT, etc). NOTE: If your PostgreSQL server does not support SSL, set PGSSLMODE=disable instead of PGSSLMODE=require. Please refer to our Postgres documentation to learn about version requirements. You are then free to remove the now unused pgsql and codeintel-db services and deployments from your cluster. Again, these must not point to the same database or the Sourcegraph instance will refuse to start. Update the PG* and CODEINTEL_PG* environment variables in the sourcegraph-frontend deployment YAML file to point to the external frontend ( pgsql) and code navigation ( codeintel-db) PostgreSQL instances, respectively. ![]() # Description: PostgreSQL database for code navigation data. # Ports exposed to the public internet: none # Ports exposed to other Sourcegraph services: 5432/TCP 9187/TCP # Description: PostgreSQL database for various data. env file, etc.).Ĭomment out / remove the internal pgsql and codeintel-db services in docker-compose.yaml since Sourcegraph is using the external one now. See "Environment variables in Compose" for other ways to pass these environment variables to the relevant services (including from the command line, a. 'CODEINTEL_PGDATABASE=sourcegraph-codeintel' sourcegraph/serverĪdd the following to your docker run command: docker run -e PGHOST= -e PGUSER=sourcegraph -e PGPASSWORD=secret -e PGDATABASE=sourcegraph -e PGSSLMODE=require -e CODEINTEL_PGHOST= -e CODEINTEL_PGUSER=sourcegraph -e CODEINTEL_PGPASSWORD=secret -e CODEINTEL_PGDATABASE=sourcegraph-codeintel -e CODEINTEL_PGSSLMODE=require sourcegraph/server:5.0.5 Docker ComposeĪdd/modify the following environment variables to all of the sourcegraph-frontend-* services, the sourcegraph-frontend-internal service, and the migrator service (for Sourcegraph versions 3.37+) in docker-compose.yaml: sourcegraph-frontend-0: Each database should either be configured to point to distinct hosts (recommended), or configured to point to distinct databases on the same host. NOTE: ⚠️ If you have configured both the frontend (pgsql) and code navigation (codeintel-db) databases with the same values, the Sourcegraph instance will refuse to start. To externalize the code navigation database, use the following prefixed CODEINTEL_PG* variables: To externalize the frontend database, use the following standard PG* variables: The addition of PG* environment variables to your Sourcegraph deployment files will instruct Sourcegraph to target an external PostgreSQL server. If data is lost, Sourcegraph cannot automatically rebuild it from the repositories, which means you'd have to wait until it is re-uploaded from your CI systems. The reason behind this recommendation is that codeintel-db data is uploaded via CI systems. We also recommend having backups for the codeintel-db as a best practice. You'll most likely want to be able to scale their resources independently. The primary reason to not use the same Postgres instance for this data is because code graph data can take up a significant of space (given the amount of indexed repositories is large) and the performance of the database may impact the performance of the general application database. ![]() Deploy a separate PostgreSQL instance.Deploy codeintel-db alongside the other Sourcegraph containers, i.e.If you choose to set up your own PostgreSQL server, please note we strongly recommend each database to be set up in different servers and/or hosts. NOTE: As of version 3.39.0, codeinsights-db no longer relies on the internal TimescaleDB and can be externalized. Please review the PostgreSQL documentation for a complete list of requirements. For example, you may prefer this if you already have existing backup infrastructure around your own PostgreSQL server, wish to use Amazon RDS, etc. You can use your own PostgreSQL v12+ server with Sourcegraph if you wish.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |