[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Problems with setting up a new cartridge



We are planning on doing something there soon - the configure step has enough info for the platform to set the proxy port prior to setup, and then when setup completes all of the exposed ports can be reported back to the broker (so it can report that to other clients).

However, as a best practice, I would recommend making your cartridge flexible to both port numbers changing, dns entries changing, and potentially others.  That allows the cartridge to eventually be moved, given a new port, etc.

If you look at the redis cart, it generates config on startup (which references those values) simply because that's really cheap, and restarts are infrequent.  It also allows the config to react to app wide env vars (coming soon) to tweak what scaling modes.

On Jul 13, 2013, at 2:58 PM, Neil Armitage <neil armitage continuent com> wrote:

> Thanks, that has actually cleared up something for me. The proxy variable is actually generated in a subscribe hook so of course it won't be available until the hook has run. 
> 
> It's taking a while for me to get me head around all the moving parts 
> 
> Neil Armitage
> 
> On 13 Jul 2013, at 18:53, Clayton Coleman <ccoleman redhat com> wrote:
> 
>> 
>> 
>> On Jul 13, 2013, at 11:02 AM, Neil Armitage <neil armitage continuent com> wrote:
>> 
>>> Hi
>>> 
>>> I'm hoping you can help with this. We are building a new cartridge to set up Tungsten replication between MySQL instances. Basically I have taken a MySQL cartridge and added our replication software into it.
>>> 
>>> The cartridge works fine but now I am having problems when I scale the cartridge. I have set up the manifest so if publishes a proxy port for the port for the replicator to attach to and I am receiving this information in all of the cartridges ok. My problem is the proxy variable does not appear to exist then the setup, install or post_install scripts are run, it is empty at that point.
>> 
>> That seems wrong - proxy should be visible during setup.  It is definitely available when connection hooks are run.  Although that may be because expose-port is being run after setup.... But if that's the case it's something we're going to be fixing very soon.  
>> 
>> Dan/Jhon?
>> 
>> If so, your subscribe hooks will have access.  Connection hooks will run before "control start" is called though, so you could do it in a hook you subscribe to yourself or in "control start"
>> 
>>> In order to configure the software I need to me able to access this information at some point when the gear is built. Is there any point in the deployment process where I can access this information and use it to configure some files within the replicator? Or have I configured something wrong?
>>> 
>>> Basically I am set up as follows
>>> 
>>> manifest
>>> 
>>> Publishes:
>>> publish-tungsten-messaging:
>>>  Type: "NET_TCP:tungsten-messaging-info"
>>> Subscribes:
>>> set-tungsten-messaging:
>>>  Type: "NET_TCP:tungsten-messaging-info"
>>> Scaling:
>>> Min: 1
>>> Max: -1
>>> Endpoints:
>>> - Private-IP-Name:   DB_HOST
>>>  Private-Port-Name: MESSAGING_PORT
>>>  Private-Port:      5445
>>>  Public-Port-Name:  MESSAGING_PROXY_PORT
>>> 
>>> When I start the gear the variable is available from the command line
>>> 
>>> [51e1134c4382ecc119000235-narmitag.rhcloud.com 51e1134c4382ecc119000235]\> env|grep MESSAGING
>>> OPENSHIFT_TUNGSTEN_MESSAGING=51e1134c4382ecc119000235-narmitag.rhcloud.com[50116],51e115e45973cab71700007e-narmitag.rhcloud.com[47681]
>>> 
>>> But if I try and look the the variable in the build scripts it is empty
>>> 
>>> [51e1134c4382ecc119000235-narmitag.rhcloud.com 51e1134c4382ecc119000235]\> cat tungsten/log/boot.log
>>> In setup OPENSHIFT_TUNGSTEN_MESSAGING = '  ' :
>>> In install  OPENSHIFT_TUNGSTEN_MESSAGING = '  ':
>>> In post install OPENSHIFT_TUNGSTEN_MESSAGING = '  ' :
>>> 
>>> If any one could shed some light on this it would be very helpful
>>> 
>>> Thanks
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -- 
>>> Neil Armitage
>>> Cluster Implementation Engineer
>>> neil armitage continuent com
>>> Skype : narmitag
>>> 
>>> _______________________________________________
>>> dev mailing list
>>> dev lists openshift redhat com
>>> http://lists.openshift.redhat.com/openshiftmm/listinfo/dev


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]