본문 바로가기

Management

[Operations] Database(Cassandra, Postgres) 접속 방법

1. Cassandra 접속 방법(Cassandra 폴더 확인)

$VMWARE_PYTHON_BIN /usr/lib/vmware-vcops/cassandra/apache-cassandra-3.11.12/bin/cqlsh.py --ssl --cqlshrc /usr/lib/vmware-vcops/user/conf/cassandra/cqlshrc

 

예제)

admin@vRealizeClusterNode [ /usr/lib/vmware-vcops/user/log ]$ $VMWARE_PYTHON_BIN /usr/lib/vmware-vcops/cassandra/apache-cassandra-3.11.12/bin/cqlsh.py --ssl --cqlshrc /usr/lib/vmware-vcops/user/conf/cassandra/cqlshrc
/usr/lib/vmware-vcops/cassandra/apache-cassandra-3.11.12/bin/cqlsh.py:2272: DeprecationWarning: The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.
Connected to VROps Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.12 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
vcops_user@cqlsh>

 

2. Postgres 접속 방법

su - postgres -c "/opt/vmware/vpostgres/current/bin/psql -d vcopsdb -p 5432"

 

예제)

root@vRealizeClusterNode [ ~ ]# su - postgres -c "/opt/vmware/vpostgres/current/bin/psql -d vcopsdb -p 5432"

psql.bin (11.15 (VMware Postgres 11.15.0-19441216 release))

Type "help" for help.