Skip to content

Commit

Permalink
使用 VNC 可视化环境
Browse files Browse the repository at this point in the history
  • Loading branch information
JiangLiNSCC committed May 25, 2016
1 parent 2ed1895 commit cb504f2
Show file tree
Hide file tree
Showing 2 changed files with 241 additions and 0 deletions.
241 changes: 241 additions & 0 deletions Use VNC .ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 可视化系统使用说明\n",
"\n",
"目前,初步完成了基于天河二号的可视化系统的使用说明 ,用户可以参考此说明文件进行体验,如有问题请和我们沟通。\n",
"\n",
"在使用环境前,你需要了解:\n",
"\n",
"* 需要使用前面的节点分区(ln0\\ln1\\ln3 等) ,目前暂不支持基金用户(ln7\\ln8)\n",
"\n",
"* 需要具有 docker 作业分区的权限 \n",
"\n",
"* 此工具可能会不定期进行更新。\n",
"\n",
"* VNC 桌面一旦开启就会占用计算节点并进行计费,用户在不使用时请及时退出,避免浪费。\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 0. Quick start \n",
"\n",
"如果是第一次使用,首先需要将脚本工具复制过去,并进入所在的文件夹里。"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"hostport killallnonvc.sh runvnc.sh server.sh settings.sh\r\n"
]
}
],
"source": [
"cp -r /WORK/app/vis ~/vis \n",
"cd ~/vis\n",
"ls"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"运行下面的命令即可完成VNC 环境的启动。(在此之前您最好修改配置)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"123456 654321 docker\r\n",
"rm: cannot remove `log.httpadd': No such file or directory\r\n",
"Submitted batch job 416772\r\n",
" http://172.16.23.16:6080/vnc.html?host=172.16.23.16&port=6080\r\n"
]
}
],
"source": [
"source runvnc.sh"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"现在,您就可以使用浏览器访问最后的网址来访问桌面环境了。\n",
"\n",
"![效果图](....)\n",
"\n",
"\n",
"## 1. 配置参数(修改密码)\n",
"\n",
"主要的参数是在 脚本文件 settings.sh 里面,按需求进行修改即可。别的用户如果获得或者猜测出您的密码也是可以通过这个网址访问您的计算环境的。"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"#!/bin/sh\r\n",
"export VNC_PW1=123456\r\n",
"export VNC_PW2=654321\r\n",
"export VNC_PAR=docker\r\n",
"export VNC_SNIP=172.16.23.16\r\n",
"export VNC_SNNM=ln6-gn0\r\n",
"export VNC_SNNMS=ln6\r\n"
]
}
],
"source": [
"cat settings.sh"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"其中,您需要修改的是`export VNC_PW1=123456` 和 `export VNC_PW2=654321` 两个。\n",
"\n",
"密码 123456 是VNC 验证的密码 , 请重设。\n",
"\n",
"密码 654321 是 VNC 的观众密码 , 也请重设。 用观众密码登陆的话,只能看,不能操作 。"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## 2. 退出VNC 环境 \n",
"VNC 环境有两部门组成:申请的计算节点 和 在登陆节点的转发代理,这两者目前都需要主动释放"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" JOBID PARTITION NAME USER ST TIME NODES NODELIST(REASON)\r\n",
" 416772 docker server.s nscc-gz_jian R 19:11 1 cn7557\r\n"
]
}
],
"source": [
"yhqueue"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"如图所示,使用 yhq 可以看到占用的节点资源, 作业名为 server.sh (只显示了前8个字符),可以用yhcancel 释放节点资源。"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": []
}
],
"source": [
"yhcancel 416772"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"然后可以用这里的工具释放登陆节点的转发代理 ,运行下面的命令即可:(如果您拷贝过来的位置不同,请自行修改) "
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"kill 36466: No such process\r\n"
]
}
],
"source": [
"ssh ln6 ~/vis/killallnonvc.sh"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"这里多出的一行提示信息不用管。现在整个系统资源就已经完整释放了。"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Bash",
"language": "bash",
"name": "bash"
},
"language_info": {
"codemirror_mode": "shell",
"file_extension": ".sh",
"mimetype": "text/x-sh",
"name": "bash"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
Binary file added use-vnc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cb504f2

Please sign in to comment.