Jump to content

Toolserver:Admin:Sshtunnel

From mediawiki.org

This page was moved from the Toolserver wiki.
Toolserver has been replaced by Toolforge. As such, the instructions here may no longer work, but may still be of historical interest.
Please help by updating examples, links, template links, etc. If a page is still relevant, move it to a normal title and leave a redirect.

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

[edit]
$ 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

[edit]
$ 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

[edit]
$ svccfg delete sshtunnel:name

Installing sshtunnel on a new host

[edit]

Don't do that, it's old. Use sql-proxy instead.

Category:Admin:Database