Toolserver:Admin:Sshtunnel

sshtunnel is the old way to allow database servers to access Wikimedia databases for replication. (See sql-proxy for the new method.) sshtunnel runs on each host from SMF.

Add a new tunnel
$ svccfg -s sshtunnel svc:/network/sshtunnel> add s3 svc:/network/sshtunnel> select s3 svc:/network/sshtunnel:s3> addpg tunnel application svc:/network/sshtunnel:s3> setprop tunnel/local-port = integer: 3333 svc:/network/sshtunnel:s3> setprop tunnel/remote-port = integer: 3306 svc:/network/sshtunnel:s3> setprop tunnel/remote-host = astring: db3

This will create a new instance called "s3", which forwards the local port 3333 to db3:3306 on the remote side. Start it with: svcadm enable sshtunnel:s3.

Modify an existing tunnel
$ svccfg -s sshtunnel:name}} $ svc:/network/sshtunnel:name> setprop tunnel/remote-host = db3 svc:/network/sshtunnel:name> quit $ svcadm refresh sshtunnel:name $ svcadm restart sshtunnel:name

Available properties:
 * tunnel/remote-host
 * tunnel/remote-port
 * tunnel/local-port

Delete a tunnel
$ svccfg delete sshtunnel:name

Installing sshtunnel on a new host
Don't do that, it's old. Use sql-proxy instead.