Postgresql使用docker-compose成功部署但未在docker stack deploy

时间:2018-05-30 10:40:52

标签: postgresql docker docker-compose docker-swarm kong

这是我的docker-compose.yml文件,其首先部署 postgresql 而不是服务迁移,并将部署其他服务。

  

使用docker-compose,它已成功部署并准备好了   当尝试使用docker stack部署它时,它会陷入困境   某些部分并重新启动。我已经提供了下面的日志。从   那部分它再次重新启动而没有进入准备状态。

postgresql服务的docker服务日志

stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-3-111.eu    | The files belonging to this database system will be owned by user "postgres".
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-3-111.eu    | The files belonging to this database system will be owned by user "postgres".
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-3-111.eu    | The files belonging to this database system will be owned by user "postgres".
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-3-111.eu    | The files belonging to this database system will be owned by user "postgres".
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-3-111.eu    | This user must also own the server process.
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-3-111.eu    | This user must also own the server process.
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-3-111.eu    | This user must also own the server process.
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | This user must also own the server process.
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | The database cluster will be initialized with locale "en_US.utf8".
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | The database cluster will be initialized with locale "en_US.utf8".
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | The database cluster will be initialized with locale "en_US.utf8".
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | The database cluster will be initialized with locale "en_US.utf8".
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | The default database encoding has accordingly been set to "UTF8".
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | The default database encoding has accordingly been set to "UTF8".
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | The default database encoding has accordingly been set to "UTF8".
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | The default database encoding has accordingly been set to "UTF8".
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | The default text search configuration will be set to "english".
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | The default text search configuration will be set to "english".
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | The default text search configuration will be set to "english".
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | The default text search configuration will be set to "english".
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | Data page checksums are disabled.
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | Data page checksums are disabled.
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | Data page checksums are disabled.
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | Data page checksums are disabled.
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | 
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | fixing permissions on existing directory /var/lib/postgresql/data ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | fixing permissions on existing directory /var/lib/postgresql/data ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | fixing permissions on existing directory /var/lib/postgresql/data ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | fixing permissions on existing directory /var/lib/postgresql/data ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | creating subdirectories ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | creating subdirectories ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | creating subdirectories ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | creating subdirectories ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | selecting default max_connections ... 100
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | selecting default max_connections ... 100
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | selecting default max_connections ... 100
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | selecting default max_connections ... 100
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | selecting default shared_buffers ... 128MB
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | selecting default shared_buffers ... 128MB
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | selecting default shared_buffers ... 128MB
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | selecting default shared_buffers ... 128MB
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | selecting dynamic shared memory implementation ... posix
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | selecting dynamic shared memory implementation ... posix
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | selecting dynamic shared memory implementation ... posix
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | selecting dynamic shared memory implementation ... posix
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | creating configuration files ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | creating configuration files ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | creating configuration files ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | creating configuration files ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | initializing pg_authid ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | initializing pg_authid ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | initializing pg_authid ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | initializing pg_authid ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | initializing dependencies ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | initializing dependencies ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | initializing dependencies ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | initializing dependencies ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | creating system views ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | creating system views ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | creating system views ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | creating system views ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | loading system objects' descriptions ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | loading system objects' descriptions ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | loading system objects' descriptions ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | loading system objects' descriptions ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | creating collations ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | creating collations ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | creating collations ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | creating collations ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | creating conversions ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | creating conversions ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | creating conversions ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | creating conversions ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | creating dictionaries ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | creating dictionaries ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | creating dictionaries ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | creating dictionaries ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | setting privileges on built-in objects ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | setting privileges on built-in objects ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | setting privileges on built-in objects ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | setting privileges on built-in objects ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | creating information schema ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | creating information schema ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | creating information schema ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | creating information schema ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | loading PL/pgSQL server-side language ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | loading PL/pgSQL server-side language ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | loading PL/pgSQL server-side language ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | loading PL/pgSQL server-side language ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | vacuuming database template1 ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | vacuuming database template1 ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | vacuuming database template1 ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | vacuuming database template1 ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | copying template1 to template0 ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | copying template1 to template0 ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | copying template1 to template0 ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | copying template1 to template0 ... ok
    stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | copying template1 to postgres ... ok
    stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | copying template1 to postgres ... ok
    stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | copying template1 to postgres ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | copying template1 to postgres ... ok
    stackapi_kong-database.1.poy4nxov7ua1@ip131.ip-X-36-111.eu    | syncing data to disk ... stackapi_kong-database.1.ldulsrc2q7yc@ip131.ip-X-36-111.eu    | syncing data to disk ... stackapi_kong-database.1.yk6kjyhcfawr@ip131.ip-X-36-111.eu    | syncing data to disk ... stackapi_kong-database.1.zjyhav9h27s6@ip131.ip-X-36-111.eu    | syncing data to disk ...
  

这是我用来制作docker的docker-compose文件   堆栈兼容。我已将服务添加到同一网络并制作   它们现在在同一个管理器节点下运行。以前是在   版本3。我也把它改成了3.4版本

docker-compose.yml文件

港数据库:         图片:“postgres:9.5”         重启:总是         网络:              - api-net         环境:             POSTGRES_USER:kong             POSTGRES_DB:kong         健康检查:             测试:[“CMD”,“pg_isready”,“ - U”,“postgres”]             间隔:5s             超时:5秒             重试:5

    deploy:
        mode: replicated
        replicas: 1
        placement:
            constraints:
                - node.role == manager

kong-migration:
    image: "kong:latest"
    networks:
        - api-net
    command: "kong migrations up"
    environment:
        KONG_PG_HOST: kong-database
    depends_on:
        - kong-database
    deploy:
        mode: replicated
        replicas: 1
        placement:
            constraints:
                  - node.role == manager

kong:
#build: ./dockerfiles/kong
    image: "ncarlier:latest"
    networks:
        - api-net
    environment:
        KONG_PG_HOST: kong-database
        KONG_PROXY_LISTEN: 0.0.0.0:8000
        KONG_PROXY_LISTEN_SSL: 0.0.0.0:8443
        KONG_ADMIN_LISTEN: 0.0.0.0:8001
        KONG_CUSTOM_PLUGINS: oidc
    depends_on:
        - kong-database
    healthcheck:
        test: ["CMD", "curl", "-f", "http://kong:8001"]
        interval: 5s
        timeout: 2s
        retries: 15
    ports:
        - "8001:8001"
        - "8000:8000"
    deploy:
        mode: replicated
        replicas: 1
        placement:
            constraints:
                - node.role == manager
konga:
    image: "pantsel/konga:latest"
    restart: always
    networks:
        - api-net
    environment:
        NODE_ENV: production
    depends_on:
        - kong
    ports:
        - "1337:1337"

0 个答案:

没有答案