8 Replies Latest reply on Jul 27, 2012 1:34 PM by sandeep16

    Unable to set resolver policy for ensemble/zookeeper/root container

    sandeep16

      Whenever I try to update resolver policy of root/ensemble container, I see below error:

       

      use-061 | Error while restarting:

      java.lang.NumberFormatException: For input string: "root"

              at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)[:1.6.0_24]

              at java.lang.Integer.parseInt(Integer.java:481)[:1.6.0_24]

              at java.lang.Integer.parseInt(Integer.java:514)[:1.6.0_24]

              at org.apache.zookeeper.client.ConnectStringParser.(ZooKeeper.java:375)[45:org.fusesource.fabric.fabric-linkedin-zookeeper:7.0.0.fuse-061]

              at org.linkedin.zookeeper.client.ZooKeeperFactory.createZooKeeper(ZooKeeperFactory.java:62)[45:org.fusesource.fabric.fabric-linkedin-zookeeper:7.0.0.fuse-061]

              at org.fusesource.fabric.zookeeper.internal.OsgiZkClient.start(OsgiZkClient.java:390)[42:org.fusesource.fabric.fabric-zookeeper:7.0.0.fuse-061]

              at org.fusesource.fabric.zookeeper.internal.OsgiZkClient.tryStart(OsgiZkClient.java:375)[42:org.fusesource.fabric.fabric-zookeeper:7.0.0.fuse-061]

              at org.fusesource.fabric.zookeeper.internal.OsgiZkClient.updated(OsgiZkClient.java:366)[42:org.fusesource.fabric.fabric-zookeeper:7.0.0.fuse-061]

              at org.apache.felix.cm.impl.ConfigurationManager$1.call(ConfigurationManager.java:1756)[5:org.apache.felix.configadmin:1.3.0.fuse-7-061]

              at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.6.0_24]

              at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.6.0_24]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.6.0_24]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.6.0_24]

              at java.lang.Thread.run(Thread.java:679)[:1.6.0_24]

       

      Same error is thrown when FMC is used to update.

        • 1. Re: Unable to set resolver policy for ensemble/zookeeper/root container
          stlewis

          I'm not 100% sure how you'd get to this state as I can't reproduce it locally, but it sounds like there's an error in the variable substitution that's happening under the covers when fabric attempts to swap out what string is using for the ZK connection string.  To trouble-shoot, run:

           

          features:install fabric-zookeeper-commands

           

          or add the "fabric-zookeeper-commands" feature to a profile and you can investigate the zookeeper tree directly.  The relevant section of the tree is fabric/registry/containers/config, you can have a look at it via:

           

          zk:list -r -d | grep registry/containers/config

           

          For example here is an ensemble server I'm testing with:

           

          fabric/registry/containers/config/FuseManagementConsole/ip = $

          fabric/registry/containers/config/FuseManagementConsole/jmx = service:jmx:rmi://$:44495/jndi/rmi://$:1150/karaf-FuseManagementConsole

          fabric/registry/containers/config/FuseManagementConsole/localhostname = pluckypro

          fabric/registry/containers/config/FuseManagementConsole/localip = 192.168.1.12

          fabric/registry/containers/config/FuseManagementConsole/publichostname = gashcrumb.homelinux.org

          fabric/registry/containers/config/FuseManagementConsole/resolver = publichostname

          fabric/registry/containers/config/FuseManagementConsole/ssh = $:8101

          fabric/registry/containers/config/FuseManagementConsole

           

          Was actually running into an issue earlier today where the ZK hostname advertised isn't correct, so I explicitly set it:

           

          zk:set fabric/registry/containers/config/FuseManagementConsole/ip 75.67.101.236

           

          normally this should point to the "resolver" item, which would then point to the correct IP address/hostname.

          • 2. Re: Unable to set resolver policy for ensemble/zookeeper/root container
            sandeep16

            Below is what I am seeing which looks like kind of saame as yours for ZK hostname..

            do I need to modify this like you did?

             

            fabric/registry/containers/config/FuseManagementConsole/ip = $

            fabric/registry/containers/config/FuseManagementConsole/jmx = service:jmx:rmi://$:44495/jndi/rmi://$:1150/karaf-FuseManagementConsole

            fabric/registry/containers/config/FuseManagementConsole/localhostname =

            fabric/registry/containers/config/FuseManagementConsole/localip =

            fabric/registry/containers/config/FuseManagementConsole/resolver = localhostname

            fabric/registry/containers/config/FuseManagementConsole/ssh = $:8101

            fabric/registry/containers/config/FuseManagementConsole

            fabric/registry/containers/config/cumulus_mq/ip = $

            fabric/registry/containers/config/cumulus_mq/jmx = service:jmx:rmi://$:44444/jndi/rmi://$:1099/karaf-cumulus_mq

            fabric/registry/containers/config/cumulus_mq/localhostname =

            fabric/registry/containers/config/cumulus_mq/localip =

             

             

            I puposely removed other IP addresses now..

            • 3. Re: Unable to set resolver policy for ensemble/zookeeper/root container
              stlewis

              That all looks okay as far as I can see.  Can you check the "default" profile and make sure zookeeper.url looks right?  Should be something like:

               

              zookeeper.url=$:2181

               

              with no extra characters in the setting, the code would be trying to parse this URL and getting that NumberFormatException.

              • 4. Re: Unable to set resolver policy for ensemble/zookeeper/root container
                iocanel

                How exactly do you change the resolver for the ensemble server?

                 

                Can you please provide the commands/steps you are using and maybe an attachment of your logs?

                • 5. Re: Unable to set resolver policy for ensemble/zookeeper/root container
                  sandeep16

                  below is what I see in default profile:

                  PID: org.fusesource.fabric.zookeeper

                    zookeeper.url $:2181

                   

                  I think it looks good to me.

                   

                  I tried two approaches to to change resolver of ensemble server:

                  a) from FMC, just tried to edit it.

                  b) from command prompt.

                   

                  Well, I updated the IP address using zk:set command, and it seems I am able to deploy bundle from fuse IDE.

                  Below are the logs again when I try to change the resolver policy from localhost to publichost:

                  use-061 | Error while restarting:

                  java.lang.NumberFormatException: For input string: "root"

                  at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65):1.6.0_24

                  at java.lang.Integer.parseInt(Integer.java:481):1.6.0_24

                  at java.lang.Integer.parseInt(Integer.java:514):1.6.0_24

                  at org.apache.zookeeper.client.ConnectStringParser.(ZooKeeper.java:375)45:org.fusesource.fabric.fabric-linkedin-zookeeper:7.0.0.fuse-061

                  at org.linkedin.zookeeper.client.ZooKeeperFactory.createZooKeeper(ZooKeeperFactory.java:62)45:org.fusesource.fabric.fabric-linkedin-zookeeper:7.0.0.fuse-061

                  at org.fusesource.fabric.zookeeper.internal.OsgiZkClient.start(OsgiZkClient.java:390)42:org.fusesource.fabric.fabric-zookeeper:7.0.0.fuse-061

                  at org.fusesource.fabric.zookeeper.internal.OsgiZkClient.tryStart(OsgiZkClient.java:375)42:org.fusesource.fabric.fabric-zookeeper:7.0.0.fuse-061

                  at org.fusesource.fabric.zookeeper.internal.OsgiZkClient.updated(OsgiZkClient.java:366)42:org.fusesource.fabric.fabric-zookeeper:7.0.0.fuse-061

                  at org.apache.felix.cm.impl.ConfigurationManager$1.call(ConfigurationManager.java:1756)5:org.apache.felix.configadmin:1.3.0.fuse-7-061

                  at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334):1.6.0_24

                  at java.util.concurrent.FutureTask.run(FutureTask.java:166):1.6.0_24

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110):1.6.0_24

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603):1.6.0_24

                  at java.lang.Thread.run(Thread.java:679):1.6.0_24

                  • 6. Re: Unable to set resolver policy for ensemble/zookeeper/root container
                    stlewis

                    Be best if you could attach the full log file from data/log/karaf.log, as I think we're not getting a clear picture of how your setup has gotten into this state.

                     

                    Might be worth also doing a quick test with a newly created fabric just to verify if the behavior occurs in a new environment or if some change introduces the problem, I'm suspecting the latter as I'm not able to reproduce the problem in-house.

                    • 7. Re: Unable to set resolver policy for ensemble/zookeeper/root container
                      iocanel

                      I think that the main problem is that you are switching to a special kind of resolver.

                      The publichostname isn't known by Fabric, unless you manually specify it or unless you are creating containers to some public cloud.

                       

                      Edited by: iocanel on Jul 25, 2012 8:38 PM

                      • 8. Re: Unable to set resolver policy for ensemble/zookeeper/root container
                        sandeep16

                        I am not sure what you mean be special kind of resolver.

                        But let me explain it again:

                         

                        a) When I create new fabric from FMC inn amazon cloud, the fabric server is created with it.

                         

                        c) This fabric server has resolver policy of localhostname by default.

                         

                        d) Since I need to access this fabric server from my IDE too, I want to change the resolver policy to publichostname. For this I first went to publichostname or publicIP, and edit the field in FMC with the right value as it exists in cloud.

                         

                        e) As soon as I am done with it, I see the above mentioned error message in the log and my entitr fabric becomes non-usable.

                         

                        f) I cannot deploy bundles to cloud from fuse IDE if resolver poilcy is set to localhost

                         

                        g) As a workwround what I did was to manually update the IP address usinng the following command:

                         

                        zk:set fabric/registry/containers/config/FuseManagementConsole/ip

                         

                         

                         

                        h) As soon as I execute above command,IDE starts deploying bundles successfully. But after a while it gets set to original value:

                         

                        fabric/registry/containers/config/FuseManagementConsole/ip = $

                         

                        It seems to me this is definitely a problem....