创建一个卡拉夫的Equinox实例

时间:2014-10-27 02:02:34

标签: apache configuration osgi apache-karaf karaf

我使用Equinox核心运行Karaf 3.0.1。现在我想创建一个也运行Equinox核心的新实例。我试过了:

instance:create test

创建的实例运行Felix核心,因此我尝试更新其配置${karaf.home}/instances/test/etc/config.properties。调整后,每当我尝试连接到此实例时,我都会收到:

karaf@root: instance:connect test
Connecting to host localhost on port 8105
Error executing command: Failed to get the session

我做错了什么?还有另一种方法来创建Equinox核心实例吗?

1 个答案:

答案 0 :(得分:0)

  1. 使用instance:clone而不是instance:create
  2. 确保在创建/克隆实例后启动实例 在尝试连接之前。
  3. karaf@root()> bundle:list -t 0 | grep '^ 0'
     0 | Active   |   0 | 3.8.2.v20130124-134944 | OSGi System Bundle     
    karaf@root()> instance:clone root test
    karaf@root()> instance:list
    SSH Port | RMI Registry | RMI Server | State   | PID   | Name
    -------------------------------------------------------------
        8101 |         1099 |      44444 | Started | 29306 | root
        8101 |         1099 |      44444 | Stopped | 0     | test
    karaf@root()> instance:ssh-port-change test 8102
    karaf@root()> instance:rmi-server-port-change test 44445
    karaf@root()> instance:rmi-registry-port-change test 1100
    karaf@root()> instance:list
    SSH Port | RMI Registry | RMI Server | State   | PID   | Name
    -------------------------------------------------------------
        8101 |         1099 |      44444 | Started | 29306 | root
        8102 |         1100 |      44445 | Stopped | 0     | test
    karaf@root()> instance:start test
    karaf@root()> instance:connect test
    Connecting to host localhost on port 8102
    Connecting to unknown server. Automatically adding to known hosts.
    Storing the server key in known_hosts.
    Password:  *****
    Connected
            __ __                  ____     
           / //_/____ __________ _/ __/     
          / ,<  / __ `/ ___/ __ `/ /_     
         / /| |/ /_/ / /  / /_/ / __/     
        /_/ |_|\__,_/_/   \__,_/_/     
    
      Apache Karaf (3.0.2)
    
    Hit '<tab>' for a list of available commands
    and '[cmd] --help' for help on a specific command.
    Hit 'system:shutdown' to shutdown Karaf.
    Hit '<ctrl-d>' or type 'logout' to disconnect shell from current session.
    
    karaf@test()> bundle:list -t 0 | grep '^ 0'
     0 | Active   |   0 | 3.8.2.v20130124-134944 | OSGi System Bundle     
    karaf@test()>