【问题标题】:Fuse Fabric: How to delete a configuration PID from a profile?Fuse Fabric:如何从配置文件中删除配置 PID?
【发布时间】:2012-10-28 18:29:42
【问题描述】:

我开始修改个人资料并在此过程中犯了一些错误。

因此,我的个人资料中有 PID,我想将其完全删除。

这些可以在本文底部显示的fabric:profile-display default 输出中看到。

他们是:

http:

patch.repositories=http:

org.ops4j.pax.url.mvn.repositories=http:

我找不到删除它的正确命令。我试过了:

config:delete org.ops4j.pax.url.mvn.repositories=http:

成功完成。但是default 配置文件仍然列出了这个 pid。

我也试过了:

fabric:profile-edit --delete -p org.ops4j.pax.url.mvn.repositories=http: default

失败:

Error executing command: String index out of range: -1

这表示必须指定属性路径/property

简单地附加/ 也不起作用。

另一个问题是我有一个看似空的名称的 pid,如下行所示:

PID: (此输出前缀后没有任何内容)。

fabric:profile-display default的输出:

Profile id: default
Version   : 1.0
Parents   : 
Associated Containers : 

Container settings
----------------------------
Repositories : 
        mvn:org.fusesource.fabric/fuse-fabric/7.0.1.fuse-084/xml/features

Features : 
        fabric-agent
        karaf
        fabric-jaas
        fabric-core

Agent Properties : 
          patch.repositories =  http://repo.fusesource.com/nexus/content/repositories/releases,
                 http://repo.fusesource.com/nexus/content/groups/ea
          org.ops4j.pax.url.mvn.repositories =  http://repo1.maven.org/maven2,
                 http://repo.fusesource.com/nexus/content/repositories/releases,
                 http://repo.fusesource.com/nexus/content/groups/ea,
                 http://repository.springsource.com/maven/bundles/release,
                 http://repository.springsource.com/maven/bundles/external,
                 http://scala-tools.org/repo-releases
          org.ops4j.pax.url.mvn.defaultRepositories =   file:${karaf.home}/${karaf.default.repository}@snapshots,
                file:${karaf.home}/local-repo@snapshots


Configuration details
----------------------------
PID: 


PID: org.ops4j.pax.url.mvn
  org.ops4j.pax.url.mvn.useFallbackRepositories false
  org.ops4j.pax.url.mvn.disableAether true
  org.ops4j.pax.url.mvn.repositories ${profile:org.fusesource.fabric.agent/org.ops4j.pax.url.mvn.repositories}
  org.ops4j.pax.url.mvn.defaultRepositories ${profile:org.fusesource.fabric.agent/org.ops4j.pax.url.mvn.defaultRepositories}


PID: patch.repositories=http:


PID: org.ops4j.pax.url.mvn.repositories=http:


PID: http:


PID: org.fusesource.fabric.zookeeper
  zookeeper.url ${zk:root/ip}:2181

如果有人能指出正确的命令,我将不胜感激。

【问题讨论】:

    标签: persistent ident fusefabric


    【解决方案1】:

    我查看了 fabric:profile-edit--delete 的命令行代码,不幸的是,这个函数似乎是为从 PID 中删除键/值对而设计的,而不是删除 PID 本身。

    (这是github上ProfileEdit.java的代码)

    所以基本上你可以使用该命令“清空”PID,但不能删除它们。

    fabric:profile-edit --delete --pid mypid/mykey=myvalue myprofile
    

    知道这对您没有多大帮助,我问了坐在我旁边(而且比我聪明得多)的同事,他建议如下:

    1. 使用container-add-profile root fmc启用保险丝管理控制台

    2. 在浏览器中运行 fmc(我的位于 localhost 的 8181 端口),转到 Profiles 页面,从列表中选择您的个人资料

    3. 转到Config Files 选项卡,找到您要核对的PID,然后单击叉号(X)。

    瞧,pid 应该消失了。有兴趣知道这是否适合您,包括在“空白”个人资料中...

    【讨论】:

    • 感谢您的回复,vikingsteve。是的,我知道 FMC 路线,但惊讶地发现没有控制台路线可以实现这一目标。希望在 JBoss Fuse 6.1 中提供的新 HawtIO 界面(看起来很棒!)中可以使用相同的控件。已经有一个抢先体验版本,但预计 GA 版本将在 9 月底发布。
    【解决方案2】:

    Fuse 6.2 中的以下工作:

    1) 用于属性文件(成为 PID 对象)

    # create
    profile-edit --resource foobar.properties default
    
    # delete
    profile-edit --delete --pid foobar default
    

    2) 用于任意文件

    # create
    profile-edit --resource foobar.xml default
    
    
    #delete
    only via hawtio web console, see screenshot:
    

    【讨论】:

      猜你喜欢
      • 2014-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-26
      • 2014-08-18
      • 1970-01-01
      相关资源
      最近更新 更多