E
Size: a a a
E
AS
type SshConnection struct {
Client *ssh.Client
}
ssh := &SshConnection{}
addr := fmt.Sprintf("%s:%s", "remote2.host", "22")
clientConfig := &ssh.ClientConfig{
User: "test",
Auth: []ssh.AuthMethod{
ssh.Password("test"),
},
Timeout: 5 * time.Minute,
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
c.Client, err = ssh.Dial("tcp", addr, clientConfig)
if err != nil {
return errors.Wrap(err, "initialize connect")
}
//---------------------------//
asRemoteAddr := fmt.Sprintf("%s:%s",
"remote3.host", "3000")
asLocalAddr := fmt.Sprintf("%s:%s",
"localhost", "3000")
err = ssh.OpenTunnel(asRemoteAddr, asLocalAddr)
if err != nil {
return errors.Wrap(err, "open tunnel for as")
}
//---------------------------//
asClient, err = aerospike.NewClient("localhost", 3000)
if err != nil {
panic(err)
}
E
E
Failed to connect to host(s): [localhost:3000]; error: Connecting to the cluster timed out.
AS
Failed to connect to host(s): [localhost:3000]; error: Connecting to the cluster timed out.
E
E
AS
type SshConnection struct {
Client *ssh.Client
}
ssh := &SshConnection{}
addr := fmt.Sprintf("%s:%s", "remote2.host", "22")
clientConfig := &ssh.ClientConfig{
User: "test",
Auth: []ssh.AuthMethod{
ssh.Password("test"),
},
Timeout: 5 * time.Minute,
HostKeyCallback: ssh.InsecureIgnoreHostKey(),
}
c.Client, err = ssh.Dial("tcp", addr, clientConfig)
if err != nil {
return errors.Wrap(err, "initialize connect")
}
//---------------------------//
asRemoteAddr := fmt.Sprintf("%s:%s",
"remote3.host", "3000")
asLocalAddr := fmt.Sprintf("%s:%s",
"localhost", "3000")
err = ssh.OpenTunnel(asRemoteAddr, asLocalAddr)
if err != nil {
return errors.Wrap(err, "open tunnel for as")
}
//---------------------------//
asClient, err = aerospike.NewClient("localhost", 3000)
if err != nil {
panic(err)
}
E
AS
E
NS