Hello everyone! I'm trying to get Prefect2 running...
# prefect-getting-started
t
Hello everyone! I'm trying to get Prefect2 running on one of our remote VMs. However I'm unable to connect to it and as far as I can tell it must be something with prefect. What I do is simply run
prefect server start
and then point my browser to
<server-ip>:4200
to get the UI but only get "site can't be reached". However if I simple start a python http.server I can access that machine without a problem. I read online that previously there was a
--expose
flag that you could run but it doesn't seem to be a part of prefect2. Does anyone have any experience with getting this working, maybe I'm just missing something?
n
hi @Tim Josefsson - have you set
PREFECT_API_URL
locally and on the VM?
t
Hey @Nate! I have this set on the VM:
Copy code
prefecttests-1:~/prefect$ prefect config view
PREFECT_PROFILE='default'
PREFECT_API_DATABASE_CONNECTION_URL='********' (from profile)
PREFECT_API_URL='http://<server-ip>:4200' (from profile)
is that what you mean?
n
yep - just wanted to check that you have that set locally as well as on the VM what is your networking setup?
t
Locally I use sshuttle to proxy to the server. The strange part is that if I run server in a docker using the compose in this repo https://github.com/rpeden/prefect-docker-compose/tree/main and run it on the remote vm I can access the prefect server without a hitch.
n
sorry if this seems repetitive, but just to confirm, you have set
PREFECT_API_URL
locally as well as on the VM?
t
No worries! On my VM I have the following in
~/.prefect/profiles.toml
Copy code
active = "default"

[profiles.default]
PREFECT_API_DATABASE_CONNECTION_URL = "postgresql+asyncpg://*****:*****@localhost:5432/prefect"
PREFECT_API_URL = "http://<vm-ip>:4200/api"
and locally i have the following
~/.prefect/profiles.toml
Copy code
active = "default"

[profiles.default]
PREFECT_API_URL = "http://<vm-ip>:4200/api"