2012/5/23 Jamie G. <[email protected]> > Use child instances for Operating System level process protection - I > tend to have several instances running on a host. > > Host One: > Master child instance for group A > Slave child instance for group B > > Host Two: > Master child instance for group B > Slave child instance for group A > > You have 2 cellar groups to define 2 different runtime environments like development and production or like production1 and production2?
Host Three: > Database > > Sure. > Scale upwards as required. > As a note, use hot slaves - this starts a container up to a defined > run level so that when it becomes a master it has less to load and > hence be faster to resume services. > Is the default ok? > > As to deploying applications to each instance there are a multitude of > ways you can accomplish this, one common way is using features files > to deploy your apps. Karaf Archives provide another way to deploy as > an atomic unit your bundles/features. > > I'll start with features. What did you mean by "The ToDo refers to the documentation."? There are no links there or am I looking at the wrong page. I found http://icodebythesea.blogspot.com/2009/10/setting-up-smx4-failover-with-mysql.html where MySql configuration is described, but for ServiceMix: karaf.lock=true karaf.lock.level=20 karaf.lock.delay=1000 karaf.lock.class=org.apache.felix.karaf.main.MySQLJDBCLock karaf.lock.jdbc.url=jdbc:mysql://address:port/dbname karaf.lock.jdbc.driver=com.mysql.jdbc.Driver karaf.lock.jdbc.user=root karaf.lock.jdbc.password=karaf karaf.lock.jdbc.table=KARAF_LOCK karaf.lock.jdbc.clustername=mycluster karaf.lock.jdbc.timeout=30 If I put mysql-connector-java-5.1.20-bin.jar into lib/ext (to put the driver on the karaf's classpath) the Karaf is not starting. I guess I have to get another jar which contais MySQLJDBCLock class? Anything else? Must run on a train now... Cheers, > Jamie > > On Wed, May 23, 2012 at 10:52 AM, Borut Bolčina <[email protected]> > wrote: > > Hello, > > > > 2012/5/23 Jamie G. <[email protected]> > > > >> The ToDo refers to the documentation. > >> > >> The Master holds a lock on a JDBC table, when the Master dies than one > >> of the slave instances looking to obtain that locked table will gain > >> access. > >> > >> As to a few stories on failover setup, there are a number of > approaches... > >> > >> One could setup Master/Slave child instances per host - in this > >> scenario a lock file may be used. > > > > > > Not safe enough. > > > >> > >> > >> One could use a shared lock file between hosts, where the file system > >> supports true locking (ex NFSv4). > > > > > > Not available. > > > >> > >> Alternately you can use JDBC locking mechanism, you just need to > >> ensure you have a highly available DB. > > > > > > Yes, Percona XtraDB Cluster > >> > >> > >> As to Dev/Alpha/test environments... that'll depend somewhat more upon > >> your network environment, internal procedures,, and resources such as > >> databases, etc that your applications will have to integrate with. > >> Generally you'd have a separate deployment for each for testing > >> purposes, with the required testing resources for your application > >> (test DBs and other services). > >> > > The network, databases, procedures and resources are not in question, > what I > > am asking is what are common patterns with Karaf. Creating child > instances, > > running Karaf container as different user, maybe some other technique I > did > > not stumble upon yet? Maybe something from FuseSource? > > > > Thanks, > > borut > > > >> > >> Cheers, > >> Jamie > >> > >> On Wed, May 23, 2012 at 10:00 AM, Borut Bolčina < > [email protected]> > >> wrote: > >> > Hello, > >> > > >> > I am playing with Karaf (or the other way around), trying to find a > >> > solution > >> > how to set up a development and production environments. Yesterday I > >> > installed Cellar features and tried some of the cluster commands and > >> > they > >> > seem to work as advertised. > >> > > >> > I would like to devise a plan for deploying bundles and features to a > >> > cluster of Karaf instances on different machines with failover > >> > capability. > >> > It is kind of hard as I am still learning OSGi and the whole > ecosystem. > >> > > >> > > >> > At > http://karaf.apache.org/manual/latest-2.2.x/users-guide/failover.html > there > >> > is a TODO section for MySql. Does that mean I can not use MySql for > jdbc > >> > locking or is there just lack of documentation? > >> > > >> > What does that mean: "If the master loses the lock, a waiting slave > >> > process > >> > gains access to the locking table and fully starts its container."? If > >> > the > >> > master machine's processor melts, then the slave will come up > >> > automatically? > >> > > >> > I would really appreciate some stories on how to set up the fail over > >> > environment and how to deploy to the selected environment (dev, alpha, > >> > production,...) > >> > > >> > Thanks, > >> > borut > > > > >
