vscode连接集群失败解决方法

实验室有自己的服务器,同时院里也有集群,我用内网或者外网连接自己的服务器的时候都没什么问题,但是连接集群就一直连接不上,报错如下

vscode Acquiring lock on xxxx省略

第一个解决办法

第一个方法是进入到服务器中自己的文件目录下/home/your_name,找到.vscode-server的文件夹,这个文件夹是隐藏的,可以用ls -a命令显示出来,然后直接rm -rf .vscode-server删除即可,然后重新登陆

我在删除的时候遇到了一个问题,如下

rm: cannot remove ‘.vscode-server/bin/da76f93349a72022ca4670c1b84860304616aaa2/.nfs000000000cf2e66d000018fd’: Device or resource busy
rm: cannot remove ‘.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/.nfs000000000cf2e66c000018fe’: Device or resource busy

解决方法是把相关进程kill掉即可

[wangyh2@gwork ~]$ lsof | grep nfs0000
bash       3733              wangyh2   99w      REG    0,39         0 217245292 /ghome/wangyh2/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/.nfs000000000cf2e66c000018fe (Gstore:/mnt/ghome/share/ghome)
flock      3773              wangyh2   99w      REG    0,39         0 217245292 /ghome/wangyh2/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/.nfs000000000cf2e66c000018fe (Gstore:/mnt/ghome/share/ghome)
bash      11821              wangyh2   99w      REG    0,39         0 217245292 /ghome/wangyh2/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/.nfs000000000cf2e66c000018fe (Gstore:/mnt/ghome/share/ghome)
flock     11839              wangyh2   99w      REG    0,39         0 217245292 /ghome/wangyh2/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/.nfs000000000cf2e66c000018fe (Gstore:/mnt/ghome/share/ghome)
bash      14498              wangyh2   99w      REG    0,39         0 217245292 /ghome/wangyh2/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/.nfs000000000cf2e66c000018fe (Gstore:/mnt/ghome/share/ghome)
flock     14537              wangyh2   99w      REG    0,39         0 217245292 /ghome/wangyh2/.vscode-server/bin/d045a5eda657f4d7b676dedbfa7aab8207f8a075/.nfs000000000cf2e66c000018fe (Gstore:/mnt/ghome/share/ghome)
bash      23313              wangyh2   99w      REG    0,39         0 217245293 /ghome/wangyh2/.vscode-server/bin/da76f93349a72022ca4670c1b84860304616aaa2/.nfs000000000cf2e66d000018fd (Gstore:/mnt/ghome/share/ghome)
flock     23346              wangyh2   99w      REG    0,39         0 217245293 /ghome/wangyh2/.vscode-server/bin/da76f93349a72022ca4670c1b84860304616aaa2/.nfs000000000cf2e66d000018fd (Gstore:/mnt/ghome/share/ghome)
bash      26092              wangyh2   99w      REG    0,39         0 217245293 /ghome/wangyh2/.vscode-server/bin/da76f93349a72022ca4670c1b84860304616aaa2/.nfs000000000cf2e66d000018fd (Gstore:/mnt/ghome/share/ghome)
flock     26125              wangyh2   99w      REG    0,39         0 217245293 /ghome/wangyh2/.vscode-server/bin/da76f93349a72022ca4670c1b84860304616aaa2/.nfs000000000cf2e66d000018fd (Gstore:/mnt/ghome/share/ghome)
[wangyh2@gwork ~]$ kill -9 3733 3773

将上述所有进程kill掉之后就可以删除.vscode-server文件夹了,然后尝试再次用vscode连接远程服务器即可

第二种解决办法

如果尝试了上述方法还不奏效,就尝试以下方法

  1. 设置remote.SSH.useFlock: False,打开vscode的setting部分,搜索ssh就可以找到了
  2. 然后按照第一种解决办法删除.vscode-server即可

我用第二种方法解决了问题,但是集群能登陆上去了,我的服务器就登陆不上去了。。。然后我又把remote.SSH.useFlock改为了true,然后我的服务器能登陆上去了,集群又登不上去了。

不知道怎么解决,sad

你可能感兴趣的:(服务器,vscode,ide,编辑器)