File tree Expand file tree Collapse file tree 8 files changed +60
-0
lines changed
Expand file tree Collapse file tree 8 files changed +60
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ hide :
3+ - toc
4+ ---
5+
6+ # 访问管理
7+
8+ 访问管理 d.run 平台给用户暴露服务到公网访问的一个功能,允许将任何端口暴露到公网进行访问(不包含已经预留服务的端口:22/5555/6666/10001/10002)。
9+
10+ 本文以 ngnix 为例,介绍如何使用容器实例的访问管理能力开放端口。开放端口生成的外部访问地址可供外部人员访问。
11+
12+ ## 前提条件
13+
14+ - 登录 d.run 账号
15+ - 已通过算力云[ 创建容器实例] ( https://docs.d.run/zestu/instance ) ,且容器实例状态为 ** 运行中**
16+
17+ ## 操作步骤
18+
19+ 1 . 登录 d.run 账号,在顶部导航栏点击 __ 算力云__ ,然后点击左侧导航栏的 __ 容器实例__ ,在容器列表中选择您要操作的容器实例。
20+
21+ ![ 容器实例列表] ( ../images/ins1.png )
22+
23+ 1 . 在容器实例列表页面,点击 __ SSH 登录__ ,通过 SSH 命令登录容器实例。
24+
25+ ![ SSH 登录1] ( ../images/sshsecret.png )
26+
27+ ![ SSH 登录2] ( ../images/terminal1.jpeg )
28+
29+ 1 . 安装并启动 nginx 服务。
30+
31+ ``` bash
32+ apt update
33+ apt install -y nginx && nginx && ps -ef| grep master
34+ apt install lsof # 安装lsof
35+ ```
36+
37+ 1. nginx 默认端口是 80,检查一下 nginx 是否正常启动。
38+
39+ ` ` ` bash
40+ lsof -i:80
41+ ` ` `
42+
43+ 返回如下信息,表明端口被 nginx 正常占用。
44+
45+ ` ` ` bash
46+ COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
47+ nginx 2693 root 6u IPv4 723250562 0t0 TCP * :80 (LISTEN)
48+ nginx 2693 root 7u IPv6 723250563 0t0 TCP * :80 (LISTEN)
49+ ` ` `
50+
51+ 1. 将 nginx 的端口添加到访问管理,并等待外部端口的分配(约 1 分钟)。
52+
53+ ! [开放端口2](../images/openport2.png)
54+
55+ ! [开放端口3](../images/openport3.png)
56+
57+ 1. 点击生成的外部访问链接,即可访问 nginx 服务。
58+
59+ ! [nginx1](../images/NGINX1.png)
Original file line number Diff line number Diff line change 1212 - JupyterLab : zestu/instance/jupyter.md
1313 - SSH : zestu/instance/ssh.md
1414 - VS Code : zestu/instance/vscode.md
15+ - 访问管理 : zestu/instance/openport.md
1516 - 文件存储 :
1617 - 初始化文件存储 : zestu/filestorage/storage.md
1718 - 文件存储扩缩容 : zestu/filestorage/filescale.md
You can’t perform that action at this time.
0 commit comments