<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Issues with using arken/service-amb in Nuxeo Forum</title>
    <link>https://connect.hyland.com/t5/nuxeo-forum/issues-with-using-arken-service-amb/m-p/326460#M13461</link>
    <description>&lt;P&gt;I found the issue with this one.  Adding the details here should anyone else have a similar problem...&lt;/P&gt;
&lt;P&gt;In the source code of etcd-netfw I noticed that the etcd url had a hardcoded default value (see &lt;A href="https://github.com/arkenio/etcd-netfw/blob/master/config.go)" target="test_blank"&gt;https://github.com/arkenio/etcd-netfw/blob/master/config.go)&lt;/A&gt;.  Therefore, modified the ExecStart command of (service-ambassador) to pass in the etcd url as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;#!/bin/sh
ETCD_ADDRESS=http://$(/bin/ifconfig docker0 | awk '/inet /{print $2}'):4001
/usr/bin/docker run --rm --name $INSTANCE_NAME \
	-P \
	arken/service-amb \
	-servicePath /services/authentication-query-service \
	-etcdAddress ${ETCD_ADDRESS}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now all working as expected &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jun 2014 03:52:12 GMT</pubDate>
    <dc:creator>boardthatpowder</dc:creator>
    <dc:date>2014-06-30T03:52:12Z</dc:date>
    <item>
      <title>Issues with using arken/service-amb</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/issues-with-using-arken-service-amb/m-p/326459#M13460</link>
      <description>&lt;P&gt;I’ve been using your scripts at &lt;A href="https://github.com/nuxeo/nuxeo.io-scripts" target="test_blank"&gt;https://github.com/nuxeo/nuxeo.io-scripts&lt;/A&gt; as a guideline for configuring a Docker ambassador in core-os.  I can honestly say these have been the best source of coreos/docker that I have come across!&lt;/P&gt;
&lt;P&gt;I’m currently using core-os v353 as part of the beta channel (have also tried v361 on alpha, same result).  I have a setup as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;(service-consumer) - (service-ambassador) - (service-publisher)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I originally had the (service-publisher) on a separate node to the others, but to help with debugging and rule out any network issues I reduced it down to 1 coreos node.&lt;/P&gt;
&lt;P&gt;My (service-publisher) docker contains a java restful service that grabs a port, then registers with etcdtcl.&lt;/P&gt;
&lt;P&gt;In the systemd unit file for (service-publisher) I define:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Environment='SERVICE_NAME=authentication-query-service' 
Environment='INSTANCE_NAME=authentication-query-%i-service'
Environment='INSTANCE=%i'
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In ExecStart:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;/usr/bin/docker run --rm -P \
	--name ${INSTANCE_NAME} \
	${REGISTRY}/adc2/authentication-query
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In ExecStartPost:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;PORT=`docker port $INSTANCE_NAME 8080 | awk -F : '{print $2}'`
/opt/data/tools/register-service.sh $SERVICE_NAME $INSTANCE $PORT
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After running this, I can successfully retrieve the host and port from etcdctl:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;core@core-01 ~ $ etcdctl ls /services/authentication-query-service --recursive
/services/authentication-query-service/1
/services/authentication-query-service/1/location
core@core-01 ~ $ etcdctl get /services/authentication-query-service/1/location
{"host":"172.17.8.101","port":49158}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(service-ambassador) is an instance of arken/service-amb, and is configured as follows:&lt;/P&gt;
&lt;P&gt;In the systemd unit file I define:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Environment='INSTANCE_NAME=authentication-query-amb-%i-service'
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In ExecStart:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;/usr/bin/docker run --rm --name $INSTANCE_NAME \
	-P \
	arken/service-amb \
	-servicePath /services/authentication-query-service
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I then configure (service-consumer) as follows:&lt;/P&gt;
&lt;P&gt;In the systemd unit file I define:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Environment='SERVICE_NAME=workflow-public-service' 
Environment='INSTANCE_NAME=workflow-public-%i-service'
Environment='INSTANCE=%i'
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In ExecStart:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;AUTHENTCIATION_QUERY_AMB="authentication-query-amb-${INSTANCE}-service"

/usr/bin/docker run --rm -P --name ${INSTANCE_NAME} \
  --link ${AUTHENTCIATION_QUERY_AMB}:auth_query \
  ${REGISTRY}/adc2/workflow-public:latest
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;After running this, I can successfully retrieve the host and port of this service from etcdctl:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;core@core-01 ~ $ etcdctl ls /services/workflow-public-service --recursive
/services/workflow-public-service/1
/services/workflow-public-service/1/location
core@core-01 ~ $ etcdctl get /services/workflow-public-service/1/location
{"host":"172.17.8.101","port":49161}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In my (service-consumer) application, I set the host and port of (service-publisher) to instead use the ambassador environment variables that have been defined as part of the docker link to (service-ambassador):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;AUTH_QUERY_PORT_1337_TCP_ADDR=10.1.0.18
AUTH_QUERY_PORT_1337_TCP_PORT=1337
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now from my understanding of reading through all the nuxeo documents and scripts (which have been an invaluable source of help on coreos and docker by the way!), I would expect that when (service-consumer) makes a rest call to (service-ambassador), it uses the ‘-servicePath’ attribute that is set as part of ExecStart of that service to look up the available service locations of (service-publisher) registered in etcdctl.  But instead, the following is output in the (service-ambassador) logs:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;core@core-01 ~ $ docker logs authentication-query-amb-1-service
E0629 23:24:46.375219 00001 tcpproxy.go:36] No host found for service
E0629 23:24:46.396998 00001 tcpproxy.go:36] No host found for service
E0629 23:24:46.417416 00001 tcpproxy.go:36] No host found for service
E0629 23:24:46.437557 00001 tcpproxy.go:36] No host found for service
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;When starting up (service-ambassador), I’ve tried the following variations, each with the same result:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;-servicePath /services/authentication-query-service
-servicePath /services/authentication-query-service/
servicePath /services/authentication-query-service
servicePath /services/authentication-query-service/
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Any ideas?  Any help will be much appreciated.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 01:57:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/issues-with-using-arken-service-amb/m-p/326459#M13460</guid>
      <dc:creator>boardthatpowder</dc:creator>
      <dc:date>2014-06-30T01:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with using arken/service-amb</title>
      <link>https://connect.hyland.com/t5/nuxeo-forum/issues-with-using-arken-service-amb/m-p/326460#M13461</link>
      <description>&lt;P&gt;I found the issue with this one.  Adding the details here should anyone else have a similar problem...&lt;/P&gt;
&lt;P&gt;In the source code of etcd-netfw I noticed that the etcd url had a hardcoded default value (see &lt;A href="https://github.com/arkenio/etcd-netfw/blob/master/config.go)" target="test_blank"&gt;https://github.com/arkenio/etcd-netfw/blob/master/config.go)&lt;/A&gt;.  Therefore, modified the ExecStart command of (service-ambassador) to pass in the etcd url as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;#!/bin/sh
ETCD_ADDRESS=http://$(/bin/ifconfig docker0 | awk '/inet /{print $2}'):4001
/usr/bin/docker run --rm --name $INSTANCE_NAME \
	-P \
	arken/service-amb \
	-servicePath /services/authentication-query-service \
	-etcdAddress ${ETCD_ADDRESS}
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now all working as expected &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jun 2014 03:52:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/nuxeo-forum/issues-with-using-arken-service-amb/m-p/326460#M13461</guid>
      <dc:creator>boardthatpowder</dc:creator>
      <dc:date>2014-06-30T03:52:12Z</dc:date>
    </item>
  </channel>
</rss>

