Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tear down replication for client #1072

Closed
mlissner opened this issue Dec 2, 2019 · 0 comments
Closed

Tear down replication for client #1072

mlissner opened this issue Dec 2, 2019 · 0 comments

Comments

@mlissner
Copy link
Member

mlissner commented Dec 2, 2019

We have a client that is no longer interested in our replication service. Tear it down and clean up any remaining bits and pieces.

The process seems to be:

On their server

  1. Login:

     psql -h xxxx.us-east-1.rds.amazonaws.com -U dbadmin --dbname courtlistener
    
  2. Show their subscriptions and note the subslotname and subpublications name:

     select * from pg_subscription;
      subdbid | subname  | subowner | subenabled |                       subconninfo                             | subslotname | subsynccommit | subpublications 
     ---------+----------+----------+------------+---------------------------------------------------------------+-------------+---------------+-----------------
        18463 | opendata |    16389 | t          | host=xxx port=5432 password=xxx user=xxx dbname=courtlistener | opendata    | off           | {opendata}
    
  3. Delete their subscription to our server:

      DROP SUBSCRIPTION opendata;
    

On our replication server in AWS:

  1. Show all publications:

     select * from pg_publication;
    
  2. Drop the publication:

     drop publication opendata;
    
  3. Check that the replication slot has been dropped (sometimes this can happen if you don't have the ability to drop the slot yourself (say the server disappeared)):

     select * from pg_replication_slots ;
    

    This shouldn't show the slot anymore, but if it does, you can drop it manually with:

     select pg_drop_replication_slot('opendata');
    
  4. Delete their user from our server:

     \du;
     REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM xxx;
     DROP USER xxx;
     \du
    

In AWS itself

Remove the inbound and outbound network allowances. In AWS this is done through your VPC's security group. The one to edit is: sg-044759e3ba310566a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant