问题
I'm looking for a way to deploy multiple JRuby apps on a single server, the apps are in different stages and hence use different versions of JRuby, in the long term it would be pretty complicated to try and sync all of the applications with all of the application servers, so I'm looking something akin to Phusion Passenger 4 in the Javaland.
Apparently Passenger allows something like this, but there's no documentation available how such a setup should work. Torquebox doesn't mention this use case in their docs.
Bonus points for:
- solutions that allow
git pull
deployment - solutions that are
rvm
friendly - solutions that are not Tomcat based
- solutions that are clustering friendly
- solutions that handle daemonization, routing, resource management and monitoring on their own
- solutions that are mature and actively supported
So far everything I've looked at failed on some of the points, torquebox doesn't seem to support multiple jruby versions, trinidad is tomcat, puma requires some of hand-holding (process monitoring, reverse proxy, ....) etc
回答1:
probably your best choice would be to do it the "Java-way" using https://github.com/jruby/warbler
you'll end up with a .war that packs the JRuby's jars in the archive thus each app will have it's own version of JRuby. this of course requires you to setup a Java application server (such as Tomcat), the deployment process would usually mean copying the packaged .war into the server's deployment folder.
be aware that this will likely require a lot of memory since none of the libraries JRuby uses will be shared (also with some servers you need to make sure the class-loader does look at the war's jars first during a specific deployment configuration option)
回答2:
In the end I opted for a reverse proxy + puma + a process monitoring tool, but it feels like this must be simpler somehow - without three distinct pieces of software working together to make it happen.
Pros are that it's rvm compatible, can support multiple rubies through multiple puma processes and allows git pull deployments
There's also jetpack as an alternative, but I haven't had a chance to play with it
来源:https://stackoverflow.com/questions/26585102/jruby-deployment-options-that-support-multiple-versions-of-jruby