我正在努力MAX_CONNECTIONS
在我的 circleCI 配置文件中配置 postgres 配置。正如您在下面看到sed
的,我尝试使用来替换 max_connections 值,但这没有做任何事情, max_connections 保持在 default 100
。我还尝试运行自定义命令(请参阅command: |
下面的注释块),但这引发了以下错误并停止了 circleCI 进程:/docker-entrypoint.sh: line 100: exec: docker: not found Exited with code 127
version: 2
jobs:
test:
pre:
- sudo sed -i 's/max_connections = 100/max_connections = 300/g' /etc/postgresql/9.6/main/postgresql.conf # Allow more than 100 connections to DB
- sudo service postgresql restart
docker:
# Specify the version you desire here
- image: circleci/node:8.11
# Setup postgres and configure the db
- image: hegand/postgres-postgis
# command: |
# docker run --name hegand/postgres-postgis -e POSTGRES_PORT=$POSTGRES_PORT POSTGRES_PASSWORD=$POSTGRES_PASSWORD POSTGRES_DB=$POSTGRES_DB -d postgres -N 300
environment:
POSTGRES_USER: user
POSTGRES_DB: table
POSTGRES_PASSWORD: ""
POSTGRES_PORT: 5432