private void createProxyScript(ClusterSpec clusterSpec, Cluster cluster) {
File configDir = getConfigDir(clusterSpec);
File hbaseProxyFile = new File(configDir, "hbase-proxy.sh");
try {
HadoopProxy proxy = new HadoopProxy(clusterSpec, cluster);
InetAddress master = HBaseCluster.getMasterPublicAddress(cluster);
String script = String.format("echo 'Running proxy to HBase cluster at %s. " +
"Use Ctrl-c to quit.'\n", master.getHostName())
+ Joiner.on(" ").join(proxy.getProxyCommand());
Files.write(script, hbaseProxyFile, Charsets.UTF_8);
hbaseProxyFile.setExecutable(true);
LOG.info("Wrote HBase proxy script {}", hbaseProxyFile);
} catch (IOException e) {
LOG.error("Problem writing HBase proxy script {}", hbaseProxyFile, e);