Glassfish V4 enabling/connecting jmx for remote access - glassfish

I have gone through lot of blogs etc but could not connect to my glassfish JMX remotely. I have below JVM settings -
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.local.only=false
-Dcom.sun.management.jmxremote.port=8686
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=myremoteip
I am trying to access via console by using below string
service:jmx:rmi://myremoteip:8686/jndi/rmi://myremoteip:8686/jmxrmi
Above setup doesn't work and i am not sure how can i resolve it. Any help will be appreciated.

In addtion to set JVM parameters listed above, in Glassfish Admin Console Configurations -> server-config -> Admin Service have to set:
Address: server's IP address
Security: not checked
Port: 8686
Realm name: admin-realm
If exists, delete JVM setting "-Dcom.sun.management.jmxremote.port=8686", this
causes "Cannot start JMX connector JmxConnector config..." like exception!

It seems that -Dcom.sun.management.jmxremote is not same as glassfish's own JMX server, but starts another JMX server in addition to servers existing one. I have not found any reasonable way to remotely connect to glassfish's own JMX yet.
If you change the -Dcom.sun.management.jmxremote.port to for example 8786 you should be able to connect to the non-glassfish JMX just fine.

Related

ActiveMQ on Windows not enabling JMX

I am using ActiveMQ 5.16.1 on Windows. I set useJmx="true" in the <broker> section of activemq.xml. However, after starting ActiveMQ nothing is listening on the default JMX port 1099, and JConsole does not show ActiveMQ as a target.
I tried explicitly enabling the JMX connector in activemq.xml:
<managementContext>
<managementContext createConnector="true"/>
</managementContext>
However, I get this failure in the ActiveMQ startup console:
WARN | Failed to start JMX connector Port already in use: 1099; nested exception is:
java.net.BindException: Address already in use: JVM_Bind. Will restart management to re-create JMX connector, trying to remedy this issue.
This returns an empty result
netstat -an | grep 1099
JMX is most likely already running via the startup script-- hence the error message. I'm betting the netstat -na is run after the ActiveMQ process has given you the error and the process has already exited.
This is a confusing bit-- that setting in managementContext should be createConnector="false" when using the Apache ActiveMQ build.
Background: ActiveMQ is essentially a library, so it has features to support running in all sorts of different ways. When you start ActiveMQ from the Apache build download, the JMX settings are usually started using -D parameters found in the bin/setenv script. The managementContext setting is to instruct ActiveMQ s embedded in a different runtime/build that does not start JMX itself.

Weblogic NodeManager Start Failure

I've setup a weblogic cluster with 2 managed servers.In order to configure node manager on both nodes i've followed the related article :
http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/wls/12c/12_2_1/01-12-001-ConfiguringandUsingNodeManager/Configuring_and_Using_NM.html
with the following configuration :
Machine-0 :
DomainsFile=/u01/app/oracle/config/domains/base_domain/Machine-
0/nodemanager.domains
LogLimit=0
PropertiesVersion=12.1.3
AuthenticationEnabled=true
NodeManagerHome=/u01/app/oracle/config/domains/base_domain/Machine-0
JavaHome=/opt/jdk1.8.0_131
LogLevel=INFO
DomainsFileEnabled=true
StartScriptName=startWebLogic.sh
ListenAddress=localhost
NativeVersionEnabled=true
ListenPort=5558
LogToStderr=true
SecureListener=false
LogCount=1
StopScriptEnabled=false
QuitEnabled=false
LogAppend=true
StateCheckInterval=500
CrashRecoveryEnabled=false
StartScriptEnabled=true
LogFile=/u01/app/oracle/config/domains/base_domain/Machine-
0/nodemanager.log
LogFormatter=weblogic.nodemanager.server.LogFormatter
ListenBacklog=50
Machine-1 (the second managed server) has the same configuration with the exceptions of ports (5557) and name.
Although node manager is successfully started on both machines (startNodeManager.sh on machine-0 and machine-1) from admin console on Machine-0 the following error occurs and node manager doesnt start :
weblogic.nodemanager.NMConnectException
nodemanager.log of Machine-0 has no indications of errors or any helpful stuff.
Any help would be appreciated.
thanks in advance
These are the things that I usually check when I am setting up a new WebLogic domain:
It is possible that the Listen Address of Machine-1 is not correct. Check the Listen Address of the machine from the WebLogic Domain Configuration. It should match the host's machine name. Using localhost might not work because the Admin Server is trying to connect to the Machine-1, which can be on the other server.
Make sure to check if the port is reachable from the Admin Server's machine.
Check that the Node Manager configuration uses Plain instead of SSL connection, as stated in your nodemanager.properties file. Under Environments > Machines, click the machine and go to Configuration Tab, Node Manager. Check if the Type is Plain and not SSL. Changing this will require a restart of the Admin Server.
Please verify the items below before you start nodemanager.
Check if the nodemanager.domains has your domain name listed.
Try to see if the ports are listening using the commands below.
netstat -an|grep 5557
netstat -an|grep 5558
Also, check if the nodemanager is reachable in weblogic console.

jconsole to connect to apachemq

activemq : apache-activemq-5.14.0
jconsole using jdk1.7
I have started the activemq which comes with the jetty server. Minor change to make the jmx enable is by making change in activemq.xml
managementContext createConnector="true" --- default is false
when i start i am seeing the message
JMX consoles can connect to service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
So I start Jconsole use remote process and use service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
with no password : it says secure/insecure connection failed: not sure where the problem is
Any help is really appreciated
For jmx default credentials are admin:activemq https://github.com/apache/activemq/blob/master/assembly/src/release/conf/jmx.password
The default username/password are: admin/admin

spring xd with rabbit transporter not picking up

I am trying to use rabbit as my transporter in spring-xd. Earlier, I installed redis and configured redis properties in servers.yml and it was working.
Now, I moved to rabbitmq, and installed rabbitmq and able to run the service rabbitmq-server.
I made the following changes in servers.yml
xd:
transport: rabbit
#RabbitMQ properties
spring:
rabbitmq:
host: FQHN
port: 5672
username: guest
password: guest
virtual_host: /
But, when I am starting xd-admin and container, still container taking redis as a transporter.
Redis properties are commented in servers.yml.
Please help me on this.
Thanks,
-Suyodha
I use rabbit transport all the time, with no problems.
First, I suggest you move to the recent 1.0.0.RELEASE. The rabbit host and port are now provided in the addresses property
spring:
rabbitmq:
addresses: FQHN:5672
...
How are you launching the container and admin? Do you have any XD_ environment variables set? Using the supplied scripts, the servers.yml settings will normally override the application.yml. It must be on the classpath. If you can't figure it out, post a DEBUG log of the container startup somewhere (too big for here) with DEBUG enabled for org.springframework.

ActiveMQ console not available

I installed ActiveMQ 5.5.0 on my Windows machine, and it had a web console (http://localhost:8161/admin) working out of the box.
Then I installed ActiveMQ (same version) on a remote Linux box (IP: AAA.BBB.CCC.DDD), but whenever I point the browser to
http://AAA.BBB.CCC.DDD:8161/admin
I get the "Unable to connect" error in the browser.
The network connection is there, I can connect to AAA.BBB.CCC.DDD via ssh and to another web application running on the same server.
Therefore I think that the cause of the problem is wrong configuration of the embedded Jetty server of ActiveMQ.
How can fix the problem, i. e. enable the access to the web console from a remote browser?
In your ActiveMQ config file you should see something like:
<import resource="${activemq.base}/conf/jetty.xml"/>
This starts up an embedded Jetty container with the web console.
If you start the broker on the console, you should see the following if everything works
INFO | ActiveMQ WebConsole initialized.
INFO | Initializing Spring FrameworkServlet 'dispatcher'
INFO | ActiveMQ Console at http://0.0.0.0:8161/admin
into /opt/activemq/apache-activemq-5.16.3/conf
open jetty.xml
change
<property name="host" value="127.0.0.1"/>
to
<property name="host" value="0.0.0.0"/>
restart activemq
I used this approach on a linux server running in VM but can be applied to any instance
Check whether 8161 port is opened for external connection. Also check whether another service creating a conflict.
If there is a conflict
change the jetty port in the {activemqfolder}/conf/jetty.xml.
locate the line that contains the 8161 and change it to the desirable port
To enable external connections to the port (in this instance i choose 8169) use
sudo iptables -I INPUT -p tcp --dport 8169 -j ACCEPT
Proceed to start the activemq ie {activemqfolder}/bin/activemq console to see the messages