技术文章 - CS327927

根据 docker-compose-postgres.yml 文件中的文档映射 docker PostgreSQL 卷会导致在 Ubuntu 中创建不健康的容器

已修改: 21-Feb-2024   


注意:本文已使用机器翻译软件翻译,以方便非英语客户阅读。但翻译内容可能包含语法错误或不准确之处。请注意, PTC对本文所含信息的翻译准确性及使用后果不承担任何责任。请在 此处 查看本文的英文原始版本以便参考。有关机器翻译的更多详情,请单击 此处
感谢您告诉我们。我们将尽快审阅此译文。

适用于

  • ThingWorx Platform 8.5 to 9.3
  • Ubuntu

说明

  • 根据docker-compose-postgres.yml文件中的文档映射 docker PostgreSQL 卷会导致创建不健康的容器
  • 在以下docker-compose-postgres.yml上使用 docker-compose 会创建不健康的容器:
version: '2.2'

services:
  postgresql:
    image: thingworx/postgres-db:latest
    ports:
      - "5432"
    healthcheck:
      test: pg_isready -U postgres
      interval: 15s
    environment:
      - "POSTGRES_USER=postgres"
      - "POSTGRES_PASSWORD=<Password>"
      - "POSTGRES_DB=postgres"
      # NOTE: Set TWX_DATABASE_USERNAME, TWX_DATABASE_PASSWORD TWX_DATABASE_SCHEMA for
      # the thingworx database setup that will be created in this database.
      - "TWX_DATABASE_USERNAME=twadmin"
      - "TWX_DATABASE_SCHEMA=twadmin"
      - "TWX_DATABASE_PASSWORD=<Password>"
    volumes:
      - "./thingworx-postgres-storage/ThingworxPostgresqlStorage:/ThingworxPostgresqlStorage"
      - "./thingworx-postgres-storage/postgres-data:/var/lib/postgresql/data"

  platform:
    image: thingworx/platform-postgres:latest
    healthcheck:
      test: curl -f localhost:8080/Thingworx/health
      interval: 15s
    depends_on:
      postgresql:
        condition: service_healthy
    ports:
      - "8081:8080"
      - "8443:8443"
    environment:
      - "ENABLE_CLUSTERED_MODE=false"
      - "INITIAL_HEAP=2"
      - "MAX_HEAP=4"
      - "DATABASE_HOST=postgresql"
      - "DATABASE_PORT=5432"
      - "DATABASE_ADMIN_USERNAME=postgres"
      - "DATABASE_ADMIN_PASSWORD=<Password>"
      - "DATABASE_ADMIN_SCHEMA=postgres"
      # NOTE: Set TWX_DATABASE_USERNAME, TWX_DATABASE_PASSWORD TWX_DATABASE_SCHEMA for
      # the thingworx database setup that will either be created by the docker image,
      # or connected to if it already exists.
      - "TWX_DATABASE_USERNAME=twadmin"
      - "TWX_DATABASE_SCHEMA=twadmin"
      - "TWX_DATABASE_PASSWORD=<Password>"
      # NOTE: The following must be set for the Platform to start. This will be
      # the initial Administrator password.
      - "THINGWORX_INITIAL_ADMIN_PASSWORD=<Password>"
      - "ENABLE_HTTP=true"
      - "ENABLE_HTTPS=false"
    volumes:
      - "./thingworx-postgres-storage/ThingworxPlatform:/ThingworxPlatform"
      - "./thingworx-postgres-storage/ThingworxStorage:/ThingworxStorage"
      - "./thingworx-postgres-storage/ThingworxBackupStorage:/ThingworxBackupStorage"
      - "./thingworx-postgres-storage/tomcat-logs:/opt/apache-tomcat/logs"
  • postgres容器报告错误
database “thingworx” does not exist

这是文章 327927 的 PDF 版本,可能已过期。最新版本 CS327927