MichaelRyom

vCops db remote access

Sep 23rd, 2013
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.95 KB | None | 0 0
  1. #Setup access to vCops(Analytics VM)
  2.     #Grant access to the db from a ip subset
  3.     vi /data/pgsql/data/pg_hba.conf
  4.     Add line:
  5.     host    all         all         192.168.0.0/24          md5
  6.    
  7.     #Open for port 5432 in the vCops firewall
  8.     vi /usr/lib/vmware-vcops/user/conf/install/vcopsfirewall.conf
  9.     Add lines:
  10.     # postgres
  11.     TCPPORTS="$TCPPORTS 5432"
  12.    
  13.     #Restart vCops firewall
  14.     service vcopsfirewall restart
  15.    
  16.     #Restart vCops Postgres db
  17.     sudo -u postgres /opt/vmware/vpostgres/9.0/bin/pg_ctl -D /data/pgsql/data -m immediate restart
  18.  
  19.  
  20. #Login access
  21. #Get db user list -
  22. #su postgres
  23. #psql
  24. #\du
  25. #Get password for the db user(alive) -
  26. #su admin
  27. #vcops-admin get_db_password
  28.  
  29.     #Create db user and assign "read only" rights
  30.     su postgres
  31.     psql alivevm
  32.     CREATE USER USERNAME WITH PASSWORD 'PASSWORD';
  33.     GRANT CONNECT ON DATABASE alivevm TO USERNAME;
  34.     GRANT SELECT ON ALL TABLES IN SCHEMA public to USERNAME;
  35.  
  36. User now has remote access to the vCops db
Advertisement
Add Comment
Please, Sign In to add comment