You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Yang <te...@gmail.com> on 2012/08/27 23:44:05 UTC

JMX(RMI) dynamic port allocation problem still exists?

in my previous job we ran across the issue that JMX allocates ports for RMI
dynamically, so that
nodetool does not work if our env is in EC2, and all the ports have to be
specifically opened, and
we can't open a range of ports, but only specific ports.

at the time, we followed this:

https://blogs.oracle.com/jmxetc/entry/connecting_through_firewall_using_jmx


to create a small javaagent jar for cassandra startup, so that we use a
fixed RMI port.



now, does Cassandra come with an out-of-the box solution to fix the above
problem? or do I have
to create that little javaagent jar myself?

Thanks
Yang

Re: JMX(RMI) dynamic port allocation problem still exists?

Posted by Yang <te...@gmail.com>.
nice, thanks guys!

On Tue, Aug 28, 2012 at 11:58 PM, Senthilvel Rangaswamy <
senthilvel@gmail.com> wrote:

> We use Jolokia. Its pretty awesome.
>
>
> On Tue, Aug 28, 2012 at 11:44 PM, Peter Schuller <
> peter.schuller@infidyne.com> wrote:
>
>> I can recommend Jolokia highly for providing an HTTP/JSON interface to
>> JMX (it can be trivially run in agent mode by just altering JVM args):
>>
>> http://www.jolokia.org/
>>
>> --
>> / Peter Schuller (@scode, http://worldmodscode.wordpress.com)
>>
>
>
>
> --
> ..Senthil
>
> "If there's anything more important than my ego around, I want it
>  caught and shot now."
>                                                     - Douglas Adams.
>
>

Re: JMX(RMI) dynamic port allocation problem still exists?

Posted by Senthilvel Rangaswamy <se...@gmail.com>.
We use Jolokia. Its pretty awesome.

On Tue, Aug 28, 2012 at 11:44 PM, Peter Schuller <
peter.schuller@infidyne.com> wrote:

> I can recommend Jolokia highly for providing an HTTP/JSON interface to
> JMX (it can be trivially run in agent mode by just altering JVM args):
>
> http://www.jolokia.org/
>
> --
> / Peter Schuller (@scode, http://worldmodscode.wordpress.com)
>



-- 
..Senthil

"If there's anything more important than my ego around, I want it
 caught and shot now."
                                                    - Douglas Adams.

Re: JMX(RMI) dynamic port allocation problem still exists?

Posted by Peter Schuller <pe...@infidyne.com>.
I can recommend Jolokia highly for providing an HTTP/JSON interface to
JMX (it can be trivially run in agent mode by just altering JVM args):

http://www.jolokia.org/

-- 
/ Peter Schuller (@scode, http://worldmodscode.wordpress.com)

Re: JMX(RMI) dynamic port allocation problem still exists?

Posted by Jim Cistaro <jc...@netflix.com>.
You may already be aware, but another possible solution is to use MX4J to do your JMX over REST (I have not tried this myself yet).

http://wiki.apache.org/cassandra/Operations#Monitoring_with_MX4J

From: Yang <te...@gmail.com>>
Reply-To: <us...@cassandra.apache.org>>
Date: Tue, 28 Aug 2012 07:55:00 -0700
To: <us...@cassandra.apache.org>>
Subject: Re: JMX(RMI) dynamic port allocation problem still exists?

Thanks Nick.

it would be nice to pack such work-arounds together with Cassandra, and enable it with a command line arg in the start up script,  so that the end-user has a more
smooth usage experience ----- we did spend some time before to debug the ports issues, and find a trick for that.
I imagine a lot of users will have to go through the same process since "closing all ports" is the default EC2 network security policy for most companies. Or at least add a link for the fix in the installation wikis such as http://www.datastax.com/docs/1.1/install/install_ami<https://webmail.iac.com/owa/redir.aspx?C=PLVE6taKpU--Dxw69WVEOtdUcArCWM8IUH6LBjdXcM7STlqwkARq8mA8Nva_mtGaSKmmva4pWxE.&URL=http%3a%2f%2fwww.datastax.com%2fdocs%2f1.1%2finstall%2finstall_ami>



Yang

On Mon, Aug 27, 2012 at 9:03 PM, Nick Bailey <ni...@datastax.com>> wrote:
The problem still exists. There was a discussion about resolving
inside cassandra here:

https://issues.apache.org/jira/browse/CASSANDRA-2967

But the ultimate resolution was that since workarounds like the one
you mentioned exist it would be left as is for now.

On Mon, Aug 27, 2012 at 6:07 PM, Yang <te...@gmail.com>> wrote:
> no, the priblem is that jmx listens on 7199, once an incoming connection is
> made, it literally tells the other side "come and connect to me on these 2
> rmi ports",  and open up  2 random  Rmi ports
>
> we used to use the trick in the above link to resolve this
>
> On Aug 27, 2012 3:04 PM, "Hiller, Dean" <De...@nrel.gov>> wrote:
>>
>> In cassandra-env.sh, search on JMX_PORT and it is set to 7199 (ie. Fixed)
>> so that solves your issue, correct?
>>
>> Dean
>>
>> From: Yang <te...@gmail.com>>>
>> Reply-To: "user@cassandra.apache.org<ma...@cassandra.apache.org>>"
>> <us...@cassandra.apache.org>>>
>> Date: Monday, August 27, 2012 3:44 PM
>> To: "user@cassandra.apache.org<ma...@cassandra.apache.org>>"
>> <us...@cassandra.apache.org>>>
>> Subject: JMX(RMI) dynamic port allocation problem still exists?
>>
>> ow, does Cassandra come with an out-of-the box solution to fix the above
>> problem? or do I have
>> to create that little javaagent jar myself?


Re: JMX(RMI) dynamic port allocation problem still exists?

Posted by Yang <te...@gmail.com>.
Thanks Nick.

it would be nice to pack such work-arounds together with Cassandra, and
enable it with a command line arg in the start up script,  so that the
end-user has a more
smooth usage experience ----- we did spend some time before to debug the
ports issues, and find a trick for that.
I imagine a lot of users will have to go through the same process since
"closing all ports" is the default EC2 network security policy for most
companies. Or at least add a link for the fix in the installation wikis
such as http://www.datastax.com/docs/1.1/install/install_ami<https://webmail.iac.com/owa/redir.aspx?C=PLVE6taKpU--Dxw69WVEOtdUcArCWM8IUH6LBjdXcM7STlqwkARq8mA8Nva_mtGaSKmmva4pWxE.&URL=http%3a%2f%2fwww.datastax.com%2fdocs%2f1.1%2finstall%2finstall_ami>



Yang

On Mon, Aug 27, 2012 at 9:03 PM, Nick Bailey <ni...@datastax.com> wrote:

> The problem still exists. There was a discussion about resolving
> inside cassandra here:
>
> https://issues.apache.org/jira/browse/CASSANDRA-2967
>
> But the ultimate resolution was that since workarounds like the one
> you mentioned exist it would be left as is for now.
>
> On Mon, Aug 27, 2012 at 6:07 PM, Yang <te...@gmail.com> wrote:
> > no, the priblem is that jmx listens on 7199, once an incoming connection
> is
> > made, it literally tells the other side "come and connect to me on these
> 2
> > rmi ports",  and open up  2 random  Rmi ports
> >
> > we used to use the trick in the above link to resolve this
> >
> > On Aug 27, 2012 3:04 PM, "Hiller, Dean" <De...@nrel.gov> wrote:
> >>
> >> In cassandra-env.sh, search on JMX_PORT and it is set to 7199 (ie.
> Fixed)
> >> so that solves your issue, correct?
> >>
> >> Dean
> >>
> >> From: Yang <te...@gmail.com>>
> >> Reply-To: "user@cassandra.apache.org<ma...@cassandra.apache.org>"
> >> <us...@cassandra.apache.org>>
> >> Date: Monday, August 27, 2012 3:44 PM
> >> To: "user@cassandra.apache.org<ma...@cassandra.apache.org>"
> >> <us...@cassandra.apache.org>>
> >> Subject: JMX(RMI) dynamic port allocation problem still exists?
> >>
> >> ow, does Cassandra come with an out-of-the box solution to fix the above
> >> problem? or do I have
> >> to create that little javaagent jar myself?
>

Re: JMX(RMI) dynamic port allocation problem still exists?

Posted by Nick Bailey <ni...@datastax.com>.
The problem still exists. There was a discussion about resolving
inside cassandra here:

https://issues.apache.org/jira/browse/CASSANDRA-2967

But the ultimate resolution was that since workarounds like the one
you mentioned exist it would be left as is for now.

On Mon, Aug 27, 2012 at 6:07 PM, Yang <te...@gmail.com> wrote:
> no, the priblem is that jmx listens on 7199, once an incoming connection is
> made, it literally tells the other side "come and connect to me on these 2
> rmi ports",  and open up  2 random  Rmi ports
>
> we used to use the trick in the above link to resolve this
>
> On Aug 27, 2012 3:04 PM, "Hiller, Dean" <De...@nrel.gov> wrote:
>>
>> In cassandra-env.sh, search on JMX_PORT and it is set to 7199 (ie. Fixed)
>> so that solves your issue, correct?
>>
>> Dean
>>
>> From: Yang <te...@gmail.com>>
>> Reply-To: "user@cassandra.apache.org<ma...@cassandra.apache.org>"
>> <us...@cassandra.apache.org>>
>> Date: Monday, August 27, 2012 3:44 PM
>> To: "user@cassandra.apache.org<ma...@cassandra.apache.org>"
>> <us...@cassandra.apache.org>>
>> Subject: JMX(RMI) dynamic port allocation problem still exists?
>>
>> ow, does Cassandra come with an out-of-the box solution to fix the above
>> problem? or do I have
>> to create that little javaagent jar myself?

Re: JMX(RMI) dynamic port allocation problem still exists?

Posted by Yang <te...@gmail.com>.
no, the priblem is that jmx listens on 7199, once an incoming connection is
made, it literally tells the other side "come and connect to me on these 2
rmi ports",  and open up  2 random  Rmi ports

we used to use the trick in the above link to resolve this
On Aug 27, 2012 3:04 PM, "Hiller, Dean" <De...@nrel.gov> wrote:

> In cassandra-env.sh, search on JMX_PORT and it is set to 7199 (ie. Fixed)
> so that solves your issue, correct?
>
> Dean
>
> From: Yang <te...@gmail.com>>
> Reply-To: "user@cassandra.apache.org<ma...@cassandra.apache.org>" <
> user@cassandra.apache.org<ma...@cassandra.apache.org>>
> Date: Monday, August 27, 2012 3:44 PM
> To: "user@cassandra.apache.org<ma...@cassandra.apache.org>" <
> user@cassandra.apache.org<ma...@cassandra.apache.org>>
> Subject: JMX(RMI) dynamic port allocation problem still exists?
>
> ow, does Cassandra come with an out-of-the box solution to fix the above
> problem? or do I have
> to create that little javaagent jar myself?
>

Re: JMX(RMI) dynamic port allocation problem still exists?

Posted by "Hiller, Dean" <De...@nrel.gov>.
In cassandra-env.sh, search on JMX_PORT and it is set to 7199 (ie. Fixed) so that solves your issue, correct?

Dean

From: Yang <te...@gmail.com>>
Reply-To: "user@cassandra.apache.org<ma...@cassandra.apache.org>" <us...@cassandra.apache.org>>
Date: Monday, August 27, 2012 3:44 PM
To: "user@cassandra.apache.org<ma...@cassandra.apache.org>" <us...@cassandra.apache.org>>
Subject: JMX(RMI) dynamic port allocation problem still exists?

ow, does Cassandra come with an out-of-the box solution to fix the above problem? or do I have
to create that little javaagent jar myself?