How to set up an agent on remote server

Hi, I want to construct drone on multi servers.
For example, master drone container is on FOO server and agent drone container is on BAR server.
FOO and BAR server is located in the same network and they have only private IP address.

When we access drone UI, we go there with LB in front of master drone container.

But I don’t understand how to set up the architecture.
After trying set-up with drone documentation multi server mode and agent , I tried to build a job,
drone run the job on the FOO server. ( I expected BAR server to process the job… )
What is wrong?

I’m glad if you teach me why.

here is docker command.

master ( the command is run on FOO server)

docker run \
  --volume=/var/run/docker.sock:/var/run/docker.sock   \
  --volume=/var/lib/drone:/data   \
  --env=DRONE_SERVER_PROTO=http   \
  --env=DRONE_TLS_AUTOCERT=false   \
  --env=DRONE_LOGS_DEBUG=true   \
  --env=DRONE_GIT_ALWAYS_AUTH=true  \
  --env=DRONE_AGENTS_ENABLED=true  \
  --publish=80:80   \
  --publish=443:443  \
  --restart=always   \
  --detach=true   \
  --name=drone   \

agent ( the command is run on BAR server)

docker run \
  --volume=/var/run/docker.sock:/var/run/docker.sock \
  --env=DRONE_RUNNER_NAME=agent1 \
  --env=DRONE_LOGS_DEBUG=true \
  --restart=always \
  --detach=true \
  --name=agent \

As an aside, you should probably be using 1.2.0, the latest stable release, instead of 1.0.0-rc.6 which is a release candidate and is no longer being supported.

1 Like

Thanks for comment.
I updated drone image version to 1.2.0

docker ps
CONTAINER ID        IMAGE               COMMAND               CREATED             STATUS              PORTS                                      NAMES
44fde753136c        drone/drone:1.2.0   "/bin/drone-server"   2 minutes ago       Up 2 minutes>80/tcp,>443/tcp   drone

docker ps
CONTAINER ID        IMAGE               COMMAND              CREATED             STATUS              PORTS               NAMES
6b49d6ae732e        drone/agent:1.2.0   "/bin/drone-agent"   2 minutes ago       Up 2 minutes                            agent

But, there is no change…
I guess that DRONE_RPC_SERVER option which is on agent server is wrong.