Posts

Showing posts from 2012

Create custom log4j appender for Karaf and Pax Logging

Karaf leverages Pax Logging for the logging layer. Pax Logging provides an abstraction service for most popular logging frameworks, like SLF4J, Log4j, commons-logging, etc. Karaf provides a default logging configuration in etc/org.ops4j.pax.logging.cfg file. By default, all INFO log messages (rootLogger) are send into a file appender (in data/log/karaf.log). The file appender “maintains” one file of 1MB, and store up to 10 backup files. Adding a new appender configuration, example with Syslog appender We can add new appender configuration in the Karaf logging module. For instance, we can add a syslog appender in etc/org.ops4j.pax.logging.cfg: log4j.rootLogger = INFO, out, syslog, osgi:* ... # Syslog appender log4j.appender.syslog=org.apache.log4j.net.SyslogAppender log4j.appender.syslog.layout=org.apache.log4j.PatternLayout log4j.appender.syslog.layout.ConversionPattern=[%p] %c:%L - %m%n log4j.appender.syslog.syslogHost=localhost log4J.appender.syslog.facility=KARAF log4j.appender.sysl

How to enable HTTPS certificate client auth with Karaf

I received many times messages from users asking how we can “trust” HTTP clients in Karaf. The purpose is to exchange certificates and allow only “trusted” clients to use the Karaf HTTP service. Enable HTTP client auth First of all, we have to enable the HTTP client auth support in Karaf. When you install the HTTP feature, Karaf leverages Pax-Web to provide HTTP OSGi service: karaf@root> features:install http Now, we have to add a custom etc/org.ops4j.pax.web.cfg file: org.osgi.service.http.port=8181 org.osgi.service.http.port.secure=8443 org.osgi.service.http.secure.enabled=true org.ops4j.pax.web.ssl.keystore=./etc/keystores/keystore.jks org.ops4j.pax.web.ssl.password=password org.ops4j.pax.web.ssl.keypassword=password #org.ops4j.pax.web.ssl.clientauthwanted=false org.ops4j.pax.web.ssl.clientauthneeded=true NB: clientauthwanted and clientauthneeded properties are valid for Karaf 2.2.x which use Pax Web 1.0.x. Thanks to the clientauthneeded property, we “force” the client to be trus

Apache Karaf Cellar 2.2.5 released !

During the ApacheCon EU , I made a demo of Karaf and Cellar all together. During this demo, I used Cellar 2.2.5-SNAPSHOT. Now, Cellar 2.2.5 is released ! But, what’s new in this version ? Groups are now persistent In Cellar 2.2.4, the empty groups disappear after a restart. You created a new cluster group without any member (empty group) with: karaf@root> cluster:group-create foobar karaf@root> cluster:group-list|grep -i foobar foobar [] If you restart Cellar (or Karaf), the empty groups were lost: karaf@root> cluster:group-list|grep -i foobar To avoid this, in Cellar 2.2.5, the cluster groups are now persistent on each node. We introduced a new groups property in etc/org.apache.karaf.cellar.groups.cfg to store the list of groups. Cellar now reads this property as startup to populate the cluster groups not present on the cluster. On the other hand, the groups property in etc/org.apache.karaf.cellar.node.cfg defines the group membership of the local node. If you restart Kar

Apache Karaf 2.3.0 released !

Waiting for Karaf 3.0.0, we worked hard in the Karaf team to provide Apache Karaf 2.3.0. The Karaf 2.2.x branch is now only in maintenance mode: it means that no new features will be implemented in this branch, only major bug fixes. The new “stable” branch is now Karaf 2.3.x which is a perfect transition branch between Karaf 2.2.x (heavely used) and the future Karaf 3.x (which should arrive very soon). What’s new in this 2.3.0 release: * OSGi r4.3 : Karaf 2.2.x branch was powered by OSGi frameworks implementing OSGi r4.2 norm. Karaf 2.3.0 is now powered by the new OSGi r4.3 framework (Apache Felix 4.0.3 and Equinox 3.8.x), for both OSGi core and compendium. It provides new features like weaving, etc. * Aries Blueprint 1.0.x : Karaf 2.3.0 uses the new Aries Blueprint version at different level (core, JMX, etc). * Update to ASM 4.0 : in order to work with Aries proxies, we updated to new ASM bundle. We also provided configuration that allows you to enable/disable weaving. * OSGi Regions

Apache Karaf 2.2.9

The Apache Karaf team is proud to announce a new version on the Karaf 2.2.x branch. The 2.2.9 version is a major bug fixes release. We fixed 52 issues in this release, and we are inline with our release cycle (around every 2 months). Especially, it includes: Work with the latest JRE/JDK 1.6.0 and 1.7.0 updates : some changes in the Java Virtual Machine resulted to issues in previous Karaf releases. It’s now fixed in Karaf 2.2.9, allowing Karaf to work with Java 1.6.0_33 or 34 for instance, but fixed in Karaf itself and an upgrade to Aries Proxy 0.3.1. New OSGi frameworks : this release upgrade to the latest minor versions of the OSGi frameworks, especially Apache Felix Framework 3.2.2. Dependencies minor version updates : in order to fix several minor issues, some dependencies have been upgraded (javax.mail 1.4.5, ServiceMix bundles, etc). Stopping the shell console doesn’t stop the OSGi framework : previously, when you stopped the Karaf shell console bundle, it also stopped the OSGi f

Dell Vostro with Ubuntu: use the AMD Catalyst drivers

I have a Dell Vostro 3550 with Ubuntu 12.04 since around one year now. The laptop worked fine, it was pretty fast, building a lot of projects in the same time, etc. I complained with: the temperature was really hot (sensors said between 80°C and 95°C all of the time). Sometime, the temperature was critical and the system shutted down. due to the previous point, the fan was very noisy the battery autonomy was average This laptop use dual graphic cards: Intel SGI graphic card (to reduce energy consumption), and AMD Radeon HD 6600M (for 3D enhanced graphics and HD videos). When I got this laptop, I tried to install the fglrx open source drivers a couple of times. Without success: it seems that the Radeon card was not fully supported. As the laptop ran really fine (unity was fast, vlc was able to read HD videos without problem, etc), I stayed with the Intel Xorg driver. Yesterday evening, watching a movie, the laptop was so hot that I have to use a pillow to avoid to burn my legs 😉 So tod

Change tab font in Eclipse Juno

If you tried Eclipse Juno, you may see that the tab fonts are “large”. The “Package Explorer” and “Outlet” tab font take a lot of space. If you take a look in the preferences, in the appearance section, you won’t find anything related to these tabs. The good news is that Eclipse use CSS for the main style, and you can edit these CSS. If you take a look in ECLIPSE_HOME/plugins/org.eclipse.platform_4.2.0.v201206081400/css , you will find the different CSS used. On Linux, if you use the GTK style (in the Preferences/Appearances), the e4_default_gtk.css is used. Edit this file and change the .MPartStack section : .MPartStack { font-size: 9; font-family: "Droid Sans"; swt-simple: false; swt-mru-visible: false; }

Losing wireless connection on Ubuntu

Sometime, depending of the wireless access point used, my wireless connection looks stuck on my Ubuntu (11.10 or 12.04): nothing special on the network icon, but no more connection, no ping, etc. The problem comes from the the 11n support which is not well supported. The workaround is to turn off the 11n support. To do so, edit /etc/modprobe.d/iwlwifi.conf and add: options iwlwifi 11n_disable=1 It works like a charm.

Apache Karaf Cellar 2.2.4

Apache Karaf Cellar 2.2.4 has been released. This release is a major release, including a bunch of bug fixes and new features. Here’s the list of key things included in this release. Consistent behavior Cellar is composed by two parts: the distributed resources which is a datagrid maintained by each cluster nodes and containing the current cluster status (for instance of the bundles, features, etc) the cluster event which is broadcasted from a node to the others Cluster shell commands, cluster MBeans, synchronizers (called at startup) and listeners (called when a local event is fired, such as feature installed) update the distributed resource and broadcast cluster events. To broadcast cluster events, we use an event producer. The cluster event is consommed by a consumer which delegates the handling of the cluster event to a handler. We have a handler for feature, bundle, etc. Now, all Cellar “producers” do: check if the cluster event producer is ON check if the resource is allowed, che

Apache Karaf Cellar and central management

Introduction One of the first purpose of Apache Karaf Cellar is to synchronize the state of each Karaf instances in the Cellar cluster. It means that any change performed on one node (install a feature, start a bundle, add a config, etc) generates a “cluster event” which is broadcasted by Cellar to all others nodes. The target node handles the “cluster event” and performed the corresponding action (install a feature, start a bundle, add a config, etc). By default, the nodes have the same role. It means that you can perform actions on any node. But, you may prefer to have one node dedicated to the management. It’s what we name “central management”. Central management With central management, one node is identified by the manager. It means that cluster actions will be performed only on this node. The manager is the only one which is able to produce cluster event. The managed nodes are only able to receive and handle events, not to produce. With this approach, you can give access (for ins

Communication between two remote Camel routes using Karaf Cellar

Apache Karaf Cellar 2.2.3 Around one week ago, we released Karaf Cellar 2.2.3. In addition of the first Distributed OSGi support (DOSGi, I already wrote blog ), an interesting feature of Cellar 2.2.3 is to give access the whole Hazelcast configuration. The etc/hazelcast.xml is the core configuration of the Hazelcast instance, started by the Cellar feature. Cellar registers the Hazelcast instance as an OSGi service. It means that we can use the Hazelcast instance just using a reference to the corresponding OSGi service. We are going to use the Hazelcast OSGi service in a Camel route defined using blueprint DSL (it works using Spring DSL as well). Apache Camel 2.9.0 and the Hazelcast component Camel 2.9.0 provides a new component: camel-hazelcast. This component allows to send (as a producer/to) or receive (as a consumer/from) a Camel exchange through a Hazelcast distributed queue. The first route timerToQueue fires a message every 5 seconds, and send to a Hazelcast distributed queue.

Ubuntu boot hang up with kernel 3.0.0-15 and lvm2

Today, I updated my Ubuntu box and a new kernel has been installed (3.0.0-15 x86_64). At boot, my system hangs up just after the /scripts/init-bottom phase. I tried with kernel 3.0.0-14, the behavior is the same. The latest working kernel was 3.0.0-13. After digging, it’s when the init-bottom performs vgchange -a y . The problem is that the script is waiting for the udev device, and starting from kernel 3.0.0-14, it doesn’t work and we raise the timeout. So it means that the startup is not totally stuck, it just takes long long long time 😉 The workaround is to disable the udev support during LVM2 vgchange. To do that, edit the /lib/udev/rules.d/85-lvm2.rules and add the --noudevsync option to vgchange: SUBSYSTEM=="block", ACTION=="add|change", ENV{ID_FS_TYPE}=="lvm*|LVM*", \ RUN+="watershed sh -c '/sbin/lvm vgscan; /sbin/lvm vgchange --noudevsync -a y'" We have to update the initramfs: update-initramfs -u -k all

Apache Karaf 2011 Millesime

We are preparing the new Karaf “Cuvée” 2012, with the main new release Karaf 3.0. Karaf 2011 is a good millésime with the following activity: New sub-projects: 3 (Cellar, Cave, WebConsole) Number of commits: 1,851 Number of releases: 11 Number of messages on the forums/mailing lists: 3119 Number of direct downloads: 44,829 Number of tickets open/resolved: 782/577 Karaf active team: 12 A good millésime for sure. Now, it’s time to focus on the 2012 vendange 😉 Thanks for the Karaf users and the wonderful Karaf team 😉