Question

I am currently trying to deploy smartfoxserver 2X on EC2 using dotcloud. I have been able to detect the private ip of the amazon web instance, and using the dotcloud tools I have been able to determine the correct port. However, I have difficulty installing the server proper via the command line so that I can log into it using the AdminTool.

My postinstall is fairly straightforward:

./SFS2X/sfs2x-service start-launchd

I find that on 'dotcloud push' there is a fair amount of promising output in my cygwin terminal, but the push hangs after saying that the sfs2x-service has been launched correctly, until timeout.

Consequently, my question is, has anyone found a way to install SFS2X on EC2 via dotcloud successfully? I managed to have partial success with SFS Pro, with a complete push to dotcloud, by calling ./jre/bin/java -jar installer.jar in my postinstall. Do I need to do extra legwork and build an installer jar for SFS2X? Is there a way that would be best to do this?

I do understand that there is a standard approach to deployment with SFS2X using RightScale on EC2, however I am interested in deployment using the dotcloud platform.

Thanks in advance.

Was it helpful?

Solution

The reason why it is hanging is because you are trying to start your process in the postinstall, and this is not the correct place to do that. The postinstall script is suppose to finish, if it doesn't the deployment will time out, and then get cancelled.

Once the postinstall script is finished, it will then finish the rest of your deployment.

See this page for more information about dotCloud postinstall script: http://docs.dotcloud.com/0.9/guides/hooks/#post-install

Pay attention to this warning at the end.

Warning: If your post-install script returns an error (non-zero exit code), or if it runs for more than 10 minutes, the platform will consider that your build has failed, and the new version of your code will not be deployed.

Instead of putting this in the postinstall script, you should add it as a background process, so that it starts up once the deployment process is complete.

See this page for more information on adding background processes to dotCloud services:

http://docs.dotcloud.com/0.9/guides/daemons/

TL;DR: You need to create a supervisord.conf file, and add it to the root of your project, and add your service to that.

Example (you will need to change to fit your situation):

[program:smartfoxserver]
command = /home/dotcloud/current/SFS2X/sfs2x-service start-launchd

Also, make sure you have the correct dotCloud service specified in your dotcloud.yml in order to have the correct binary and libraries installed for what your smartfoxserver application.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top