Apache Karaf User Guide
One installation Karaf
This chapter describes how to install Apache Karaf on the Windows and UNIX platforms, where you will know what software to install beforehand, how to download and install Karaf. Pre-installation Requirements hardware:-20M disk space remaining. Operating system: Windows:windows vista,windows XP sp2,windows2000. -Unix:ubuntu Linux,powerdog Linux,macos,aix,hp-ux,solaris, any Java-enabled Unix platform. Environment: Java SE 1.5x or higher. -the environment variable javahome must be set to the Java runtime's installation directory, such as C:\Program files\java\jdk1.6.026. Press and hold the windows and break keys to switch to advanced options, click Environment Variables, and add the above path to the variable. build from Source
If you want to build Karaf from the source, the requirements will be a bit different: hardware:-200M disk space facilitates Apache Karaf source deployment or SVN validation, and Maven builds and relies on Maven component downloads. Environment: JDK 1.5 or higher. -Apache maven 2.2.1. build on Windows
This procedure explains how to download and install the source files on Windows. Note: Karaf needs to be Java5 compiled, built and run. Enter http://karaf.apache.org/index/community/download.html in the browser. Scroll to the "Apache Karaf" area to select the desired link. The source file name resembles the following: Apache-karaf-x.y-src.zip. Unzip the zip file into the directory of your choice, keeping in mind the limitations of the illegal Java path, for example. ,% and so on. Build Karaf with Maven 2.2.1 or higher java5. Here's how to build Karaf:
Cd [Karaf Installation path]\SRC-MVN
Both of these steps take 10-15 minutes. Using the Zip tool to compress the file, the path to Windows is [Karaf installation path]\assembly\target\apache-karaf-x.y.zip go to start Karaf section on UNIX build
This procedure describes how to download and install source files on UNIX systems. This assumes that there is a browser on the UNIX machine, no browser, refer to the previous binary UNIX installation area. Note: Karaf needs to be Java5 compiled, built and run. Enter http://karaf.apache.org/download.html in the browser. Scroll to the "Apache Karaf" area to select the desired link. The source file name resembles: Apache-karaf-x.y-src.zip. Unzip the zip file into the directory of your choice, for example: Gunzip apache-karaf-x.y-src.tar.gz tar xvf Apache-karaf-x.y-src.tar Keep in mind the limitations of illegal Java paths, such as. ,% etc. building Karaf with MAVEN is recommended as follows: CD [KARAF installation path]\SRC CVN 5. Unzip the file you just created CD [Karaf installation path]/assembly/target gunzip Apache-karaf-x.y.tar.gz tar xvf apache-karaf-x.y.tar go to start Karaf section of the Windows installation process
This explains how to download and install binaries on Windows systems. Enter http://karaf.apache.org/index/community/download.html in the browser. Scroll to the "Apache Karaf" area to select the desired link. The source file name resembles the following: Apache-karaf-x.y-src.zip. Unzip the zip file into the directory of your choice, keeping in mind the limitations of the illegal Java path, for example. ,% and so on. Go to the Start Karaf section Optional: Enable color console output in Windows-tip: If you install Karaf to a very deep path or an illegal Java path. ,% etc., you can create a bat file to execute: subst s: "C:\your very% problematic Path!\karaf" so the path to Karaf is S: such short type. UNIX Installation process
Here is how to download and install binary files on UNIX systems. Enter http://karaf.apache.org/download.html in the browser. Scroll to the "Apache Karaf" area to select the desired link. The source file name is similar to: apache-karaf-x.y.tar.gz unzip the zip file into the directory of your choice, for example: Gunzip apache-karaf-x.y.tar.gz tar xvf apache-karaf-x.y.tar Keep in mind the limitations of illegal Java paths, such as. ,% and so on. Go to the Start Karaf section after installing the steps
Before you start using Karaf, it is strongly recommended that you set java_home that points to the JDK to locate the Java executable and should be configured to point to the installed Java SE5 or 6 root directory. Two directory structure
The Karaf installation directory structure is as follows:/bin: Startup script/etc: Initialize file/data: Working directory/CACHE:OSGI Framework Package cache/generated-bundles: temporary folder used for deployment/log: Log file/deploy: Hot Deployment Directory/instances: Directory with Child instances/lib: Contains the boot library/LIB/EXT:JRE extended directory/lib/endorsed: Endorses the Library directory/system:osgi Package library as a Maven2 repository
The Data folder includes all the work and temporary files of Karaf, and if you want to restart from an initial state, you can clear this directory, which is the same effect as "Restore initialization Settings". three start and stop Karaf
This chapter describes how to start and stop Apache Karaf and the various options available. Start Karaf
Under Windows: Open a console window, change to the installation directory, and run Karaf. For binary files, run the Cd [Karaf installation directory] and enter: Bin\karaf.bat
Linux: Open a console window, change to the installation directory, and run Karaf. Run the Cd [Karaf installation directory] and enter: Bin\karaf warning: Do not close the console after Karaf is running, or the KARAF will be terminated (unless you start karaf with a non-console). non-console boot Karaf
Without a console, you can start Karaf, which can always be accessed with remote SSH, using the following command: Bin\karaf.bat server or UNIX: Bin/karaf server starts in the background Karaf
Use the following command to easily start Karaf:bin\start.bat in a background process or under UNIX: Bin/start reset mode starts Karaf
emptying the [Karaf installation directory]\data folder can be easily started in reset mode Karaf, for convenience, in the Karaf startup script using the following parameters can also be implemented reset start: Bin/start clean stop Karaf
Whether it's Windows or UNIX, you can stop it in the Karaf console using the following command: Osgi:shutdown, or simply: shutdown.
Shutdown command will ask if you really want to stop, if you confirm stop and reject the confirmation information, you can use the-F or-force option: osgi:shutdown–f, can also use time parameters to delay the stop, time parameters have different forms.
First, it can be an absolute time variety of hh:mm. Second, it can also be +m, where M is waiting for the points. Now it's +0.
The following command can be turned off at 10:35am Karaf:
Osgi:shutdown 10:35.
The following command closes the Karaf after 10 minutes:
Osgi:shutdown +10.
If you are running in the main console, you can also terminate the Karaf instance by logging out or ctrl+d the console. In the console you can run the following command:
Bin\stop.bat
or under Unix:
Bin/stop. four using the console to view available commands
Press the prompt key tab to see the list of available commands in the console:
root@root> <tab>display all 182 possibilities? (Y or N) *:help addurl admin:change-opts Admin:change-rmi-registry-por T admin:change-ssh-port admin:connect admin:create Admin:destroy Admin : List admin:rename admin:start admin:stop bundle-level Cancel Cat change-opts Change-rmi-registry-port Change-ssh-port Clear Commandlist Config:cancel Config:edit config:list Config:propappend Config:propdel config:proplist Config:propset config:u Pdate Connect Create Create-dump Destroy Dev:create-dump Dev:dynamic-import Dev:framework Dev:print-stack-traces Dev:restart dev:show-tree dev:watch Display Display-exception Dynamic-import each Echo Edit Exec Exports Features:addurl features:info Features:install features:list features:listrepositories Features:listurl Features : listversions features:refreshurl features:removerepository features:removeurl features:uninstall Framework get grep head headers H ELP History If Imports info Install Jaas:cancel jaas:commandlist jaas:list jaas:manage Jaas:roleadd Jaas:roledel jaas:update Jaas:useradd Jaas:userdel jaas:userlist Java List listrepositories listURL Listversions log:clear log:display log:display-exception log:get Log:set log:tail logout ls m Anage more New Osgi:bundle-level osgi:headers Osgi:info Osgi:install osgi:list Osgi:ls osgi:refr Esh osgi:resolve osgi:restart osgi:shutdown osgi:start OSGi: Start-level osgi:stop osgi:uninstall osgi:update packages:exports p Ackages