How to verify PCF RabbitMQ service matches the RabbitMQ server vhost
search cancel

How to verify PCF RabbitMQ service matches the RabbitMQ server vhost

book

Article ID: 293199

calendar_today

Updated On:

Products

VMware RabbitMQ

Issue/Introduction

This article helps to verify service instance for PCF RabbitMQ has a correctly configured unique virtual host on the underlying RabbitMQ server.

 


Environment


Cause

Each pre-provisioned service instance for PCF RabbitMQ has a vhost defined to logically separate the service transactions. The service instance GUID matches the RabbitMQ vhost. If the vhost information is missing or does not match in RabbitMQ cluster, the service instance will NOT function.

 

Resolution

  1. Access the dashboard URL from service instance properties:

    • Run cf service <SERVICE_INSTANCE_NAME>
    • Access the Management UI using the dashboard URL from the above output.
    • For Example:
    $ cf service rmq-1
    
    Service instance: rmq-1
    Service: p-rabbitmq
    Bound apps:
    Tags:
    Plan: standard
    Description: RabbitMQ service to provide shared instances of this high-performance multi-protocol messaging broker.
    Documentation url: http://docs.pivotal.io
    Dashboard: https://pivotal-rabbitmq.example.pivotal.io/#/login/mu-<userdid>/<password>
    
    Last Operation
    Status: create succeeded
    Message:
    Started: 2018-02-07T13:30:47Z
    Updated: 2018-02-07T13:30:47Z
    
    • If you can access the management UI, it confirms the correct configuration of the service instance.
    • If the dashboard URL can't be opened or not present, proceed to step 2.
  2. Get the service instance GUID:
    • Run cf service <SERVICE_INSTANCE_NAME> --guid
  3. Login to the RabbitMQ Management GUI using admin user.
  4. Verify that there is a vhost matching the service GUID.
    • On top right-side, make sure the vhost exist in the Virtual host dropdown.
    • If the vhost exists, it confirms the correct configuration of service instance.
    • If not, proceed to step 5.
  5. Follow these steps:
    • Unbind the apps bound to the service instance: cf unbind-service <app-name> <service-instance-name> 
    • Delete the service instance: cf delete-service <service-instance-name>
    • Recreate the service instance: cf create-service p-rabbitmq <plan> <service-instance-name>
    • Bind the app to the service instance: cf bind-service <app-name> <service-instance-name> 

 


Additional Information

The vhost of the service instance can also be found in the VCAP_SERVICES of the app it is bound to. See RabbitMQ Environment Variables docs for details.

+Environment:

RabbitMQ for Pivotal Cloud Foundry (PCF)