[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1971?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15475145#comment-15475145
 ] 

Patrick Hunt commented on ZOOKEEPER-1971:
-----------------------------------------

[~arshad.mohammad] - this looks great, however when I tried it out I ran into 
an issue. Perhaps I'm doing it wrong, can you provide insight?

I added this to zoo.cfg
rmi.registry.port=12101
rmi.connector.port=12102

When I start the zk server I can connect to it just fine using jconsole (this 
is all on localhost, no remote)

However if I run the service with

JMXSSL=true bin/zkServer.sh start

I see the following in the log

{noformat}
2016-09-08 14:51:27,773 [myid:] - INFO  [main:MBeanRegistry@77] - JMX is 
enabled, starting Custom JMX environment.
2016-09-08 14:51:27,774 [myid:] - INFO  [main:JMXEnvService@174] - 
zookeeper.rmi.registry.port configured value is 12101.
2016-09-08 14:51:27,774 [myid:] - INFO  [main:JMXEnvService@174] - 
zookeeper.rmi.connector.port configured value is 12102.
2016-09-08 14:51:27,774 [myid:] - INFO  [main:JMXEnvService@103] - 
rmiSSL:true,authenticate:false,passwordFile:null,accessFile:null
2016-09-08 14:51:27,952 [myid:] - INFO  [main:JMXEnvService@79] - 
service:jmx:rmi://127.0.0.1:12102/jndi/rmi://127.0.0.1:12101/jmxrmi
2016-09-08 14:51:28,133 [myid:] - ERROR [main:MBeanRegistry@84] - Failed to 
start the custom JMX environment.
java.io.IOException: Cannot bind to URL [rmi://127.0.0.1:12101/jmxrmi]: 
javax.naming.CommunicationException [Root exception is 
java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
        at 
javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:827)
        at 
javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:432)
        at 
org.apache.zookeeper.jmx.JMXEnvService.startConnectorServer(JMXEnvService.java:149)
        at org.apache.zookeeper.jmx.JMXEnvService.start(JMXEnvService.java:162)
        at org.apache.zookeeper.jmx.MBeanRegistry.<init>(MBeanRegistry.java:80)
        at 
org.apache.zookeeper.jmx.MBeanRegistry.<clinit>(MBeanRegistry.java:48)
        at 
org.apache.zookeeper.server.ZooKeeperServer.registerJMX(ZooKeeperServer.java:417)
        at 
org.apache.zookeeper.server.ZooKeeperServer.startup(ZooKeeperServer.java:450)
        at 
org.apache.zookeeper.server.NIOServerCnxnFactory.startup(NIOServerCnxnFactory.java:765)
        at 
org.apache.zookeeper.server.ServerCnxnFactory.startup(ServerCnxnFactory.java:98)
        at 
org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:140)
        at 
org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:104)
        at 
org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:62)
        at 
org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:125)
        at 
org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
Caused by: javax.naming.CommunicationException [Root exception is 
java.rmi.ConnectIOException: non-JRMP server at remote endpoint]
        at 
com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:147)
        at 
com.sun.jndi.toolkit.url.GenericURLContext.bind(GenericURLContext.java:228)
        at javax.naming.InitialContext.bind(InitialContext.java:425)
        at 
javax.management.remote.rmi.RMIConnectorServer.bind(RMIConnectorServer.java:644)
        at 
javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:427)
        ... 13 more
Caused by: java.rmi.ConnectIOException: non-JRMP server at remote endpoint
        at 
sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:248)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
        at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:342)
        at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
        at 
com.sun.jndi.rmi.registry.RegistryContext.bind(RegistryContext.java:141)
        ... 17 more
2016-09-08 14:51:28,139 [myid:] - INFO  [main:ContainerManager@64] - Using 
checkIntervalMs=60000 maxPerMinute=10000
{noformat}


Note that I am on a mac using

java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)


> Make JMX remote monitoring port configurable
> --------------------------------------------
>
>                 Key: ZOOKEEPER-1971
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1971
>             Project: ZooKeeper
>          Issue Type: Improvement
>          Components: server
>    Affects Versions: 3.5.0
>         Environment: All
>            Reporter: Biju Nair
>            Assignee: Arshad Mohammad
>             Fix For: 3.5.3, 3.6.0
>
>         Attachments: ZOOKEEPER-1971-01.patch, zookeeperAdmin.pdf, 
> zookeeperJMX.pdf
>
>
> This is a follow-up item from ZOOKEEPER-1948.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to