If I have multiple IP addresses on my server and would like to assign each spark app to a different IP address/host, how is this done?
There is a method in the Spark Service
class (javadoc) that sets the IP address that your Spark server listens on.
public Service ipAddress(String ipAddress)
Set the IP address that Spark should listen on. If not called the default address is '0.0.0.0'. This has to be called before any route mapping is done.
If you wanted these apps to run in the same JVM, it looks like you do this by instantiating multiple Service
onjects. The javadoc says:
Service
represents a Spark server "session". If a user wants multiple 'Sparks' in his application the methodignite()
should be statically imported and used to create instances.