Soluzione # - CS327927

La mappatura dei volumi Docker PostgreSQL secondo la documentazione nel file docker-compose-postgres.yml provoca la creazione di un contenitore non funzionante in Ubuntu

Modifica: 03-Apr-2025   


Nota: Questo articolo è stato tradotto per la sua comodità utilizzando un software di traduzione automatica. PTC non garantisce l'affidabilità o la leggibilità dei contenuti di questa traduzione. Clicca qui per vedere la versione originale di questo articolo in inglese. Per ulteriori informazioni sulla traduzione automatica, clicca qui.
Grazie per averci informato. Esamineremo questa traduzione il prima possibile.

Si applica a

  • ThingWorx Platform 8.5 to 9.3
  • Ubuntu

Descrizione

  • La mappatura dei volumi Docker PostgreSQL secondo la documentazione nel file docker-compose-postgres.yml provoca la creazione di un contenitore non funzionante
  • Utilizzando docker-compose sul seguente docker-compose-postgres.yml viene creato un contenitore non funzionante:
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"
  • il contenitore postgres segnala un errore
database “thingworx” does not exist

This is a PDF version of Article 327927 and may be out of date. For the latest version CS327927