我正在尝试使用 (1.2.0.Latest) Aerogear 统一推送服务器 (UPS) 的最新发行版的 dockerized 版本,但使用 Postgres 而不是 MySql。事实上,官方的 UPS Docker 发行版就是基于它。用 Postgres 连接器替换基础Docker文件中的连接器非常容易:
ENV POSTGRES_JDBC_VERSION 42.1.4
ENV db_module_dir=$JBOSS_HOME/modules/org/postgresql/main/
RUN mkdir -p ${db_module_dir}
RUN wget -O postgres-jdbc.jar http://central.maven.org/maven2/org/postgresql/postgresql/$POSTGRES_JDBC_VERSION/postgresql-$POSTGRES_JDBC_VERSION.jar
RUN mv postgres-jdbc.jar ${db_module_dir}
COPY configuration/xml/postgres-module.xml ${db_module_dir}/module.xml
我在旧版本中做了这个变化,一切都很好。
现在,从头开始(通过 Docker Compose)(没有预先存在的数据库)我从构建/迁移数据库模式/数据的 Liquibase 作业(jar)中得到以下错误:
Unexpected error running Liquibase: org.postgresql.util.PSQLException: ERROR: relation "PRIMARY" already exists
这是完整的日志:
myproject_ups_db | The files belonging to this database system will be owned by user "postgres".
myproject_ups_db | This user must also own the server process.
myproject_ups_db |
myproject_ups_db | The database cluster will be initialized with locale "en_US.utf8".
myproject_ups_db | The default database encoding has accordingly been set to "UTF8".
myproject_ups_db | The default text search configuration will be set to "english".
myproject_ups_db |
myproject_ups_db | Data page checksums are disabled.
myproject_ups_db |
myproject_ups_db | fixing permissions on existing directory /var/lib/postgresql/data ... ok
myproject_ups_db | creating subdirectories ... ok
myproject_ups_db | selecting default max_connections ... 100
myproject_ups_db | selecting default shared_buffers ... 128MB
myproject_ups_db | selecting dynamic shared memory implementation ... posix
myproject_ups_db | creating configuration files ... ok
myproject_ups_db | creating template1 database in /var/lib/postgresql/data/base/1 ... ok
myproject_ups_db | initializing pg_authid ... ok
myproject_ups_db | initializing dependencies ... ok
myproject_ups_db | creating system views ... ok
myproject_ups_db | loading system objects' descriptions ... ok
myproject_ups_db | creating collations ... ok
myproject_ups_db | creating conversions ... ok
myproject_ups_db | creating dictionaries ... ok
myproject_ups_db | setting privileges on built-in objects ... ok
myproject_ups_db | creating information schema ... ok
myproject_ups_db | loading PL/pgSQL server-side language ... ok
myproject_ups_db | vacuuming database template1 ... ok
myproject_ups_db | copying template1 to template0 ... ok
myproject_ups_db | copying template1 to postgres ... ok
myproject_ups_db | syncing data to disk ... ok
myproject_ups_db |
myproject_ups_db | Success. You can now start the database server using:
myproject_ups_db |
myproject_ups_db | postgres -D /var/lib/postgresql/data
myproject_ups_db | or
myproject_ups_db | pg_ctl -D /var/lib/postgresql/data -l logfile start
myproject_ups_db |
myproject_ups_db |
myproject_ups_db | WARNING: enabling "trust" authentication for local connections
myproject_ups_db | You can change this by editing pg_hba.conf or using the option -A, or
myproject_ups_db | --auth-local and --auth-host, the next time you run initdb.
myproject_ups_db | waiting for server to start....LOG: database system was shut down at 2017-09-23 16:00:34 UTC
myproject_ups_db | LOG: MultiXact member wraparound protections are now enabled
myproject_ups_db | LOG: database system is ready to accept connections
myproject_ups_db | LOG: autovacuum launcher started
myproject_ups_db | done
myproject_ups_db | server started
myproject_ups_db | CREATE DATABASE
myproject_ups_db |
myproject_ups_db | CREATE ROLE
myproject_ups_db |
myproject_ups_db |
myproject_ups_db | /docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/
myproject_ups_db |
myproject_ups_db | LOG: received fast shutdown request
myproject_ups_db | LOG: aborting any active transactions
myproject_ups_db | LOG: autovacuum launcher shutting down
myproject_ups_db | LOG: shutting down
myproject_ups_db | waiting for server to shut down....LOG: database system is shut down
myproject_ups_db | done
myproject_ups_db | server stopped
myproject_ups_db |
myproject_ups_db | PostgreSQL init process complete; ready for start up.
myproject_ups_db |
myproject_ups_db | LOG: database system was shut down at 2017-09-23 16:00:36 UTC
myproject_ups_db | LOG: MultiXact member wraparound protections are now enabled
myproject_ups_db | LOG: database system is ready to accept connections
myproject_ups_db | LOG: autovacuum launcher started
myproject_ups | Starting Liquibase migration
myproject_ups | Unexpected error running Liquibase: org.postgresql.util.PSQLException: ERROR: relation "PRIMARY" already exists
myproject_ups |
myproject_ups |
myproject_ups exited with code 255
有什么建议吗?