Ric*_*lev 3 postgresql docker kong
这是我尝试过的
docker run --rm \
> --link kong-database:kong-database \
> -e "KONG_DATABASE=postgres" \
> -e "KONG_PG_HOST=kong-database" \
> kong:latest kong migrations up
Run Code Online (Sandbox Code Playgroud)
但我有
Error: cannot run migrations: database needs bootstrapping; run 'kong migrations bootstrap'
Run Code Online (Sandbox Code Playgroud)
我不明白这实际上意味着什么。如果我尝试
docker run --rm --link kong-database:kong-database -e "KONG_DATABASE=postgres" -e "KONG_PG_HOST=kong-database" kong:latest kong migrations bootstrap
bootstrapping database...
Error: [PostgreSQL error] failed to bootstrap database: ERROR: syntax error at or near "NOT" (150)
Run Code Online (Sandbox Code Playgroud)
我检查了kong-database
{
"Id": "d94ac442da9a399c1b865de49904e01085abe1ed8f0871af5830810c4c2a78dd",
"Created": "2019-04-19T07:18:59.534751317Z",
"Path": "docker-entrypoint.sh",
"Args": [
"postgres"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 18342,
"ExitCode": 0,
"Error": "",
"StartedAt": "2019-04-19T07:19:00.129193458Z",
"FinishedAt": "0001-01-01T00:00:00Z"
Run Code Online (Sandbox Code Playgroud)
为什么我需要引导数据库,为什么我有问题?
您必须在运行 kong 之前引导数据库。up 命令已弃用并替换为 bootstrap
改变
kong:latest kong migrations up
到
kong:latest kong migrations bootstrap
| 归档时间: |
|
| 查看次数: |
3460 次 |
| 最近记录: |