cloudfoundry / postgres-release

BOSH release for PostgreSQL
Apache License 2.0
14 stars 36 forks source link

bbr-postgres-db not being installed #43

Closed cgreaney closed 6 years ago

cgreaney commented 6 years ago

Hello, I'm trying to use bbr-postgres-db, but it does not seem to be installed during deployment. I colocated it with in the postgresql deployment, but I get the error: - Can't find link with type 'database' for job 'joe-db' in deployment 'joe'. If I move it with in the same job as postgres, I don't get an error - but it doesn't exist.

- name: ((deployment_name))-db
  instances: 1
  url: http://((db_ip)):5432
  azs: [z1]
  networks:
  - default:
    - dns
    - gateway
    name: default
  - name: public
    static_ips: ((db_ip))
  stemcell: trusty
  vm_type: ((db_vm_type))
  persistent_disk_type: ((db_persistent_disk_type))
  jobs:
  - release: postgres
    name: postgres
    type: database
    properties:
      databases:
        port: 5432
        databases:
        - name: ((postgres_database))
        roles:
        - *db_role
        - name: postgres
          password: ((postgres_password))
          permissions:
          - SUPERUSER
          - CREATEDB
          - CREATEROLE
          - REPLICATION
        tls:
          certificate: ((atc_tls.certificate))
          private_key: ((atc_tls.private_key))
        name: bbr-postgres-db
        type: database
        properties:
          databases:
          - name: ((postgres_database))
          release_level_backup:
            default: true
#   name: bbr-postgres-db
#   type: database
#   properties:
#     databases:
#       - name: ((postgres_database))
#     release_level_backup:
#       default: true
  - *syslog-forwarder
  - *telegraf
cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/159885415

The labels on this github issue will be updated when the story is started.

valeriap commented 6 years ago

@cgreaney May you please improve the formatting of the description?

With a manifest like the following:

instance_groups:
- name: postgres
  jobs
  - name: postgres
    provides:
      postgres:
        as: postgres-database
    ... 
  - name: bbr-postgres-db
    release: postgres
    consumes:
      database:
        from: postgres-database
    properties:
      release_level_backup: true

What you obtain is that the job bbr-postgres-db is created on the vm:

postgres/21fe9cc8-80c2-4ed1-b011-51c89a52db49:/var/vcap/jobs# ls -l
total 8
lrwxrwxrwx 1 root root 76 Aug 20 10:21 bbr-postgres-db -> /var/vcap/data/jobs/bbr-postgres-db/cedde76be6af07bb4231ecb5ec7ea225aa1bc02f
lrwxrwxrwx 1 root root 69 Aug 20 10:21 postgres -> /var/vcap/data/jobs/postgres/d46c97dee7035c252691100de2fa4d970705cc47

Of course the job does not need to be monitored by monit:

postgres/21fe9cc8-80c2-4ed1-b011-51c89a52db49:/var/vcap/jobs# monit summary
The Monit daemon 5.2.5 uptime: 5m

Process 'postgres'                  running
Process 'pg_janitor'                running
System 'system_localhost'           running

Hope it helps to clarify the configuration.

cgreaney commented 6 years ago

Hello Valeria,

This manifest settings worked, I think the main differences from what I tried was in the postgres job section provides, and then in the bbr-postgres-db section the consumes.

I’m triggering this with the janitor hook, would you suggest a different manor (I had thought of using cron )

Thanks for the help,

Chris Greaney

From: Valeria Perticarà [mailto:notifications@github.com] Sent: Monday 20 August 2018 12:56 To: cloudfoundry/postgres-release Cc: cgreaney; Mention Subject: Re: [cloudfoundry/postgres-release] bbr-postgres-db not being installed (#43)

@cgreaney https://github.com/cgreaney May you please improve the formatting of the description?

With a manifest like the following:

instance_groups:

What you obtain is that the job bbr-postgres-db is created on the vm:

postgres/21fe9cc8-80c2-4ed1-b011-51c89a52db49:/var/vcap/jobs# ls -l total 8 lrwxrwxrwx 1 root root 76 Aug 20 10:21 bbr-postgres-db -> /var/vcap/data/jobs/bbr-postgres-db/cedde76be6af07bb4231ecb5ec7ea225aa1bc02f lrwxrwxrwx 1 root root 69 Aug 20 10:21 postgres -> /var/vcap/data/jobs/postgres/d46c97dee7035c252691100de2fa4d970705cc47

Of course the job does not need to be monitored by monit:

postgres/21fe9cc8-80c2-4ed1-b011-51c89a52db49:/var/vcap/jobs# monit summary The Monit daemon 5.2.5 uptime: 5m

Process 'postgres' running Process 'pg_janitor' running System 'system_localhost' running

Hope it helps to clarify the configuration.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cloudfoundry/postgres-release/issues/43#issuecomment-414290738 , or mute the thread https://github.com/notifications/unsubscribe-auth/AHKAFEdZ3FyL6xVPp-Eg-tsd2dIWiCmaks5uSqPHgaJpZM4WDr61 . https://github.com/notifications/beacon/AHKAFCFE3-456gua3G-l9Tlr4dKxLjEJks5uSqPHgaJpZM4WDr61.gif

valeriap commented 6 years ago

@cgreaney The job was introduced to integrate with Bosh backup and restore so my suggestion is to go through it.

valeriap commented 6 years ago

I'm closing since the issue looks addressed. Please reopen if you still have issues.