Hello Michael,

It seems there is an issue with the KARAF_HOME variable, not sure what
is going on there.

For Unomi however, it is possible to have it autoStart by using the
following setting in the setenv script :

export KARAF_OPTS="-Dunomi.autoStart=true"

This will trigger a start of Unomi as soon as Karaf has finished initializing.

Regards,
  Serge...
On Fri, Nov 23, 2018 at 8:08 PM Michael Ghen <m...@mikeghen.com> wrote:
>
> Hi,
>
> I put together this repo with my docker configuration and a docker compose
> example.
>
> I'm having an issue now trying to get this running on Kubernetes and was
> hoping someone can help me. I put this "sleep 60" command in the entry
> point script for my docker file between when I start Karaf and when I issue
> the "unomi:start" command. In Kubernetes, it seems like this doesn't work
> so I'm trying to find a why to wait for Karaf to finish start up before
> starting unomi.
>
> My entry point script looks like:
>
> #!/bin/sh
> sed -i 
> "s/elasticSearchAddresses=localhost:9300/elasticSearchAddresses=${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/g"
> /opt/apache-unomi/etc/org.apache.unomi.persistence.elasticsearch.cfg
> $KARAF_HOME/bin/start
> sleep 60
> $KARAF_HOME/bin/client "unomi:start"
> echo "Started Unomi"
> tail -f $KARAF_HOME/data/log/karaf.log
>
> And in the logs I get this:
>
> start: Ignoring predefined value for KARAF_HOME
> client: Ignoring predefined value for KARAF_HOME
> *Failed to get the session.*
> Started Unomi
>
> The "Failed to get the session." seems to be the client failing to connect
> to Karaf before it's ready? Is there a better way to start Unomi on
> container startup? I'm new to Karaf and spent the last week pouring over
> the docs looking for something to help with this. I tried to do an if
> statment with bin/status but that wasn't working out.

Reply via email to