创建SSH隧道以在AWS上集群应用的便捷工具
项目描述
创建SSH隧道以在AWS上集群应用的便捷工具。
示例集群应用包括
Kafka
Zookeeper
Cassandra
此工具会自动将私有VPC IP地址添加到您的本地回环lo接口以及到您的/etc/hosts文件中。集群节点可以直接从您的本地机器访问。
$ tunnels my-senza-stack 9092 odd-eu-central-1.myteam.example.org --region eu-central-1
安装
$ git clone https://github.com/zalando-stups/ssh-tunnels.git
$ cd ssh-tunnels
$ sudo python3 setup.py install # remove "sudo" if you have user-local Python setup
用法
连接到使用Senza部署的Cassandra集群
$ piu odd-eu-west-1.myteam.example.org SSH tunnel to Cassandra for keyspace management
$ tunnels my-cassandra 9042 odd-eu-west-1.myteam.example.org --region eu-west-1
# open a new terminal
$ cqlsh 172.31.141.1 # take one seed IP printed by tunnels.py