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才是有效连接,原因不明)

Tensorboard跳板机端口转发配置_第1张图片

 

你可能感兴趣的:(基础环境配置)