Force Glassfish to bind to a network interface - glassfish

We are using Glassfish on multi homed servers and I would like to force Glassfish just to use one interface.
I updated domain.xml by
substituting every occurrence of 0.0.0.0 by the IP address
everywhere a port was mentioned without an address address=<IP> was added
every host=localhost was substituted with host=<IP>
After starting Glassfish several listeners are still listening on every available IP address:
3820: I tried to specify an address but the option is ignored
<iiop-listener port="3820" id="SSL" address="<IP>" security-enabled="true">
3920: same as above
<iiop-listener port="3920" id="SSL_MUTUALAUTH" address="127.0.0.1" security-enabled="true">
has no effect
7776: no idea
The next listeners use some dynamically generated ports
53491
53495
53496
53497
Now my question:
is there a way to make sure Glassfish will be using one and just one network interface?
if this cannot be achieved with Glassfish is there a way on a Linux system to trick an application to see only one interface?

Related

Is there a way to specify port range for SSLSocketFactory and SSLServerSocketFactory

I am configuring jacorb to use with SSL. The server/client ports picked are random. I need to specify a range of ports much like PortRangeSocketFactory/PortRangeServerSocketFactory in case of non-SSL configuration.
I am trying to avoid OASSLPort property, as the port becomes fixed (instead of range) and applicable for only server/listening ports. Client ports will still be random.
I have a set of processes, some acting as both server and client- with jacorb.properties shared.
Current jacorb.properties configuration:
jacorb.ssl.socket_factory=org.jacorb.security.ssl.sun_jsse.SSLSocketFactory
jacorb.ssl.server_socket_factory=org.jacorb.security.ssl.sun_jsse.SSLServerSocketFactory
I am using Jacorb 3.9, RHEL 7.3 and Java 1.8.0_171.
Achieved this by writing custom factories:
PortRangeSSLServerSocketFactory extending and composing jsse SSLServerSocketFactory class.
configure() overridden to also read the min/max port config from jacorb.properties.
createServerSocket() overridden to handle port selection. Logic imported from org.jacorb.orb.factory.PortRangeServerSocketFactory.
PortRangeSSLSocketFactory extending AbstractSocketFactory. SSL logic imported from org.jacorb.security.ssl.sun_jsse.SSLSocketFactory and port range selection logic imported from org.jacorb.orb.factory.PortRangeSocketFactory.
Handled multi-homed cases for both via the OAIAddr property.
Pros: Lot of customization possible.
Cons: Minimal code usage as many attributes and methods whose logic was implemented were private.

SUMO Address Error

I'm running multiple SUMO simulations in parallel using TraCI.
Every so often one will fail with the message
Error: tcpip::Socket::accept() Unable to create listening socket: Address already in use
Quitting (on error).
I haven't found anyway to set the address to use on the configuration list at http://sumo.dlr.de/wiki/SUMO
I figure if I can set each instances address manually I should be able to avoid this.
The answer is right on the page you mention. The option --remote-port specifies the port number, so something like
sumo --remote-port 54323 -c my.sumocfg
should do the trick. Of course you need to give the same port when connecting from your traci client.

Mule ESB: Is it possible to start 2 instances of the Mule ESB

I created two sepaerate directories in which I installed the Standalone Mule ESB server:
/ee/mmc-distribution-mule-console-bundle-3.5.2-HF1
/ee2/mmc-distribution-mule-console-bundle-3.5.2-HF1
I start up the first server, and below is the status:
[root#x240perf2 mmc-distribution-mule-console-bundle-3.5.2-HF1]# ./status.sh
MMC is running as PID=1998.
Mule Enterprise Edition is running as PID=2619.
Then I try to start the second instance:
[root#x240perf2 mmc-distribution-mule-console-bundle-3.5.2-HF1]# ./startup.sh
Port 8585 is in use, please make it available and try again.
So apparently the port 8585 is being used by the original instnace
So I stop the first instnace, and start the second istance, which comes up successfully, as follows:
./startup.sh
Please enter the desired port for Mule [Default 7777]:
Starting MMC, please wait...
class com.sun.jersey.multipart.impl.MultiPartConfigProvider
class com.sun.jersey.multipart.impl.MultiPartReader
class com.sun.jersey.multipart.impl.MultiPartWriter
[11-13 16:49:19] WARN HttpSessionSecurityContextRepository [http-bio-8585-exec-1]: Failed to create a session, as response has been committed. Unable to store SecurityContext.
[11-13 16:49:32] WARN HttpMethodBase [http-bio-8585-exec-12]: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
[11-13 16:49:38] WARN HttpSessionSecurityContextRepository [http-bio-8585-exec-12]: Failed to create a session, as response has been committed. Unable to store SecurityContext.
Nov 13, 2014 4:49:50 PM org.apache.catalina.core.StandardServer await
INFO: A valid shutdown command was received via the shutdown port. Stopping the Server instance.
Nov 13, 2014 4:49:50 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8585"]
But notice it seems to be using 8585 for tomcat (of which I know little about, except it some sort of app server, never used it)
I examined this site:
http://www.mulesoft.org/documentation/display/33X/Running+Multiple+Mule+Instances
but it does nto discuss the issue., and the page it points do does not seem current. Did I misunderstand something
Is it possible to run two separate instances of Mule ESB at the same time
and if so, how ? (how would I change the port its using, what file should I modify)
Thanks
Edit: my second post in response to answer:
(BTW: I am using Mule ESB standalone Enterprise Edition 3.5.2)
To make sure I did not have any apps that were running
on port 8585, I shutdown my original instance, and created two new instances, and made sure no apps were deployed to either instance.
I brought up the first instance without issue, but the second instance I brought up still gives me the port 8585 in use error (from startup.sh)
This site says that the MMC default port is 7777, but the tomcat default port on which it runs is 8585
http://www.mulesoft.org/documentation/display/current/Setting+Up+MMC-Mule+ESB+Communications
I used the following command to find all files within my second instance of por t 8585
find . -type f |xargs grep "8585
Other than log files I got two hits
startup.sh
and
/mmc-3.5.2-HF1/apache-tomcat-7.0.52/conf/server.xml
I did NOT find in either instance the $MULE_HOME/apps/mmc/mule-config.xml (probably because I have no apps deployed)
In the server.xml, the MMC apparently uses tomcat to
handle the MMC applicaiton, and server.xml contains
the following:
<Connector port="8585" protocol="HTTP/1.1"
So I guess I could change 8585 to 8586 at this point, but ...
The startup.sh has serveral (about 9 or 10) hardcode dreferences to 8585 to check that the MMC is running and take action if it is or is not running
So do I actually have to change the entire startup.sh to replace 8585 with 8586 i the second instance as well as change the server.xml port 8585 reference ?
Thanks
You can run as many instances as you want, as long they don't use the same ports. Looks like you are deploying something in port 8585, so in the second instance you have to select a different port.
Is that port being used in any application that you developed and deployed in the Mule runtime?
Also, if you are using the Mule runtime with the MMC agent activated, you also have to change the port for the agent in the second instance. I think you can do that in the /conf/wrapper.conf or by passing to the startup script the following parameter:
-Dmule.mmc.bind.port=7778
(or any port that is free).
You can run as many as you want.
In MMC we can able to deploy and run many applications each applications has its own instance

how to make sur that Jboss is well installed and configured?

I m using eclipse indigo and i installed the Jboss Server earlier.i though that every thing is fine;
But when i make a right clik on a JSP page for exemple ,there is no "Deploy" ,and if i what to deploy the whole project..the same thing i can't do it because the is no "Deploy" option.
iand if i ighone all that and do a "Run As" --> "Run on a server" i get a http 404 error saying the requested ressource is not available.
i have Jboss in my eclipse ,is there any why to know that Jboss is well insatlled??
Thank you
The easiest way to check whether JBoss 7 is running is to access native management interface.
Usually it's bound to 9999 port.
In order to verify the port look for port attribute of management native interface socket binding in standalone.xml (standalone-full.xml or whatever configuration you are using)
For localhost it would be:
http://localhost:9999
Another way to check JBoss 7 status is to use management console.
Usually it's bound to 9990 port.
In order to verify the port look for port attribute of management HTTP interface socket binding in standalone.xml (standalone-full.xml or whatever configuration you are using).
For localhost it would be:
http://localhost:9999
Additionally, you can check the so called marker files.
Just go to deployments directory and look for .deployed file (if the file exists it means that your application is successfully deployed).
You can read more about deployment descriptors at:
https://docs.jboss.org/author/display/AS7/Application+deployment

Naming a JMX connection when using --openjmx

I am using the Java Visual VM command line to open remote JMX connections. I use it like this:
jvisualvm.exe --userdir "user-config" --openjmx hostname:port
This works perfectly fine. But the connection name in the view shows as hostname:port. Is there any way I can pass a logical name to this connection? I can rename the connection from the view, but it doesn't stick when I reopen. I have about 10 connections from the same hostname, so wanted to logically separate out the individual connections.
Any ideas? It would even work if can just have the names stick in the user-config.
You can start your application with -Dvisualvm.display.name="Your_name" and your application will be named "Your_name" in VisualVM. See this and this feature requests for details. Note that you have to use VisualVM 1.3.4+ or Java VisualVM from JDK 7 Update 6 or newer.