猿问

在 GCP VM 上运行 MLFlow

我已经在 GCP VM 实例上安装了 mlflow,现在我想使用外部 IP 访问 mlflow UI。我尝试设置防火墙规则并打开mlflow的默认端口,但无法访问它。有人可以为在VM实例上运行mlflow提供分步过程吗?


婷婷同学_
浏览 113回答 1
1回答

白衣染霜花

我决定检查我的测试VM并在GCE VM上运行mlflow服务器。看看我的以下步骤:创建基于 Ubuntu Linux 18.04 LTS 的 VM 实例安装 MLflow:$ 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 --versionmlflow, version 1.7.1.dev0在 VM 实例的内部 IP 上运行 mlflow 服务器(默认为 127.0.0.1):$ ifconfig&nbsp;ens4: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>&nbsp; mtu 1460inet 10.XXX.15.XXX&nbsp; netmask 255.255.255.255&nbsp; 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从 VM 实例检查(从第二个连接):$ curl -I http://10.XXX.15.XXX:5000HTTP/1.1 200 OKServer: gunicorn/20.0.4Date: Mon, 09 Mar 2020 15:06:08 GMTConnection: closeContent-Length: 853Content-Type: text/html; charset=utf-8Last-Modified: Mon, 09 Mar 2020 14:57:11 GMTCache-Control: public, max-age=43200Expires: Tue, 10 Mar 2020 03:06:08 GMTETag: "1583765831.3202355-853-3764264575"设置网络标签 mlflow-server创建防火墙规则以允许在端口 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.XXXStarting Nmap 7.80 ( https://nmap.org ) at 2020-03-09 16:20 CETNmap scan report for 74.123.225.35.bc.googleusercontent.com (35.225.XXX.XXX)Host is up (0.20s latency).Not shown: 993 filtered portsPORT&nbsp; &nbsp; &nbsp;STATE&nbsp; SERVICE...5000/tcp open&nbsp; &nbsp;upnp...转到网络浏览器 http://35.225.XXX.XXX:5000/
随时随地看视频慕课网APP

相关分类

Python
我要回答