Karaf
  1. Karaf
  2. KARAF-1405

Can not update properties of configuraton using cluster command 'cluster:config-propset'

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: cellar-2.2.3
    • Fix Version/s: cellar-3.0.0, cellar-2.2.4
    • Component/s: cellar-config
    • Labels:
      None
    • Environment:

      Karaf-2.2.7-SNAPSHOT from 20120426

      Description

      1.Start three Karaf and install cellar on three karaf
      now there are three node(node1,node2 and node3) on default group
      2.using default properties of org.apache.karaf.cellar.groups.cfg for these three karaf

      default.config.whitelist.inbound=*
      default.config.whitelist.outbound=*
      default.config.blacklist.inbound=org.apache.cxf.dosgi.discovery.zookeeper.server,org.apache.karaf.cellar.groups,org.apache.karaf.cellar.instance,org.apache.karaf.cellar.node,org.apache.karaf.management,org.ops4j.pax.web,org.talend.esb.locator,org.apache.karaf.shell,org.talend.remote.jobserver.server
      default.config.blacklist.outbound=org.apache.cxf.dosgi.discovery.zookeeper.server,org.apache.karaf.cellar.groups,org.apache.karaf.cellar.instance,org.apache.karaf.cellar.node,org.apache.karaf.management,org.ops4j.pax.web,org.talend.esb.locator,org.apache.karaf.shell,org.talend.remote.jobserver.server
      default.config.sync=true

      default.features.whitelist.inbound=*
      default.features.whitelist.outbound=*
      default.features.blacklist.inbound=cellar,jetty,http,tesb-locator-client,tesb-sam-server,tesb-derby-starter
      default.features.blacklist.outbound=cellar,jetty,http,tesb-locator-client,tesb-sam-server,tesb-derby-starter
      default.features.sync=true
      default.features.repositories.sync=true

      3.on node1,update one property to 'false' by excute cluster commands

      karaf@trun> cluster:config-propset default org.apache.karaf.cellar.groups default.features.sync false
      karaf@trun> cluster:config-proplist default org.apache.karaf.cellar.groups
      Property list for configuration PID org.apache.karaf.cellar.groups for group default
      Key Value
      default.features.sync false

      4.go to etc folder,open file 'org.apache.karaf.cellar.groups.cfg' of node1,the property is not updated.the properties still:

      default.features.sync=true

      5.open file 'org.apache.karaf.cellar.groups.cfg' of node2 and node3,the property are also not updated.the properties still:

      default.features.sync=true

      for file 'org.apache.karaf.cellar.groups.cfg' of three nodes,now expect seeing the updated property:'default.features.sync=false'

        Activity

        Hide
        Xiaoli Ding added a comment -

        yes,in the config:list,the felix.fileinstall.filename property is not present

        Show
        Xiaoli Ding added a comment - yes,in the config:list,the felix.fileinstall.filename property is not present
        Hide
        Jean-Baptiste Onofré added a comment -

        Could you check in the config:list if the felix.fileinstall.filename property is present ?

        I bet not

        Show
        Jean-Baptiste Onofré added a comment - Could you check in the config:list if the felix.fileinstall.filename property is present ? I bet not
        Hide
        Xiaoli Ding added a comment -

        yes,i tried again with 2.2.7 karaf,and see the updated blacklist,

        karaf@root> cluster:config-propset default org.apache.karaf.cellar.groups default.features.sync false
        karaf@root> cluster:config-proplist default org.apache.karaf.cellar.groups
        default.features.sync false
        karaf@root> config:list "(service.pid=org.apache.karaf.cellar.groups)"
        default.features.sync = false

        but in the cfg file:
        default.features.sync=true

        Show
        Xiaoli Ding added a comment - yes,i tried again with 2.2.7 karaf,and see the updated blacklist, karaf@root> cluster:config-propset default org.apache.karaf.cellar.groups default.features.sync false karaf@root> cluster:config-proplist default org.apache.karaf.cellar.groups default.features.sync false karaf@root> config:list "(service.pid=org.apache.karaf.cellar.groups)" default.features.sync = false but in the cfg file: default.features.sync=true
        Hide
        Jean-Baptiste Onofré added a comment -

        You have to update the blacklist. FYI, by default in cellar, org.apache.karaf.cellar.groups is not blacklisted.

        Show
        Jean-Baptiste Onofré added a comment - You have to update the blacklist. FYI, by default in cellar, org.apache.karaf.cellar.groups is not blacklisted.
        Hide
        Jean-Baptiste Onofré added a comment -

        Yes, it's normal, I added the check

        Show
        Jean-Baptiste Onofré added a comment - Yes, it's normal, I added the check
        Hide
        Xiaoli Ding added a comment -

        now i can not excute config-propset on config whick in blacklist

        karaf@trun> config-propset default org.apache.karaf.cellar.groups default.features.sync false
        Configuration PID org.apache.karaf.cellar.groups is blocked outbound

        Show
        Xiaoli Ding added a comment - now i can not excute config-propset on config whick in blacklist karaf@trun> config-propset default org.apache.karaf.cellar.groups default.features.sync false Configuration PID org.apache.karaf.cellar.groups is blocked outbound
        Hide
        Jean-Baptiste Onofré added a comment - - edited

        I tested with Karaf 2.2.7:

        • on node1:

        karaf@root> config:list "(service.pid=org.apache.karaf.cellar.groups)"
        default.features.sync = true
        karaf@root> cluster:config-proplist default org.apache.karaf.cellar.groups
        default.features.sync true
        karaf@root> cluster:config-propset default org.apache.karaf.cellar.groups default.features.sync false
        karaf@root> cluster:config-proplist default org.apache.karaf.cellar.groups
        default.features.sync false
        karaf@root> config:list "(service.pid=org.apache.karaf.cellar.groups)"
        default.features.sync = false

        and in the cfg file:

        fgrep default.features.sync org.apache.karaf.cellar.groups.cfg
        default.features.sync=true

        The problem is that the felix.fileinstall.filename property is filtered and has been lost during sync, that's why fileinstall is not able to flush the change on the cfg file.

        I check to "maintain"/"not override" locally the excluded properties.

        Show
        Jean-Baptiste Onofré added a comment - - edited I tested with Karaf 2.2.7: on node1: karaf@root> config:list "(service.pid=org.apache.karaf.cellar.groups)" default.features.sync = true karaf@root> cluster:config-proplist default org.apache.karaf.cellar.groups default.features.sync true karaf@root> cluster:config-propset default org.apache.karaf.cellar.groups default.features.sync false karaf@root> cluster:config-proplist default org.apache.karaf.cellar.groups default.features.sync false karaf@root> config:list "(service.pid=org.apache.karaf.cellar.groups)" default.features.sync = false and in the cfg file: fgrep default.features.sync org.apache.karaf.cellar.groups.cfg default.features.sync=true The problem is that the felix.fileinstall.filename property is filtered and has been lost during sync, that's why fileinstall is not able to flush the change on the cfg file. I check to "maintain"/"not override" locally the excluded properties.
        Hide
        Jean-Baptiste Onofré added a comment -

        I gonna try to reproduce but it worked for me. Could you check the content with config:list ?

        Show
        Jean-Baptiste Onofré added a comment - I gonna try to reproduce but it worked for me. Could you check the content with config:list ?
        Hide
        Xiaoli Ding added a comment -

        karaf@trun> cluster:config-propset default org.talend.esb.job.client logging true
        karaf@trun> cluster:config-proplist default org.talend.esb.job.client
        Property list for configuration PID org.talend.esb.job.client for group default
        Key Value
        ws-security.signature.properties file:F:\370\node1\container/etc/keystores/clientKeystore.properties
        karaf.cellar.sync 1337050461218
        logging true
        https.config file:F:\370\node1\container/etc/org.talend.esb.job.client.https.xml
        service.pid org.talend.esb.job.client
        ws-security.signature.password ckpass
        ws-security.signature.username myclientkey

        but when i checked in the etc/org.talend.esb.job.client file, the value of logging did not change,still false.

        Show
        Xiaoli Ding added a comment - karaf@trun> cluster:config-propset default org.talend.esb.job.client logging true karaf@trun> cluster:config-proplist default org.talend.esb.job.client Property list for configuration PID org.talend.esb.job.client for group default Key Value ws-security.signature.properties file:F:\370\node1\container/etc/keystores/clientKeystore.properties karaf.cellar.sync 1337050461218 logging true https.config file:F:\370\node1\container/etc/org.talend.esb.job.client.https.xml service.pid org.talend.esb.job.client ws-security.signature.password ckpass ws-security.signature.username myclientkey but when i checked in the etc/org.talend.esb.job.client file, the value of logging did not change,still false.
        Hide
        Jean-Baptiste Onofré added a comment -

        WARNING, I updated the default blacklist/whitelist set on config:

        default.config.whitelist.inbound=*
        default.config.whitelist.outbound=*
        default.config.blacklist.inbound=org.apache.karaf.cellar.node, \
        org.apache.karaf.management, \
        org.apache.karaf.shell, \
        org.ops4j.pax.logging
        default.config.blacklist.outbound=org.apache.karaf.cellar.node, \
        org.apache.karaf.management, \
        org.apache.karaf.shell, \
        org.ops4j.pax.logging

        So org.apache.karaf.cellar.group is not blacklisted.

        Show
        Jean-Baptiste Onofré added a comment - WARNING, I updated the default blacklist/whitelist set on config: default.config.whitelist.inbound=* default.config.whitelist.outbound=* default.config.blacklist.inbound=org.apache.karaf.cellar.node, \ org.apache.karaf.management, \ org.apache.karaf.shell, \ org.ops4j.pax.logging default.config.blacklist.outbound=org.apache.karaf.cellar.node, \ org.apache.karaf.management, \ org.apache.karaf.shell, \ org.ops4j.pax.logging So org.apache.karaf.cellar.group is not blacklisted.
        Hide
        Jean-Baptiste Onofré added a comment -

        Yes, but previously (in the latest SNAPSHOT), the cluster:* commands and MBeans did check if a PID was allowed outbound (only the handler inbound).

        I made the fix today, I'm deploying a new SNAPSHOT.

        Show
        Jean-Baptiste Onofré added a comment - Yes, but previously (in the latest SNAPSHOT), the cluster:* commands and MBeans did check if a PID was allowed outbound (only the handler inbound). I made the fix today, I'm deploying a new SNAPSHOT.
        Hide
        Georg-Victor Voutsinos added a comment -

        org.apache.karaf.cellar.groups is blacklisted. Based on this configuration it can't be synced.

        Show
        Georg-Victor Voutsinos added a comment - org.apache.karaf.cellar.groups is blacklisted. Based on this configuration it can't be synced.
        Hide
        Jean-Baptiste Onofré added a comment -

        karaf@root> config:list "(service.pid=org.apache.karaf.cellar.groups)"
        ----------------------------------------------------------------
        Pid: org.apache.karaf.cellar.groups
        BundleLocation: mvn:com.hazelcast/hazelcast/1.9.4.8
        Properties:
        ...
        default.features.sync = true
        ...
        karaf@root> cluster:config-propset default org.apache.karaf.cellar.groups default.features.sync false
        karaf@root> cluster:config-proplist default org.apache.karaf.cellar.groups
        Property list for configuration PID org.apache.karaf.cellar.groups for group default
        Key Value
        default.features.sync false
        ...
        karaf@root> config:list "(service.pid=org.apache.karaf.cellar.groups)"
        ----------------------------------------------------------------
        Pid: org.apache.karaf.cellar.groups
        BundleLocation: mvn:com.hazelcast/hazelcast/1.9.4.8
        Properties:
        ...
        default.features.sync = false
        ...

        I checked in the etc/org.apache.karaf.cellar.groups.cfg file, the value changed as well.

        Don't use a Karaf 2.2.6 version ?

        Show
        Jean-Baptiste Onofré added a comment - karaf@root> config:list "(service.pid=org.apache.karaf.cellar.groups)" ---------------------------------------------------------------- Pid: org.apache.karaf.cellar.groups BundleLocation: mvn:com.hazelcast/hazelcast/1.9.4.8 Properties: ... default.features.sync = true ... karaf@root> cluster:config-propset default org.apache.karaf.cellar.groups default.features.sync false karaf@root> cluster:config-proplist default org.apache.karaf.cellar.groups Property list for configuration PID org.apache.karaf.cellar.groups for group default Key Value default.features.sync false ... karaf@root> config:list "(service.pid=org.apache.karaf.cellar.groups)" ---------------------------------------------------------------- Pid: org.apache.karaf.cellar.groups BundleLocation: mvn:com.hazelcast/hazelcast/1.9.4.8 Properties: ... default.features.sync = false ... I checked in the etc/org.apache.karaf.cellar.groups.cfg file, the value changed as well. Don't use a Karaf 2.2.6 version ?
        Hide
        Jean-Baptiste Onofré added a comment -

        Let me check. I made the test before (maybe it's not the updated SNAPSHOT).

        Show
        Jean-Baptiste Onofré added a comment - Let me check. I made the test before (maybe it's not the updated SNAPSHOT).
        Hide
        Xiaoli Ding added a comment -

        on node1,after excute:

        karaf@trun> cluster:config-propset default org.apache.karaf.cellar.groups default.features.sync false

        then go to etc folder,open file 'org.apache.karaf.cellar.groups.cfg' of node1,the property is not updated.the properties still:

        default.features.sync=true

        Show
        Xiaoli Ding added a comment - on node1,after excute: karaf@trun> cluster:config-propset default org.apache.karaf.cellar.groups default.features.sync false then go to etc folder,open file 'org.apache.karaf.cellar.groups.cfg' of node1,the property is not updated.the properties still: default.features.sync=true
        Hide
        Jean-Baptiste Onofré added a comment -

        OK found the issue. There is a method to check if the distributed configuration differs from the local one, but it doesn't detect the change.

        More other the filtered properties don't make sense. I try to remove both.

        Show
        Jean-Baptiste Onofré added a comment - OK found the issue. There is a method to check if the distributed configuration differs from the local one, but it doesn't detect the change. More other the filtered properties don't make sense. I try to remove both.
        Hide
        Jean-Baptiste Onofré added a comment -

        New pid are correctly added into the local config admin instance, but the existing one are not updated.

        Show
        Jean-Baptiste Onofré added a comment - New pid are correctly added into the local config admin instance, but the existing one are not updated.
        Hide
        Jean-Baptiste Onofré added a comment -

        OK, the cluster event is not sent by the commands (using an event producer). I fix that.

        Show
        Jean-Baptiste Onofré added a comment - OK, the cluster event is not sent by the commands (using an event producer). I fix that.
        Hide
        Jean-Baptiste Onofré added a comment -

        I reproduced the issue even locally. The config distributed map is updated, but the synchronizer doesn't update the local config layer.

        I'm digging.

        Show
        Jean-Baptiste Onofré added a comment - I reproduced the issue even locally. The config distributed map is updated, but the synchronizer doesn't update the local config layer. I'm digging.

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Xiaoli Ding
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development