You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geode.apache.org by trung kien <ki...@gmail.com> on 2018/07/23 09:47:35 UTC

Deploy geode on kubernetes

Hi all,

Anyone has idea how to deploy geode on kubernetes correctly?
kuberetes requires process to run in fore-ground mode, but gfsh start
processes in background-mode

I found this guy (https://github.com/markito/geode-kubernetes)
he's doing tricky thing by running infinite while loop after starting gfsh
while true; do
sleep 20
done This works, but in case of failure the pod will never be restarted.
So failure recovery doesn't really work.

I'm thinking couple of other solutions:
1/ Start using java command (not via gfsh), this will start process in
fore-ground mode

2/ Using gfsh, but instead of infinite while loop, having a script to
monitor status of geode members and exit in case of failure

Anyone has better idea on this?



-- 
Thanks
Kien

Re: Deploy geode on kubernetes

Posted by Swapnil Bawaskar <sb...@pivotal.io>.
You can also tail the logs
<https://github.com/sbawaska/charts/blob/fe573cd28ce0b9feb832b1c2d5154922ee4f6903/incubator/geode/templates/server.yaml#L34>
after starting the server. This also allows you to see the logs with the
"kubectl log" command:

I am also working on a helm chart for geode. Would appreciate any feedback:
https://github.com/sbawaska/charts/tree/master/incubator/geode





On Mon, Jul 23, 2018 at 3:18 AM Akihiro Kitada <ak...@pivotal.io> wrote:

> Hello Kein,
>
> I prefer the solution 1.
>
> >1/ Start using java command (not via gfsh), this will start process in
> fore-ground mode
>
> If using LocatorLauncher and ServerLauncher classes, you can write
> Locators and Cache Servers launcher in fore-ground mode with less coding.
>
> Thanks.
>
>
> --
> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
> <+81%2080-3716-3736>
> Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
> 5:30pm JST  |  1-877-477-2269 <(877)%20477-2269>
> [image: support] <https://support.pivotal.io/> [image: twitter]
> <https://twitter.com/pivotal> [image: linkedin]
> <https://www.linkedin.com/company/3048967> [image: facebook]
> <https://www.facebook.com/pivotalsoftware> [image: google plus]
> <https://plus.google.com/+Pivotal> [image: youtube]
> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>
>
>
>
> 2018年7月23日(月) 18:47 trung kien <ki...@gmail.com>:
>
>> Hi all,
>>
>> Anyone has idea how to deploy geode on kubernetes correctly?
>> kuberetes requires process to run in fore-ground mode, but gfsh start
>> processes in background-mode
>>
>> I found this guy (https://github.com/markito/geode-kubernetes)
>> he's doing tricky thing by running infinite while loop after starting gfsh
>> while true; do
>> sleep 20
>> done This works, but in case of failure the pod will never be restarted.
>> So failure recovery doesn't really work.
>>
>> I'm thinking couple of other solutions:
>> 1/ Start using java command (not via gfsh), this will start process in
>> fore-ground mode
>>
>> 2/ Using gfsh, but instead of infinite while loop, having a script to
>> monitor status of geode members and exit in case of failure
>>
>> Anyone has better idea on this?
>>
>>
>>
>> --
>> Thanks
>> Kien
>>
>

Re: Deploy geode on kubernetes

Posted by trung kien <ki...@gmail.com>.
Ah, thanks all for the idea.
Looks like i found the solution then.

On Tue, Jul 24, 2018 at 12:22 AM William Markito Oliveira <
william.markito@gmail.com> wrote:

> The jira below was created to add foreground options to gfsh and fix that.
>
> On the ticket there is also a comment with a good bash example using the
> Launcher class.
>
> https://issues.apache.org/jira/plugins/servlet/mobile#issue/GEODE-47
>
> HTH
> Sent from my iPhone
>
> On Jul 23, 2018, at 9:46 PM, Akihiro Kitada <ak...@pivotal.io> wrote:
>
> Hello Kein,
>
> Why don't you call waitOnLocator() after calling start() as below
> -----
> locatorLauncher.start();
> System.out.println("Locator successfully started");
> locatorLauncher.waitOnLocator();
> System.out.println("Locator is shut down");
> -----
>
> In this case, the main thread waits someone to stop at the line calling
> waitOnLocator().
>
> If you stop the locator (for example, with using gfsh stop locator
> command), then you will see "Locator is shut down" as a result.
>
> Thanks, regards.
>
> --
> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
> Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
> 5:30pm JST  |  1-877-477-2269
> [image: support] <https://support.pivotal.io/> [image: twitter]
> <https://twitter.com/pivotal> [image: linkedin]
> <https://www.linkedin.com/company/3048967> [image: facebook]
> <https://www.facebook.com/pivotalsoftware> [image: google plus]
> <https://plus.google.com/+Pivotal> [image: youtube]
> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>
>
>
>
> 2018年7月24日(火) 12:48 trung kien <ki...@gmail.com>:
>
>> Hi Akihiro,
>>
>> Hmm, I'm trying following example from
>> https://geode.apache.org/docs/guide/10/configuring/running/running_the_locator.html
>>
>> import org.apache.geode.distributed.LocatorLauncher;
>>
>>  public class MyEmbeddedLocator {
>>
>>     public static void main(String[] args){
>>         LocatorLauncher locatorLauncher  = new LocatorLauncher.Builder()
>>           .setMemberName("locator1")
>>           .setPort(13489)
>>           .build();
>>
>>           locatorLauncher.start();
>>
>>           System.out.println("Locator successfully started");
>>         }
>>     }
>>
>> This script start locator in background, print the message "Locator
>> successfully started" and exited,
>> am i using it correctly?
>>
>>
>>
>> On Mon, Jul 23, 2018 at 7:28 PM, Akihiro Kitada <ak...@pivotal.io>
>> wrote:
>>
>>> Hello Kein,
>>>
>>> As Bruce mentioned, you can launch locators and cache servers processes
>>> in the foreground with using LocatorLauncher and ServerLauncher classes in
>>> your java programs.
>>>
>>>
>>> --
>>> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
>>> Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
>>> 5:30pm JST  |  1-877-477-2269
>>> [image: support] <https://support.pivotal.io/> [image: twitter]
>>> <https://twitter.com/pivotal> [image: linkedin]
>>> <https://www.linkedin.com/company/3048967> [image: facebook]
>>> <https://www.facebook.com/pivotalsoftware> [image: google plus]
>>> <https://plus.google.com/+Pivotal> [image: youtube]
>>> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>
>>>
>>>
>>>
>>> 2018年7月24日(火) 1:28 trung kien <ki...@gmail.com>:
>>>
>>>> thanks Akihiro,
>>>>
>>>> I like the #1 better, but using LocatorLauncher or ServerLauncher it
>>>> also create background process right?
>>>>
>>>> I was running ps grep command to get full java process start by gfsh,
>>>> but it’s urgly solution.
>>>>
>>>> On Mon, Jul 23, 2018 at 5:11 AM Akihiro Kitada <ak...@pivotal.io>
>>>> wrote:
>>>>
>>>>> Hello Kein,
>>>>>
>>>>> I prefer the solution 1.
>>>>>
>>>>> >1/ Start using java command (not via gfsh), this will start process
>>>>> in fore-ground mode
>>>>>
>>>>> If using LocatorLauncher and ServerLauncher classes, you can write
>>>>> Locators and Cache Servers launcher in fore-ground mode with less coding.
>>>>>
>>>>> Thanks.
>>>>>
>>>>>
>>>>> --
>>>>> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
>>>>> Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am
>>>>> to 5:30pm JST  |  1-877-477-2269
>>>>> [image: support] <https://support.pivotal.io/> [image: twitter]
>>>>> <https://twitter.com/pivotal> [image: linkedin]
>>>>> <https://www.linkedin.com/company/3048967> [image: facebook]
>>>>> <https://www.facebook.com/pivotalsoftware> [image: google plus]
>>>>> <https://plus.google.com/+Pivotal> [image: youtube]
>>>>> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>
>>>>>
>>>>>
>>>>>
>>>>> 2018年7月23日(月) 18:47 trung kien <ki...@gmail.com>:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> Anyone has idea how to deploy geode on kubernetes correctly?
>>>>>> kuberetes requires process to run in fore-ground mode, but gfsh start
>>>>>> processes in background-mode
>>>>>>
>>>>>> I found this guy (https://github.com/markito/geode-kubernetes)
>>>>>> he's doing tricky thing by running infinite while loop after starting
>>>>>> gfsh
>>>>>> while true; do
>>>>>> sleep 20
>>>>>> done This works, but in case of failure the pod will never be
>>>>>> restarted.
>>>>>> So failure recovery doesn't really work.
>>>>>>
>>>>>> I'm thinking couple of other solutions:
>>>>>> 1/ Start using java command (not via gfsh), this will start process
>>>>>> in fore-ground mode
>>>>>>
>>>>>> 2/ Using gfsh, but instead of infinite while loop, having a script to
>>>>>> monitor status of geode members and exit in case of failure
>>>>>>
>>>>>> Anyone has better idea on this?
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Thanks
>>>>>> Kien
>>>>>>
>>>>> --
>>>> Thanks
>>>> Kien
>>>>
>>>
>>
>>
>> --
>> Thanks
>> Kien
>>
> --
Thanks
Kien

Re: Deploy geode on kubernetes

Posted by William Markito Oliveira <wi...@gmail.com>.
The jira below was created to add foreground options to gfsh and fix that. 

On the ticket there is also a comment with a good bash example using the Launcher class.  

https://issues.apache.org/jira/plugins/servlet/mobile#issue/GEODE-47

HTH
Sent from my iPhone

> On Jul 23, 2018, at 9:46 PM, Akihiro Kitada <ak...@pivotal.io> wrote:
> 
> Hello Kein,
> 
> Why don't you call waitOnLocator() after calling start() as below
> -----
> locatorLauncher.start();
> System.out.println("Locator successfully started");
> locatorLauncher.waitOnLocator();
> System.out.println("Locator is shut down");
> -----
> 
> In this case, the main thread waits someone to stop at the line calling waitOnLocator().
> 
> If you stop the locator (for example, with using gfsh stop locator command), then you will see "Locator is shut down" as a result.
> 
> Thanks, regards.
> 
> --  
> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736 
> Support.Pivotal.io  |  Mon-Fri  9:00am to 5:30pm JST  |  1-877-477-2269
>      
> 
> 
> 
> 2018年7月24日(火) 12:48 trung kien <ki...@gmail.com>:
>> Hi Akihiro,
>> 
>> Hmm, I'm trying following example from https://geode.apache.org/docs/guide/10/configuring/running/running_the_locator.html
>> import org.apache.geode.distributed.LocatorLauncher;
>> 
>>  public class MyEmbeddedLocator {
>> 
>>     public static void main(String[] args){
>>         LocatorLauncher locatorLauncher  = new LocatorLauncher.Builder()
>>           .setMemberName("locator1")
>>           .setPort(13489)
>>           .build();
>> 
>>           locatorLauncher.start();
>> 
>>           System.out.println("Locator successfully started");
>>         }
>>     }
>> This script start locator in background, print the message "Locator successfully started" and exited, 
>> am i using it correctly?
>> 
>> 
>> 
>> On Mon, Jul 23, 2018 at 7:28 PM, Akihiro Kitada <ak...@pivotal.io> wrote:
>>> Hello Kein,
>>> 
>>> As Bruce mentioned, you can launch locators and cache servers processes in the foreground with using LocatorLauncher and ServerLauncher classes in your java programs.
>>> 
>>> 
>>> --  
>>> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736 
>>> Support.Pivotal.io  |  Mon-Fri  9:00am to 5:30pm JST  |  1-877-477-2269
>>>      
>>> 
>>> 
>>> 
>>> 2018年7月24日(火) 1:28 trung kien <ki...@gmail.com>:
>>>> thanks Akihiro,
>>>> 
>>>> I like the #1 better, but using LocatorLauncher or ServerLauncher it also create background process right?
>>>> 
>>>> I was running ps grep command to get full java process start by gfsh, but it’s urgly solution.
>>>> 
>>>>> On Mon, Jul 23, 2018 at 5:11 AM Akihiro Kitada <ak...@pivotal.io> wrote:
>>>>> Hello Kein,
>>>>> 
>>>>> I prefer the solution 1.
>>>>> 
>>>>> >1/ Start using java command (not via gfsh), this will start process in fore-ground mode
>>>>> 
>>>>> If using LocatorLauncher and ServerLauncher classes, you can write Locators and Cache Servers launcher in fore-ground mode with less coding.
>>>>> 
>>>>> Thanks.
>>>>> 
>>>>> 
>>>>> --  
>>>>> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736 
>>>>> Support.Pivotal.io  |  Mon-Fri  9:00am to 5:30pm JST  |  1-877-477-2269
>>>>>      
>>>>> 
>>>>> 
>>>>> 
>>>>> 2018年7月23日(月) 18:47 trung kien <ki...@gmail.com>:
>>>>>> Hi all,
>>>>>> 
>>>>>> Anyone has idea how to deploy geode on kubernetes correctly?
>>>>>> kuberetes requires process to run in fore-ground mode, but gfsh start processes in background-mode
>>>>>> 
>>>>>> I found this guy (https://github.com/markito/geode-kubernetes)
>>>>>> he's doing tricky thing by running infinite while loop after starting gfsh
>>>>>>              while true; do
>>>>>>   sleep 20
>>>>>> done
>>>>>> This works, but in case of failure the pod will never be restarted.
>>>>>> So failure recovery doesn't really work.
>>>>>> 
>>>>>> I'm thinking couple of other solutions:
>>>>>> 1/ Start using java command (not via gfsh), this will start process in fore-ground mode
>>>>>> 
>>>>>> 2/ Using gfsh, but instead of infinite while loop, having a script to monitor status of geode members and exit in case of failure
>>>>>> 
>>>>>> Anyone has better idea on this?
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> -- 
>>>>>> Thanks
>>>>>> Kien
>>>> -- 
>>>> Thanks
>>>> Kien
>> 
>> 
>> 
>> -- 
>> Thanks
>> Kien

Re: Deploy geode on kubernetes

Posted by Akihiro Kitada <ak...@pivotal.io>.
Hello Kein,

Why don't you call waitOnLocator() after calling start() as below
-----
locatorLauncher.start();
System.out.println("Locator successfully started");
locatorLauncher.waitOnLocator();
System.out.println("Locator is shut down");
-----

In this case, the main thread waits someone to stop at the line calling
waitOnLocator().

If you stop the locator (for example, with using gfsh stop locator
command), then you will see "Locator is shut down" as a result.

Thanks, regards.

--
Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
5:30pm JST  |  1-877-477-2269
[image: support] <https://support.pivotal.io/> [image: twitter]
<https://twitter.com/pivotal> [image: linkedin]
<https://www.linkedin.com/company/3048967> [image: facebook]
<https://www.facebook.com/pivotalsoftware> [image: google plus]
<https://plus.google.com/+Pivotal> [image: youtube]
<https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>



2018年7月24日(火) 12:48 trung kien <ki...@gmail.com>:

> Hi Akihiro,
>
> Hmm, I'm trying following example from
> https://geode.apache.org/docs/guide/10/configuring/running/running_the_locator.html
>
> import org.apache.geode.distributed.LocatorLauncher;
>
>  public class MyEmbeddedLocator {
>
>     public static void main(String[] args){
>         LocatorLauncher locatorLauncher  = new LocatorLauncher.Builder()
>           .setMemberName("locator1")
>           .setPort(13489)
>           .build();
>
>           locatorLauncher.start();
>
>           System.out.println("Locator successfully started");
>         }
>     }
>
> This script start locator in background, print the message "Locator
> successfully started" and exited,
> am i using it correctly?
>
>
>
> On Mon, Jul 23, 2018 at 7:28 PM, Akihiro Kitada <ak...@pivotal.io>
> wrote:
>
>> Hello Kein,
>>
>> As Bruce mentioned, you can launch locators and cache servers processes
>> in the foreground with using LocatorLauncher and ServerLauncher classes in
>> your java programs.
>>
>>
>> --
>> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
>> Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
>> 5:30pm JST  |  1-877-477-2269
>> [image: support] <https://support.pivotal.io/> [image: twitter]
>> <https://twitter.com/pivotal> [image: linkedin]
>> <https://www.linkedin.com/company/3048967> [image: facebook]
>> <https://www.facebook.com/pivotalsoftware> [image: google plus]
>> <https://plus.google.com/+Pivotal> [image: youtube]
>> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>
>>
>>
>>
>> 2018年7月24日(火) 1:28 trung kien <ki...@gmail.com>:
>>
>>> thanks Akihiro,
>>>
>>> I like the #1 better, but using LocatorLauncher or ServerLauncher it
>>> also create background process right?
>>>
>>> I was running ps grep command to get full java process start by gfsh,
>>> but it’s urgly solution.
>>>
>>> On Mon, Jul 23, 2018 at 5:11 AM Akihiro Kitada <ak...@pivotal.io>
>>> wrote:
>>>
>>>> Hello Kein,
>>>>
>>>> I prefer the solution 1.
>>>>
>>>> >1/ Start using java command (not via gfsh), this will start process in
>>>> fore-ground mode
>>>>
>>>> If using LocatorLauncher and ServerLauncher classes, you can write
>>>> Locators and Cache Servers launcher in fore-ground mode with less coding.
>>>>
>>>> Thanks.
>>>>
>>>>
>>>> --
>>>> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
>>>> Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
>>>> 5:30pm JST  |  1-877-477-2269
>>>> [image: support] <https://support.pivotal.io/> [image: twitter]
>>>> <https://twitter.com/pivotal> [image: linkedin]
>>>> <https://www.linkedin.com/company/3048967> [image: facebook]
>>>> <https://www.facebook.com/pivotalsoftware> [image: google plus]
>>>> <https://plus.google.com/+Pivotal> [image: youtube]
>>>> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>
>>>>
>>>>
>>>>
>>>> 2018年7月23日(月) 18:47 trung kien <ki...@gmail.com>:
>>>>
>>>>> Hi all,
>>>>>
>>>>> Anyone has idea how to deploy geode on kubernetes correctly?
>>>>> kuberetes requires process to run in fore-ground mode, but gfsh start
>>>>> processes in background-mode
>>>>>
>>>>> I found this guy (https://github.com/markito/geode-kubernetes)
>>>>> he's doing tricky thing by running infinite while loop after starting
>>>>> gfsh
>>>>> while true; do
>>>>> sleep 20
>>>>> done This works, but in case of failure the pod will never be
>>>>> restarted.
>>>>> So failure recovery doesn't really work.
>>>>>
>>>>> I'm thinking couple of other solutions:
>>>>> 1/ Start using java command (not via gfsh), this will start process in
>>>>> fore-ground mode
>>>>>
>>>>> 2/ Using gfsh, but instead of infinite while loop, having a script to
>>>>> monitor status of geode members and exit in case of failure
>>>>>
>>>>> Anyone has better idea on this?
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thanks
>>>>> Kien
>>>>>
>>>> --
>>> Thanks
>>> Kien
>>>
>>
>
>
> --
> Thanks
> Kien
>

Re: Deploy geode on kubernetes

Posted by trung kien <ki...@gmail.com>.
Hi Akihiro,

Hmm, I'm trying following example from
https://geode.apache.org/docs/guide/10/configuring/running/running_the_locator.html

import org.apache.geode.distributed.LocatorLauncher;

 public class MyEmbeddedLocator {

    public static void main(String[] args){
        LocatorLauncher locatorLauncher  = new LocatorLauncher.Builder()
          .setMemberName("locator1")
          .setPort(13489)
          .build();

          locatorLauncher.start();

          System.out.println("Locator successfully started");
        }
    }

This script start locator in background, print the message "Locator
successfully started" and exited,
am i using it correctly?



On Mon, Jul 23, 2018 at 7:28 PM, Akihiro Kitada <ak...@pivotal.io> wrote:

> Hello Kein,
>
> As Bruce mentioned, you can launch locators and cache servers processes in
> the foreground with using LocatorLauncher and ServerLauncher classes in
> your java programs.
>
>
> --
> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
> Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
> 5:30pm JST  |  1-877-477-2269
> [image: support] <https://support.pivotal.io/> [image: twitter]
> <https://twitter.com/pivotal> [image: linkedin]
> <https://www.linkedin.com/company/3048967> [image: facebook]
> <https://www.facebook.com/pivotalsoftware> [image: google plus]
> <https://plus.google.com/+Pivotal> [image: youtube]
> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>
>
>
>
> 2018年7月24日(火) 1:28 trung kien <ki...@gmail.com>:
>
>> thanks Akihiro,
>>
>> I like the #1 better, but using LocatorLauncher or ServerLauncher it also
>> create background process right?
>>
>> I was running ps grep command to get full java process start by gfsh, but
>> it’s urgly solution.
>>
>> On Mon, Jul 23, 2018 at 5:11 AM Akihiro Kitada <ak...@pivotal.io>
>> wrote:
>>
>>> Hello Kein,
>>>
>>> I prefer the solution 1.
>>>
>>> >1/ Start using java command (not via gfsh), this will start process in
>>> fore-ground mode
>>>
>>> If using LocatorLauncher and ServerLauncher classes, you can write
>>> Locators and Cache Servers launcher in fore-ground mode with less coding.
>>>
>>> Thanks.
>>>
>>>
>>> --
>>> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
>>> Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
>>> 5:30pm JST  |  1-877-477-2269
>>> [image: support] <https://support.pivotal.io/> [image: twitter]
>>> <https://twitter.com/pivotal> [image: linkedin]
>>> <https://www.linkedin.com/company/3048967> [image: facebook]
>>> <https://www.facebook.com/pivotalsoftware> [image: google plus]
>>> <https://plus.google.com/+Pivotal> [image: youtube]
>>> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>
>>>
>>>
>>>
>>> 2018年7月23日(月) 18:47 trung kien <ki...@gmail.com>:
>>>
>>>> Hi all,
>>>>
>>>> Anyone has idea how to deploy geode on kubernetes correctly?
>>>> kuberetes requires process to run in fore-ground mode, but gfsh start
>>>> processes in background-mode
>>>>
>>>> I found this guy (https://github.com/markito/geode-kubernetes)
>>>> he's doing tricky thing by running infinite while loop after starting
>>>> gfsh
>>>> while true; do
>>>> sleep 20
>>>> done This works, but in case of failure the pod will never be
>>>> restarted.
>>>> So failure recovery doesn't really work.
>>>>
>>>> I'm thinking couple of other solutions:
>>>> 1/ Start using java command (not via gfsh), this will start process in
>>>> fore-ground mode
>>>>
>>>> 2/ Using gfsh, but instead of infinite while loop, having a script to
>>>> monitor status of geode members and exit in case of failure
>>>>
>>>> Anyone has better idea on this?
>>>>
>>>>
>>>>
>>>> --
>>>> Thanks
>>>> Kien
>>>>
>>> --
>> Thanks
>> Kien
>>
>


-- 
Thanks
Kien

Re: Deploy geode on kubernetes

Posted by Akihiro Kitada <ak...@pivotal.io>.
Hello Kein,

As Bruce mentioned, you can launch locators and cache servers processes in
the foreground with using LocatorLauncher and ServerLauncher classes in
your java programs.


--
Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
5:30pm JST  |  1-877-477-2269
[image: support] <https://support.pivotal.io/> [image: twitter]
<https://twitter.com/pivotal> [image: linkedin]
<https://www.linkedin.com/company/3048967> [image: facebook]
<https://www.facebook.com/pivotalsoftware> [image: google plus]
<https://plus.google.com/+Pivotal> [image: youtube]
<https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>



2018年7月24日(火) 1:28 trung kien <ki...@gmail.com>:

> thanks Akihiro,
>
> I like the #1 better, but using LocatorLauncher or ServerLauncher it also
> create background process right?
>
> I was running ps grep command to get full java process start by gfsh, but
> it’s urgly solution.
>
> On Mon, Jul 23, 2018 at 5:11 AM Akihiro Kitada <ak...@pivotal.io> wrote:
>
>> Hello Kein,
>>
>> I prefer the solution 1.
>>
>> >1/ Start using java command (not via gfsh), this will start process in
>> fore-ground mode
>>
>> If using LocatorLauncher and ServerLauncher classes, you can write
>> Locators and Cache Servers launcher in fore-ground mode with less coding.
>>
>> Thanks.
>>
>>
>> --
>> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
>> Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
>> 5:30pm JST  |  1-877-477-2269
>> [image: support] <https://support.pivotal.io/> [image: twitter]
>> <https://twitter.com/pivotal> [image: linkedin]
>> <https://www.linkedin.com/company/3048967> [image: facebook]
>> <https://www.facebook.com/pivotalsoftware> [image: google plus]
>> <https://plus.google.com/+Pivotal> [image: youtube]
>> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>
>>
>>
>>
>> 2018年7月23日(月) 18:47 trung kien <ki...@gmail.com>:
>>
>>> Hi all,
>>>
>>> Anyone has idea how to deploy geode on kubernetes correctly?
>>> kuberetes requires process to run in fore-ground mode, but gfsh start
>>> processes in background-mode
>>>
>>> I found this guy (https://github.com/markito/geode-kubernetes)
>>> he's doing tricky thing by running infinite while loop after starting
>>> gfsh
>>> while true; do
>>> sleep 20
>>> done This works, but in case of failure the pod will never be restarted.
>>> So failure recovery doesn't really work.
>>>
>>> I'm thinking couple of other solutions:
>>> 1/ Start using java command (not via gfsh), this will start process in
>>> fore-ground mode
>>>
>>> 2/ Using gfsh, but instead of infinite while loop, having a script to
>>> monitor status of geode members and exit in case of failure
>>>
>>> Anyone has better idea on this?
>>>
>>>
>>>
>>> --
>>> Thanks
>>> Kien
>>>
>> --
> Thanks
> Kien
>

Re: Deploy geode on kubernetes

Posted by trung kien <ki...@gmail.com>.
thanks Akihiro,

I like the #1 better, but using LocatorLauncher or ServerLauncher it also
create background process right?

I was running ps grep command to get full java process start by gfsh, but
it’s urgly solution.

On Mon, Jul 23, 2018 at 5:11 AM Akihiro Kitada <ak...@pivotal.io> wrote:

> Hello Kein,
>
> I prefer the solution 1.
>
> >1/ Start using java command (not via gfsh), this will start process in
> fore-ground mode
>
> If using LocatorLauncher and ServerLauncher classes, you can write
> Locators and Cache Servers launcher in fore-ground mode with less coding.
>
> Thanks.
>
>
> --
> Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
> Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
> 5:30pm JST  |  1-877-477-2269
> [image: support] <https://support.pivotal.io/> [image: twitter]
> <https://twitter.com/pivotal> [image: linkedin]
> <https://www.linkedin.com/company/3048967> [image: facebook]
> <https://www.facebook.com/pivotalsoftware> [image: google plus]
> <https://plus.google.com/+Pivotal> [image: youtube]
> <https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>
>
>
>
> 2018年7月23日(月) 18:47 trung kien <ki...@gmail.com>:
>
>> Hi all,
>>
>> Anyone has idea how to deploy geode on kubernetes correctly?
>> kuberetes requires process to run in fore-ground mode, but gfsh start
>> processes in background-mode
>>
>> I found this guy (https://github.com/markito/geode-kubernetes)
>> he's doing tricky thing by running infinite while loop after starting gfsh
>> while true; do
>> sleep 20
>> done This works, but in case of failure the pod will never be restarted.
>> So failure recovery doesn't really work.
>>
>> I'm thinking couple of other solutions:
>> 1/ Start using java command (not via gfsh), this will start process in
>> fore-ground mode
>>
>> 2/ Using gfsh, but instead of infinite while loop, having a script to
>> monitor status of geode members and exit in case of failure
>>
>> Anyone has better idea on this?
>>
>>
>>
>> --
>> Thanks
>> Kien
>>
> --
Thanks
Kien

Re: Deploy geode on kubernetes

Posted by Akihiro Kitada <ak...@pivotal.io>.
Hello Kein,

I prefer the solution 1.

>1/ Start using java command (not via gfsh), this will start process in
fore-ground mode

If using LocatorLauncher and ServerLauncher classes, you can write Locators
and Cache Servers launcher in fore-ground mode with less coding.

Thanks.


--
Akihiro Kitada  |  Staff Customer Engineer |  +81 80 3716 3736
Support.Pivotal.io <https://pivotal.io/support>  |  Mon-Fri  9:00am to
5:30pm JST  |  1-877-477-2269
[image: support] <https://support.pivotal.io/> [image: twitter]
<https://twitter.com/pivotal> [image: linkedin]
<https://www.linkedin.com/company/3048967> [image: facebook]
<https://www.facebook.com/pivotalsoftware> [image: google plus]
<https://plus.google.com/+Pivotal> [image: youtube]
<https://www.youtube.com/playlist?list=PLAdzTan_eSPScpj2J50ErtzR9ANSzv3kl>



2018年7月23日(月) 18:47 trung kien <ki...@gmail.com>:

> Hi all,
>
> Anyone has idea how to deploy geode on kubernetes correctly?
> kuberetes requires process to run in fore-ground mode, but gfsh start
> processes in background-mode
>
> I found this guy (https://github.com/markito/geode-kubernetes)
> he's doing tricky thing by running infinite while loop after starting gfsh
> while true; do
> sleep 20
> done This works, but in case of failure the pod will never be restarted.
> So failure recovery doesn't really work.
>
> I'm thinking couple of other solutions:
> 1/ Start using java command (not via gfsh), this will start process in
> fore-ground mode
>
> 2/ Using gfsh, but instead of infinite while loop, having a script to
> monitor status of geode members and exit in case of failure
>
> Anyone has better idea on this?
>
>
>
> --
> Thanks
> Kien
>

Re: Deploy geode on kubernetes

Posted by Bruce Schuchardt <bs...@pivotal.io>.
Use the LocatorLauncher and ServerLauncher classes to launch processes 
in the foreground.


On 7/23/18 2:47 AM, trung kien wrote:
> Hi all,
>
> Anyone has idea how to deploy geode on kubernetes correctly?
> kuberetes requires process to run in fore-ground mode, but gfsh start 
> processes in background-mode
>
> I found this guy (https://github.com/markito/geode-kubernetes)
> he's doing tricky thing by running infinite while loop after starting gfsh
> while true; do
>
> 	sleep 20
>
> 	done
>
> This works, but in case of failure the pod will never be restarted.
> So failure recovery doesn't really work.
>
> I'm thinking couple of other solutions:
> 1/ Start using java command (not via gfsh), this will start process in 
> fore-ground mode
>
> 2/ Using gfsh, but instead of infinite while loop, having a script to 
> monitor status of geode members and exit in case of failure
>
> Anyone has better idea on this?
>
>
>
> -- 
> Thanks
> Kien