Hi David,
Can you share the README-running-multiple-agents.md or the script you used to install multiple agents?
In the go-agent-bootstrapper-wrapper.log file, I found that the agent is trying to start with `/var/lib/go-agent/` working directory. Whereas in the wrapper.conf file, wrapper.working.dir is pointing to /var/lib/go-agent-1. Were there any changes made to the agent `run` file (/usr/share/go-agent-1/ folder)?
INFO | jvm 1 | 2019/10/08 15:32:48 | [Tue Oct 08 15:32:48 UTC 2019] Starting process:
INFO | jvm 1 | 2019/10/08 15:32:48 | [Tue Oct 08 15:32:48 UTC 2019] Working directory : /var/lib/go-agentINFO | jvm 1 | 2019/10/08 15:32:48 | [Tue Oct 08 15:32:48 UTC 2019] Application arguments: [-serverUrl,
https://127.0.0.1:8154/go]
INFO | jvm 1 | 2019/10/08 15:32:48 | [Tue Oct 08 15:32:48 UTC 2019] GoCD Version: 19.9.0-10194
INFO | jvm 1 | 2019/10/08 15:32:48 | [Tue Oct 08 15:32:48 UTC 2019] Java Version: 12.0.1
INFO | jvm 1 | 2019/10/08 15:32:48 | [Tue Oct 08 15:32:48 UTC 2019] Operating System: Linux(4.4.0-159-generic)
I tried with the below script and it worked fine.
```bash
# spin up 5 additional GoCD agents.
AGENT_COUNT=2
# if you want to run the GoCD agent as a service
RUN_AS_SERVICE=true
# if you want to start the service immediately
# only works if `RUN_AS_SERVICE` is true
START_SERVICE_NOW=false
for AGENT_INDEX in $(seq 1 "${AGENT_COUNT}")
do
AGENT_ID="go-agent-${AGENT_INDEX}"
# create the directories for agent data and binaries
mkdir -p /usr/share/${AGENT_ID} /var/{lib,log}/${AGENT_ID} /var/lib/${AGENT_ID}/run
# copy over all config and shell scripts and wrapper configs
cp -arf /usr/share/go-agent/{bin,wrapper-config} /usr/share/${AGENT_ID}
# symlink the wrapper binaries
ln -sf /usr/share/go-agent/wrapper /usr/share/${AGENT_ID}
# change ownership and mode, so that the `go` user, and only that user
# can write to these directories
chown -R go:go /var/{lib,log}/${AGENT_ID}
chmod -R 0750 /var/{lib,log}/${AGENT_ID}
# tweak the scripts and configs to use the correct directories
sed -i -e "s@go-agent@${AGENT_ID}@g" /usr/share/${AGENT_ID}/bin/go-agent
sed -i -e "s@=go-agent\$@=${AGENT_ID}@g" \
-e "s@/var/lib/go-agent@/var/lib/${AGENT_ID}@g" \
-e "s@/var/log/go-agent@/var/log/${AGENT_ID}@g" \
-e "s@../wrapper-config/wrapper-properties.conf@/usr/share/${AGENT_ID}/wrapper-config/wrapper-properties.conf@g" \
/usr/share/${AGENT_ID}/wrapper-config/wrapper.conf
sed -i -e "s@/var/lib/go-agent@/var/lib/${AGENT_ID}@g" /usr/share/${AGENT_ID}/wrapper-config/wrapper-properties.conf
if [ "${RUN_AS_SERVICE}" == "true" ]; then
if [ "${START_SERVICE_NOW}" == "true" ]; then
/usr/share/${AGENT_ID}/bin/go-agent installstart
else
/usr/share/${AGENT_ID}/bin/go-agent install
fi
fi
done
```
Please note we pushed a
fix in GoCD 19.9.0 release to use the absolute path in the script which was causing some problem while multiple agent installation. Can you make sure you are using the updated script.
Regards,
Ankit