Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 20B0D200BF0 for ; Thu, 15 Dec 2016 10:07:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1FA5D160B10; Thu, 15 Dec 2016 09:07:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 49CF3160B0B for ; Thu, 15 Dec 2016 10:06:59 +0100 (CET) Received: (qmail 17009 invoked by uid 500); 15 Dec 2016 09:06:53 -0000 Mailing-List: contact user-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@karaf.apache.org Delivered-To: mailing list user@karaf.apache.org Received: (qmail 16999 invoked by uid 99); 15 Dec 2016 09:06:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 15 Dec 2016 09:06:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id EF43D1A063B for ; Thu, 15 Dec 2016 09:06:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.544 X-Spam-Level: * X-Spam-Status: No, score=1.544 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id tKSAz4KbGZn3 for ; Thu, 15 Dec 2016 09:06:50 +0000 (UTC) Received: from mail-wj0-f178.google.com (mail-wj0-f178.google.com [209.85.210.178]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 47C075FB5D for ; Thu, 15 Dec 2016 09:06:50 +0000 (UTC) Received: by mail-wj0-f178.google.com with SMTP id tk12so59755550wjb.3 for ; Thu, 15 Dec 2016 01:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=4AcnyzQYVI/MkjUwIwhY7osOvQUSo8EljjX6eit/s14=; b=YuvIAY35xVDXgdFCVkvqZ32VE94XK5kJKiEuf1UaiQakffG86lVBaM/7Es3Qk6ANRi o/vMPdhseKvglBaBT3c1czLHcUHmE7gv6p0uKWnYYx/+psAH8WsJ1bkJkC42AcZT0EJS OyBq0RTaJolHWanepY7LVumaH6sZ1rwoGxmrd5DNSuVzlKr/CfOv1dutxwb7owH3Qqo/ ZPDwqGDtn7GGEiOtdR/Yb8eNVU0qIQ3o7oNOYD1PEClRniVzuh1n7b5ErxG05R96EwRI fXcJzeMBKJ4QSyWkzUWvfUl41sXCY/rsCgBKhrhLumHn6pflVw+sxY+ZwBiBZYcI9cPj 4bzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=4AcnyzQYVI/MkjUwIwhY7osOvQUSo8EljjX6eit/s14=; b=SGgDYWp7TQmJIXCwHRhED8x9fWhSapLZEpnTGwfGrPx/FgzL8iFvlkIl0v+uPtivJ3 NQcxu+6mFu48bUCqqr+yNVMYWl1bAav2vFaEl+LCaXqOJzzz/s2wnqTU6K4j5KaWKPrG 2weJ9btfu2UAqGoCMpJuBT1lz5fsg7Kc49igy4DUyljjwP4oTd9PE1tdaKbLe5CKchTZ nt3f8GWYg12pNCIRUpffL04qXePNPOEPzVNzA9liudCkw/t2QnrjFgJgyeymz07lVo2G GnuHeqKPmlpKbrxGRlh97OuKfQqLUak3f73Y/9M10nuWdcqvjK7vlQfvkNseRsXLZt3N i2pQ== X-Gm-Message-State: AKaTC0379DXoraT00z1YWoqN8Y8YXnBujGeMn7oOnIdoGdRZ9zOtOsehY1RD6Hxoh+tPqA== X-Received: by 10.194.85.107 with SMTP id g11mr343708wjz.82.1481792749627; Thu, 15 Dec 2016 01:05:49 -0800 (PST) Received: from [192.168.0.128] (HSI-KBW-149-172-37-189.hsi13.kabel-badenwuerttemberg.de. [149.172.37.189]) by smtp.googlemail.com with ESMTPSA id ef10sm1078800wjd.22.2016.12.15.01.05.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Dec 2016 01:05:48 -0800 (PST) Sender: Christian Schneider Subject: Re: HA-JDBC in karaf To: user@karaf.apache.org References: <1481645269480-4048999.post@n3.nabble.com> <1481728339325-4049009.post@n3.nabble.com> From: Christian Schneider Message-ID: <6f754c0e-c2af-7377-73b0-f66d21a2fa9f@die-schneider.net> Date: Thu, 15 Dec 2016 10:05:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1481728339325-4049009.post@n3.nabble.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit archived-at: Thu, 15 Dec 2016 09:07:00 -0000 Many thanks for the example. This looks quite useful. How about adding this to the karaf or ops4j docs? I also think we could support ha-jdbc in pax-jdbc. With a suitable module there we might be able to reduce the config to just creating the etc/ha-jdbc-mycluster.xml and installing a feature (on top of the individual DS config of course). WDYT? Christian On 14.12.2016 16:12, conejo wrote: > Hi JB. You're right. > > I think I've got it. I leave this little guide in case anyone is interested. > > How to configure a datasource ha-jdbc in karaf: > > 1.- We assume that we have installed the features: jndi, jdbc, > pax-jdbc-config, pax-jdbc-pool-dbcp2, pax-jdbc-h2 and any pax-jdbc-ddbb > 2.- The ha-jdbc bundle is installed: bundle:install -s > wrap:mvn:net.sf.ha-jdbc/ha-jdbc/3.0.3 > Note that ha-jdbc is in the repository > https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/ > 3.- Configure the datasource of the cluster nodes using pax-jdbc-config (in > etc): > > org.ops4j.datasource-nodeDS1.cfg > > url=jdbc\:h2\:file\:./prueba_db1/prueba > dataSourceName=nodeDS1 > osgi.jdbc.driver.name=H2-pool > > org.ops4j.datasource-nodeDS2.cfg > > url=jdbc\:h2\:file\:./prueba_db2/prueba > dataSourceName=nodeDS2 > osgi.jdbc.driver.name=H2-pool > > With that we have 2 datasources with jndi url = osgi:service/nodeDS1 y > osgi:service/nodeDS2 > > 4.- A ha-jdbc configuration file (etc/ha-jdbc-mycluster.xml) is defined with > the previous datasources: > > > > 1000 > > > > > > > > > > 5.- The datasource ha-jdbc is defined using blueprint (it is copied to > deploy, for example): > > > xmlns:jaas="http://karaf.apache.org/xmlns/jaas/v1.0.0" > xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0" > > xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"> > > > > > > > value="file:///$[karaf.base]/etc/ha-jdbc-mycluster.xml"> > > > > > > > > > > > See https://ha-jdbc.github.io/doc.html > > > > -- > View this message in context: http://karaf.922171.n3.nabble.com/HA-JDBC-in-karaf-tp4048999p4049009.html > Sent from the Karaf - User mailing list archive at Nabble.com. -- Christian Schneider http://www.liquid-reality.de Open Source Architect http://www.talend.com