12
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

踏み台サーバ越しにあるRedisにRedis Desktop Managerでつなぎにいく

Last updated at Posted at 2015-10-26

背景

前回はMySQLでしたが今回は、Redis Desktop Managerです。
RedisをGUIでいじれるのないかなーと探していて以前見つけたのがこのツールです。
もちろんコマンドで叩いててもいいですがGUIのほうが早かったり直感的だったりします。

気に入っている点としては、以下の点です。

  • データベースごとのキーの数がすぐわかる
  • キーの値にクリックのみでアクセスできる
  • キーと値の消去もクリックのみで出来る
  • JSONで値が入っていても整形して出してくれる
  • TTLなどの値も表示されている

gui_1.png

gui_2.png

ローカルにあるRedisは簡単につなげるのですが、その時に困るのが、踏み台など経由した先にあるRedisにつなぐ場合です。
この場合、後述するように設定すると繋げれるようになります。

環境

server.png

ローカルのMacからAppサーバであるApp001に、踏み台を経由して以下のコマンドで、つなぎに行けることを前提としています。
なおapp001はApp001のホスト名です。

ssh app001

上記のようにつなぐには~/.ssh/configに以下のような設定をします。
fumidai_proxyが踏み台のホスト名です(図ではHost: fumidaiのこと)

Host fumidai_proxy
    HostName fumidai
    User user_name
    IdentityFile ~/.ssh/id_rsa
    
Host app001
    User user_name
    IdentityFile ~/.ssh/id_rsa
    ProxyCommand ssh fumidai_proxy -W %h:%p

Redis Desktop Managerの設定

バージョン

最新バージョンは、0.8.1ですが、SSHトンネリングがうまく使えないのと、UIがバグっている場合があるので、__0.7.6__を使用します。
なお、過去のリリースは以下から取得できます。

https://github.com/uglide/RedisDesktopManager/releases

設定手順

前回のMySQLのときはSSHを経由しての設定ができたのですが、今回はできないのでSSHのポートフォワードを使います。
以下のようにコマンドを叩きます。

ssh -fNL 50011:redis:6379 app001

説明は以下です。

rdm_3.png

SSHポートフォワードが設定できたらRedis Desktop Managerを開き以下のように設定し、接続するとつながります。

rdm_2.png

結び

いちいちSSHのポートフォワードを設定しなければいけないところが面倒いのですが、何かいい方法があったりするのかしら。

12
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
12
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?