フィードを購読する

This post was originally written by Markus Eisele in his blog: http://blog.eisele.net/2015/10/openshift-quick-tip-port-forwarding.html

origin Just a short tip today, but I was playing around with the all-in-one vm from the OpenShift team and wanted to use the port-forwarding feature for a quick check of a running database. You can use the CLI to forward one or more local ports to a pod. This allows you to listen on a given or random port locally, and have data forwarded to and from given ports in the pod.

 

But whenever I tried to execute:

<code>oc port-forward mysql-2-zjx6u 3306:3306</code>

It looked like it worked until the very first time I tried to use the tunnel:

I1020 11:38:54.754799 8356 portforward.go:227] Forwarding from 127.0.0.1:3306 -> 3306
I1020 11:38:54.757299 8356 portforward.go:227] Forwarding from [::1]:3306 -> 3306
I1020 11:39:10.824839 8356 portforward.go:253] Handling connection for 3306
E1020 11:39:10.833340 8356 portforward.go:312] An error occurred forwarding 3306 -> 3306: Error forwarding port 3306 to pod mysql-2-zjx6u_myfear, uid : Unable to do port forwarding: socat not found.

 

Turns out, that the needed socat package isn't installed on the all-in-one-vm. In order to fix that, you have to ssh into the instance:

<code>vagrant ssh</code>

 

And install socat:

<code>sudo /bin/yum install socat</code>

 

After that you're able to use the tunnel and forward ports to your OpenShift pod.

Further Information:

Author

Markus Eisele
Developer Advocate
JBoss Middleware at Red Hat

@myfear
http://blog.eisele.net/


執筆者紹介

Markus Eisele is a Red Hat Developer Tools Marketing Lead at Red Hat. He is also a JavaTM Champion, former Java EE Expert Group member, founder of German JavaLand and a speaker at Java conferences around the world.

Read full bio
UI_Icon-Red_Hat-Close-A-Black-RGB

チャンネル別に見る

automation icon

自動化

テクノロジー、チームおよび環境に関する IT 自動化の最新情報

AI icon

AI (人工知能)

お客様が AI ワークロードをどこでも自由に実行することを可能にするプラットフォームについてのアップデート

open hybrid cloud icon

オープン・ハイブリッドクラウド

ハイブリッドクラウドで柔軟に未来を築く方法をご確認ください。

security icon

セキュリティ

環境やテクノロジー全体に及ぶリスクを軽減する方法に関する最新情報

edge icon

エッジコンピューティング

エッジでの運用を単純化するプラットフォームのアップデート

Infrastructure icon

インフラストラクチャ

世界有数のエンタープライズ向け Linux プラットフォームの最新情報

application development icon

アプリケーション

アプリケーションの最も困難な課題に対する Red Hat ソリューションの詳細

Original series icon

オリジナル番組

エンタープライズ向けテクノロジーのメーカーやリーダーによるストーリー