美文网首页
挂载远程服务器硬盘&在pycharm上配置远程连接

挂载远程服务器硬盘&在pycharm上配置远程连接

作者: 阮恒 | 来源:发表于2020-03-19 04:00 被阅读0次

挂载远程服务器硬盘

following this link: https://wxnacy.com/2018/04/12/osx-user-sshfs/

配置sshfs:
brew cask install osxfuse
brew install sshfs

但是我在运行命令时,遇到了如下问题:

brew install sshfs
==> Installing dependencies for sshfs: python and glib
==> Installing sshfs dependency: python
Error: Xcode alone is not sufficient on High Sierra.
Install the Command Line Tools:
  xcode-select --install

xuwenjiadeMBP:MPI-remote xuwenjia$ xcode-select --install
xcode-select: note: install requested for command line developer tools
xuwenjiadeMBP:MPI-remote xuwenjia$

于是我运行了 xcode-select --install
等软件安装完成之后又运行了brew install sshfs
结果又出错。。。

==> Pouring python-3.7.7.high_sierra.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3
Target /usr/local/bin/2to3
already exists. You may want to remove it:
  rm '/usr/local/bin/2to3'

To force the link and overwrite all conflicting files:
  brew link --overwrite python

To list all files that would be deleted:
  brew link --overwrite --dry-run python

Possible conflicting files are:
/usr/local/bin/2to3 -> /Library/Frameworks/Python.framework/Versions/3.6/bin/2to3
/usr/local/bin/idle3 -> /Library/Frameworks/Python.framework/Versions/3.6/bin/idle3

运行了rm '/usr/local/bin/2to3',之后继续运行brew install sshfs
然后就安装成功啦!
挂载硬盘:
sshfs user@hostname:/absolute/path/to/document local-file

在pycharm上设置远程调试

我首先需要进行端口二次映射,然后建立development,最后设置远程调试的interpreter

端口二次映射

因为我跑代码需要登录contact server,再登录GPU server。所以这里做一个端口映射,将自己主机上的端口映射到GPU server上。
ssh -fNL 6608:[GPU server]:22 user_name@contact server

例如:ssh -fNL 6608:d2volta10:22 wexu@contact.mpi-inf.mpg.de

建立development

如下图:


development

设置interpreter

following this link:
https://zhuanlan.zhihu.com/p/38591832

总体上差不多,这是最后的结果:


屏幕快照 2020-03-18 下午8.58.40.png

相关文章

网友评论

      本文标题:挂载远程服务器硬盘&在pycharm上配置远程连接

      本文链接:https://www.haomeiwen.com/subject/cpyhyhtx.html