- 最新
- 最多得票
- 最多評論
Thanks all for your suggestions. I managed to get it running as a systemd service. Here's the template in case anyone is looking for the same
echo 'Installing JDK 11'
sudo amazon-linux-extras install java-openjdk11 -y
echo 'Setting up proxy as a service'
sudo tee -a /etc/systemd/system/{{proxy_name}}.service > /dev/null <<EOT
[Unit]
Description=proxy for game servers
After=network.target
[Service]
User=root
WorkingDirectory={{gamelift_working_dir}}/
ExecStart=/usr/lib/jvm/jre-11/bin/java -Dlogging.file.name={{gamelift_working_dir}}/{{proxy_name}}.log -jar {{proxy_name}}-{{proxy_version}}-all.jar
SuccessExitStatus=143
Restart=always
[Install]
WantedBy=multi-user.target
EOT
sudo chmod 0644 /etc/systemd/system/{{proxy_name}}.service
sudo systemctl daemon-reload
sudo systemctl start {{proxy_name}}.service
sudo systemctl enable {{proxy_name}}.service
sudo systemctl status {{proxy_name}}.service
Hi, did you tried to install the proxy as a linux service (assuming is linux OS)? This may be a good approach to ensure it's always running (depending on the init system): for systemd: https://singlebrook.com/2017/10/23/auto-restart-crashed-service-systemd/
Not sure this helps but for sure it will not hang the install script
"FLEET_CREATION_RUNNING_INSTALLER – The game server build files were successfully extracted, and the Amazon GameLift is now running the build's install script (if one is included). Failure in this stage prevents a fleet from moving to ACTIVE
status. Logs for this stage list the installation steps and whether or not the install completed successfully. Access the logs by using the URL in PreSignedLogUrl."
- Indicates your install.sh is bad as the fleet never moved out of this stage (next step should be
FLEET_CREATION_VALIDATING_RUNTIME_CONFIG
I believe.
Things to bear in mind:
-
The process that GameLift launches has to be the process that checks in with OnProcessReady etc. Otherwise you can't complete registration and GameLift recycles the process. So your proxy can't be the thing that is launched as part of the runtime config.
-
GameLift runs on Amazon Linux 2 which is fairly barebones, so you can use docker and the AL2 image to test and tune your install.sh script
-
Fleet events page should have the logs for running your install.sh script. You should be able to get the logs here from your script. It does sound like the script does not complete/hangs though.
-
Not sure if you can access to the instance during the install part of fleet creation, but when debugging new fleets always open the debug ports as part of fleet creation (they can only be changed for fleets in ERROR or ACTIVE).
This may have some further useful information: https://forums.awsgametech.com/t/install-node-exporter-on-gamelift-instances/9857
If you are still having problems then if you provide a fleet id and region, I can get the GameLift service team to take a look and maybe they will have some advice for you.
相關內容
- 已提問 1 年前
- AWS 官方已更新 7 個月前