How do i get Prefect agents on a different machine...
# ask-community
c
How do i get Prefect agents on a different machine from the prefect server host? I am trying to create scalability options
Launching it on another machine, I activated the same venv, and when starting the agent its still defaulting to the C:\, where do I change the setting there?
r
You can run
prefect config set PREFECT_API_URL=<http://your-server-hostname-or-ip/api>
to tell the agent or worker to connect to your server on another machine. Setting a
PREFECT_API_URL
environment variable will also work.
🙌 1
c
Thanks @Ryan Peden, sorry for the dumb follow up question, pretty new to this: • On one machine I have installed prefect and started the server • On another machine I conda activated the same venv as the the one in the first machine, and tried running prefect agent start. ◦ Do I need to install prefect in the other machine? I keep getting the same error, Im not even able to use
prefect config view
â—¦
r
Not a dumb question at all. You'll definitely need Prefect installed on the other machine, too. Installing it in your conda env should work. Also consider using a worker instead of an agent. Agents are deprecated and will be removed later this year. Fortunately, if your agents were just spinning up flows using processes, using a worker is easy - just a slightly different command than the one for running an agent. The Prefect docs explain workers very well, and if you run into any issues I'm sure the community here on Slack will be able to help you sort them out!