I want to monitor my ESB using Jconsole and JMX. I can connect to JMX server from the localhost but for connecting from remote machine to my esb I can establish the connection.
I use WSO2 ESB 4.6 and this my JMX configuration in carbon.xml file.
<JMX>
<!--The port RMI registry is exposed-->
<RMIRegistryPort>9999</RMIRegistryPort>
<!--The port RMI server should be exposed-->
<RMIServerPort>11111</RMIServerPort>
</JMX>
I found the problem, my rmi service was running on the host ip which was "127.0.0.1". To connect remotely to the jvm I had to bind the external ip to the hostname. To do this in unix systems use command hostname to get the name of the hostname. Then check the ip that is assigned to the hostname, to find out this use ping $(hostname) you will see that system is pinging the hosname's ip.
If your host ip was the default 127.0.0.1 and you wanted to change it, just edit the file /etc/hosts as superuser. After rebooting the rmi service, you can reach it from the remote machine.
Have a look at wso2carbon.log, you will find an entry like INFO {org.wso2.carbon.core.init.JMXServerManager} - JMX Service URL : service:jmx:rmi://localhost:11111/jndi/rmi://localhost:9999/jmxrmi {org.wso2.carbon.core.init.JMXServerManager}
Use given URL to connect to the carbon server from a remote JMX client (JVisualVM for example) and don't forget to define security credentials (default Username / Password is admin / admin)
Related
The kafka virual machine address in the Google cloud platform is xx.xx.xxx.xxx.
From my local spring boot app that usually connects to the localhost:9092 of the local machine's kafka server, I changed it to the GCP's virtual machine's ip as xx.xx.xxx.xxx:9092
But the server start up spits out the warning
2020-04-05 15:30:41.356 WARN 7968 --- [| adminclient-4] org.apache.kafka.clients.NetworkClient : [AdminClient clientId=adminclient-4] Connection to node -1 could not be established. Broker may not be available.
and eventually times out. Should there be a different way to connect to cloud kafka from springboot application?
You need to configure your broker on the GCP VM with a correct advertised.listener so that your client receives a correct hostname/IP from it after the initial successful connection.
You can validate the connection and broker metadata provided by the advertised.listeners setting using kafkacat -L
$ kafkacat -b xx.xx.xxx.xxx:9092 -L
Metadata for all topics (from broker -1: xx.xx.xxx.xxx:9092/bootstrap):
1 brokers:
broker 0 at a.b.c.d:9092
The a.b.c.d. returned should be an IP or hostname that your client can successfully resolve to the broker itself (not a loopback address, internal network IP, etc).
To understand more see https://rmoff.net/2018/08/02/kafka-listeners-explained/
The following properties are added
advertised.host.name in server.properties to public IP address,
metadata.broker.list in producer.properties to public IP address,
host.name to 0.0.0.0.
These property files will be inside config folder. A restart is necessary.
And it solved the problem. For broker/bootstrap.sever, the public IP address is used in the application after adding the above mentioned properties.
I deployed application on Google Compute Engine. My VM has an internal IP and an external IP.
I am running my application with Jolokia:
java -javaagent:jolokia-jvm-1.6.0-agent.jar=host=0.0.0.0 -jar openmzn-processor-0.0.1-SNAPSHOT.jar
I> No access restrictor found, access to any MBean is allowed
Jolokia: Agent started with URL http://xxx.xxx.xxx.xxx(internal IP):8778/jolokia
....
I loaded hawtio server and tried connecting jolokia server.
Connection Information on QHawtio Console.
- Name: XXXX
- Scheme: http
- Host: External IP
- Port: 8778
- Path: /jolokia
When I tested connection, howtio application cannot access to jolokia.
How can I access jolokia application from my hawtio console?
Hawtio console has two type connection that is remote and discovery. Remote connection need to configure server information. In this case, I think that hawtio doesn't know internal ip address. Another connection is discovery. This connection find jolokia server automatically. First step, your interanl server information have to be identified through discovery function. And connection information by using discovery is shown on remote connection tab.
I hosted a Python/Flask web service on my Amazon (AWS) EC2 instance. modified the security group rules such that All inbound traffic is allowed.
I can login from ssh and ping(with public ip) is working fine but I couldn't open the service URL from the web browser. Could any one please suggest how can I debug this issue?
Thanks,
It seems that web service isn't up and running or it is not listening on right port or it is listening just on 127.0.0.1 address. Check it with 'sudo netstat -tnlp' command. You should see process name, what IP and port it is listening on.
I'm trying to install a WSO2 EMM server on Amazon EC2 Instance, but have a problem with it. EC2 instance have 2 IP addresses - one of them is internal Amazon address like 172.32.x.x, another is external real IP.
If I try to setup carbon.xml file with real IP (or domain), I have a problem with thrift server, which can't open port 10500 at a real IP. If I use internal IP running of server is fine, but in application I can't reach identity server (because it's a gray IP, of course).
I tried some tricks with using /etc/hosts file, for example, setup 0.0.0.0 as my domain. In this case server is running without errors, and a can see that port 10500 is open using netstat, but web application is not redirect to identity server.
May be there are any solutions of this problem?
I have to update EMM server to version 1.1.0 and all is working now.
Thanks all!
In the carbon.xml, change the HostName and MgtHostName to the real IP and start the server.
For example if the real IP is 172.32.x.x then HostName and MgtHostName in the carbon.xml should change to:
<HostName>172.32.x.x</HostName>
<MgtHostName>172.32.x.x</MgtHostName>
I have installed the api manager on a windows server 2008. The server has a LAN-IP and a Public-IP over NAT.
Example:
LAN-IP: 192.168.100.1
Public-IP over NAT: 10.0.0.10
I want to test the API Manager over the Public-IP, but the Server works only local with the LAN-IP. Has someone an idea, how can I get the api manager to work over the Public-IP? The Ports are open on the firewall.
THX
Please try out with the following configurations. Note to restart the server once done.
Set the HostName and MgtHostName in <%APIM_HOME%>/repository/conf/carbon.xml to the public IP address.
Set the bind-address parameter of the http and https s found in the <%APIM_HOME%>/repository/conf/axis2/axis2.xml file to the public IP.
Set the as below in the <%APIM_HOME$>/repository/conf/api-manager.xml file.
http://<-- Public-IP -- >:${http.nio.port},https://<-- Public-IP -- >:${https.nio.port}
Thanks,
Nuwan.