健康的最重要容器中的这个错误代表什么?

时间:2019-03-29 13:42:56

标签: docker ansible

我已尝试按照以下说明使用ansible设置以下图像:
https://hub.docker.com/r/mattermost/mattermost-prod-db
那是我的文件:

- name: setup mattermost volumes or directories
  file:
    path: [
           /srv/mattermost,
           /srv/mattermost/postgresql, 
           /srv/mattermost/postgresql/data,
           /srv/mattermost/app, 
           /srv/mattermost/app/config, 
           /srv/mattermost/app/data, 
           /srv/mattermost/app/logs, 
           /srv/mattermost/app/plugins
          ]
    state: directory
    owner: root
    group: root
    mode: 0755

- name: run mattermost postgresql image
  docker_container:
    name: mattermost-postgresql
    image: postgres:9.4-alpine
    restart_policy: always # always restart the container if it stops automatically
    volumes:
      - /srv/mattermost/postgresql/data:/var/lib/postgresql/data
    state: started # make sure container runs
    restart: no # do not restart if already running
    env:
      POSTGRES_USER="{{ vault_mattermost_postgresql_user_name }}"
      POSTGRES_PASSWORD="{{ vault_mattermost_postgresql_user_password }}"
      POSTGRES_DB="{{ vault_mattermost_postgresql_db_name }}"

- name: run mattermost app image
  docker_container:
    name: mattermost-app
    image: mattermost/mattermost-prod-db:latest
    # image: mattermost/mattermost-team-edition:daily-build
    restart_policy: always # always restart the container if it stops automatically
    ports:
      - "5080:80"
    links:
      - mattermost-postgresql:mattermost-postgresql-alias
    volumes:
      - /srv/mattermost/app/config:/mattermost/config:rw
      - /srv/mattermost/app/data:/mattermost/data:rw
      - /srv/mattermost/app/logs:/mattermost/logs:rw
      - /srv/mattermost/app/plugins:/mattermost/plugins:rw
      - /etc/localtime:/etc/localtime:ro
    state: started # make sure container runs
    restart: no # do not restart if already running
    env:
      MM_USERNAME: "{{ vault_mattermost_postgresql_user_name }}"
      MM_PASSWORD: "{{ vault_mattermost_postgresql_user_password }}"
      MM_DBNAME: "{{ vault_mattermost_postgresql_db_name }}"
      # database doesn't use custom host and port (runs on same server)
      DB_HOST: "mattermost-postgresql-alias"
      DB_PORT_NUMBER: "5432"

考虑到我在最后设置了反向代理的参数时遗漏了不相关的部分(这对您很重要,因为使用反向代理使我免于设置docker映像的Web服务容器)并公开了一些私人信息

当我在后台运行ansible-playbook时,容器正常启动,但是最重要的服务本身无法正常工作。当我运行命令docker logs mattermost-app(mattermost-app是容器的定义名称)时,出现以下错误日志:

AWS_ACCESS_KEY_ID is required for Wal-E but not set. Skipping Wal-E setup.
AWS_SECRET_ACCESS_KEY is required for Wal-E but not set. Skipping Wal-E setup.
WALE_S3_PREFIX is required for Wal-E but not set. Skipping Wal-E setup.
AWS_REGION is required for Wal-E but not set. Skipping Wal-E setup.
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
creating template1 database in /var/lib/postgresql/data/base/1 ... ok
initializing pg_authid ... ok
setting password ... ok
initializing dependencies ... ok
creating system views ... ok
loading system objects' descriptions ... ok
sh: locale: not found
creating collations ... ok
No usable system locales were found.
Use the option "--debug" to see details.
creating conversions ... ok
creating dictionaries ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
loading PL/pgSQL server-side language ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok
copying template1 to postgres ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
****************************************************
WARNING: No password has been set for the database.
         This will allow anyone with access to the
         Postgres port to access your database. In
         Docker's default configuration, this is
         effectively any other container on the same
         system.

         Use "-e POSTGRES_PASSWORD=password" to set
syncing data to disk ... ok
         it in "docker run".
****************************************************

Success. You can now start the database server using:

    postgres -D /var/lib/postgresql/data
or
    pg_ctl -D /var/lib/postgresql/data -l logfile start

waiting for server to start....LOG:  database system was shut down at 2019-03-29 14:23:10 CET
LOG:  MultiXact member wraparound protections are now enabled
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections
 done
server started

/docker-entrypoint.sh: running /docker-entrypoint-initdb.d/setup-wale.sh

waiting for server to shut down....LOG:  received fast shutdown request
LOG:  aborting any active transactions
LOG:  autovacuum launcher shutting down
LOG:  shutting down
LOG:  database system is shut down
 done
server stopped

PostgreSQL init process complete; ready for start up.

LOG:  database system was shut down at 2019-03-29 14:23:11 CET
LOG:  MultiXact member wraparound protections are now enabled
LOG:  autovacuum launcher started
LOG:  database system is ready to accept connections
FATAL:  role "-d" does not exist
FATAL:  role "-d" does not exist
FATAL:  role "-d" does not exist
FATAL:  role "-d" does not exist
FATAL:  role "-d" does not exist
FATAL:  role "-d" does not exist
FATAL:  role "-d" does not exist
FATAL:  role "-d" does not exist
FATAL:  role "-d" does not exist
FATAL:  role "-d" does not exist
FATAL:  role "-d" does not exist

在这里,我不知道该怎么办。 FATAL: role "-d" does not exist在这里是什么意思?

0 个答案:

没有答案