我已在 GCP VM 实例上安装了 mlflow,
现在我想使用外部IP访问mlflow UI。
我尝试设置防火墙规则并打开 mlflow 的默认端口,但无法访问它。
有人可以给出在虚拟机实例上运行 mlflow 的分步过程吗?
我决定检查我的测试虚拟机并在 GCE 虚拟机上运行 mlflow 服务器。看看我下面的步骤:
- 创建基于 Ubuntu Linux 18.04 LTS 的 VM 实例
-
安装MLflow https://www.mlflow.org/docs/latest/quickstart.html:
$ sudo apt update
$ sudo apt upgrade
$ cd ~
$ git clone https://github.com/mlflow/mlflow
$ cd mlflow
$ sudo apt install python3-pip
$ pip3 install mlflow
$ python3 setup.py build
$ sudo python3 setup.py install
$ mlflow --version
mlflow, version 1.7.1.dev0
-
在VM实例的内部IP上运行mlflow服务器(默认127.0.0.1):
$ ifconfig
ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1460
inet 10.XXX.15.XXX netmask 255.255.255.255 broadcast 0.0.0.0
...
$ mlflow server --host 10.XXX.15.XXX
[2020-03-09 15:05:50 +0000] [8631] [INFO] Starting gunicorn 20.0.4
[2020-03-09 15:05:50 +0000] [8631] [INFO] Listening at: http://10.128.15.211:5000 (8631)
[2020-03-09 15:05:50 +0000] [8631] [INFO] Using worker: sync
[2020-03-09 15:05:50 +0000] [8634] [INFO] Booting worker with pid: 8634
[2020-03-09 15:05:51 +0000] [8635] [INFO] Booting worker with pid: 8635
[2020-03-09 15:05:51 +0000] [8636] [INFO] Booting worker with pid: 8636
[2020-03-09 15:05:51 +0000] [8638] [INFO] Booting worker with pid: 8638
-
从虚拟机实例检查(从第二个连接):
$ curl -I http://10.XXX.15.XXX:5000
HTTP/1.1 200 OK
Server: gunicorn/20.0.4
Date: Mon, 09 Mar 2020 15:06:08 GMT
Connection: close
Content-Length: 853
Content-Type: text/html; charset=utf-8
Last-Modified: Mon, 09 Mar 2020 14:57:11 GMT
Cache-Control: public, max-age=43200
Expires: Tue, 10 Mar 2020 03:06:08 GMT
ETag: "1583765831.3202355-853-3764264575"
设置网络标签 https://cloud.google.com/vpc/docs/add-remove-network-tags mlflow-server
-
创建防火墙规则 https://cloud.google.com/vpc/docs/using-firewalls#creating_firewall_rules允许访问端口 5000
$ gcloud compute --project=test-prj firewall-rules create mlflow-server --direction=INGRESS --priority=999 --network=default --action=ALLOW --rules=tcp:5000 --source-ranges=0.0.0.0/0 --target-tags=mlflow-server
-
从本地 Linux 计算机检查nmap -Pn 35.225.XXX.XXX
Starting Nmap 7.80 ( https://nmap.org ) at 2020-03-09 16:20 CET
Nmap scan report for 74.123.225.35.bc.googleusercontent.com (35.225.XXX.XXX)
Host is up (0.20s latency).
Not shown: 993 filtered ports
PORT STATE SERVICE
...
5000/tcp open upnp
...
转到网络浏览器http://35.225.XXX.XXX:5000/ http://35.225.XXX.XXX:5000/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)