Tensorboard跳板机端口转发配置

出于网络安全策略考虑,内网服务器无法连接外网,一般通过跳板机免密登录,因此tensorboard无法使用。本文介绍通过SSH隧道技术穿透内外网限制,实现tensorboard实时监测tensorflow深度学习模型运行。

 

1、目标服务器host-inaccessible建立root权限的新用户(知晓root密码的可以跳过此步)

#建立新用户yzgpu,并添加到root用户的group(root)
[root@100-020-gpuserver ~]# adduser -g root yzgpu
#设置yzgpu密码
[root@100-020-gpuserver ~]# passwd yzgpu

#彻底删除某个用户,包括/home/yzgpu和邮件池/var/spool/mail/yzgpu,防止建立相同的用户报错
#[root@100-020-gpuserver ~]# userdel -r yzgpu
#

2、拥有等同root权限(root)的能与外网连接的服务器host-accessible,或者跳板机服务器host-jump

3、建立host-inaccessible和host-accessible(host-jump)之间的SSH隧道(方法见本人博客:SSH隧道技术-实现内网不可访问的服务器与外网互访

#host-accessible服务器运行
[root@hdfs08-dev yzadmin]# ssh -C -f -N -g -L 1817:host-inaccessible-ip:6006 host-inaccessible-username@host-inaccessible-ip

注意:将其中的端口号改为tensorboard指定端口号,若未指定则为6006即可

4、host-inaccessible服务器运行tensorboard --logdir=eval

[yzgpu@100-020-gpuserver faster_rcnn]$ tensorboard --logdir=eval
W0917 14:09:46.598918 139717303437056 plugin_event_accumulator.py:294] Found more than one graph event per run, or there was a metagraph containing a graph_def, as well as one or more graph events.  Overwriting the graph with the newest event.
W0917 14:09:46.603488 139717303437056 plugin_event_accumulator.py:302] Found more than one metagraph event per run. Overwriting the metagraph with the newest event.
W0917 14:09:46.653152 139717303437056 plugin_event_accumulator.py:294] Found more than one graph event per run, or there was a metagraph containing a graph_def, as well as one or more graph events.  Overwriting the graph with the newest event.
W0917 14:09:46.659667 139717303437056 plugin_event_accumulator.py:302] Found more than one metagraph event per run. Overwriting the metagraph with the newest event.
TensorBoard 1.14.0 at http://host-inaccessible-ip:6006/ (Press CTRL+C to quit)

5、打开host-accessible服务器,网页输入http://host-accessible-ip:1817,即可运行tensorboard可视化界面

(若该网址无法访问,可使用http://host-inaccessible-ip:6006,两者网址实际指向相同,但本人实际操作发现初次使用http://host-accessible-ip:1817有效,后面后续使用http://host-inaccessible-ip:6006才是有效连接,原因不明)

 

  • 4
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值