You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@helix.apache.org by Hang Qi <ha...@gmail.com> on 2015/12/02 20:16:47 UTC

Is there any way to force controller to re-elect leader

Hi All,

Is there any way to force controller to re-elect leader, or one step
further, is there any way we can force particular controller to be the
leader?

The reason I am asking is that we are using customized rebalancer, and we
need to update all the controllers to let the controller to use the new
code, it is not very bucket testing friendly.

Thanks
Hang Qi

Re: Is there any way to force controller to re-elect leader

Posted by kishore g <g....@gmail.com>.
Cool. Glad to see it worked.
On Dec 7, 2015 3:57 PM, "Hang Qi" <ha...@gmail.com> wrote:

> Hi Kishore,
>
> Thanks very much for your detailed instructions, I tried it on my test
> cluster, it works!
>
> Thanks
> Hang Qi
>
> On Wed, Dec 2, 2015 at 12:54 PM, kishore g <g....@gmail.com> wrote:
>
>> Here are the steps. Please try them on a dummy cluster
>>
>> Lets call the existing cluster - ServingCluster. First we create a new
>> cluster called SuperCluster
>>
>> helix-admin.sh createCluster SuperCluster
>>
>> Now add controller nodes C1, C2, C3 as participants to SuperCluster
>>
>> helix-admin.sh addInstance SuperCluster C1
>> helix-admin.sh addInstance SuperCluster C2
>> helix-admin.sh addInstance SuperCluster C3
>>
>> Add a resource named after original cluster, ServingCluster. This
>> resource can be set up in any mode.
>>
>> AUTO ---> one of C1, C2, C3 will start managing ServingCluster
>> SEMI_AUTO - leader is selected based on the preference list. If you want
>> C2 to be the leader, set it to C2, C3, C1. If C2 crashes, C3 will take over
>> automatically.
>> CUSTOM- > you get complete control here, if you want to C2  to control
>> the ServingCluster, set the IS as follows. Note: there is not automatic
>> re-election of leader in this case.
>>
>> C1:STANDBY,
>> C2:LEADER,
>> C3:STANDBY
>>
>> Stop all controllers. Restart them in distributed mode, and this time the
>> cluster name you provide to start will be SuperCluster.
>>
>> Hope this helps.
>>
>> Once you test your changes, you can go back to standalone mode by simply
>> restarting the controllers again in standalone mode and provide the
>> ServingCluster as the clustername.
>>
>> Hope this helps.
>>
>> Try this out on a dummy cluster.
>>
>> thanks,
>> Kishore G
>>
>>
>> On Wed, Dec 2, 2015 at 12:07 PM, Hang Qi <ha...@gmail.com> wrote:
>>
>>> Hi Kishore,
>>>
>>> Thanks very much for your response.
>>>
>>> We are using Standalone mode.
>>>
>>> Do you have any instructions how to convert controllers from standalone
>>> to distributed mode, I can not find it in
>>> http://helix.apache.org/0.6.5-docs/tutorial_controller.html
>>>
>>> Thanks
>>> Hang Qi
>>>
>>> On Wed, Dec 2, 2015 at 11:55 AM, kishore g <g....@gmail.com> wrote:
>>>
>>>> What is the mode in which controller is deployed?
>>>>
>>>> Standalone or Distributed.
>>>>
>>>> Standalone is the mode where we run 3 controllers independently and one
>>>> of them becomes the leader and starts managing.
>>>>
>>>> In Distributed, the controllers are participant of another super
>>>> cluster and cluster to manage will become a resource in the super cluster.
>>>> This mode is useful when there are too many clusters and we dont need to
>>>> bring up controllers for each cluster.
>>>>
>>>> What you want can be achieved easily with distributed mode. You can
>>>> enable/disable controllers since they come participants of super cluster.
>>>>
>>>> I cant think of a straight forward way to achieve that in standalone
>>>> mode.
>>>>
>>>> Another option is to convert controllers from standalone to
>>>> distributed. This can be done without causing any interruption to running
>>>> servers.
>>>>
>>>>
>>>> On Wed, Dec 2, 2015 at 11:16 AM, Hang Qi <ha...@gmail.com> wrote:
>>>>
>>>>> Hi All,
>>>>>
>>>>> Is there any way to force controller to re-elect leader, or one step
>>>>> further, is there any way we can force particular controller to be the
>>>>> leader?
>>>>>
>>>>> The reason I am asking is that we are using customized rebalancer, and
>>>>> we need to update all the controllers to let the controller to use the new
>>>>> code, it is not very bucket testing friendly.
>>>>>
>>>>> Thanks
>>>>> Hang Qi
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>> Qi hang
>>>
>>
>>
>
>
> --
> Qi hang
>

Re: Is there any way to force controller to re-elect leader

Posted by Hang Qi <ha...@gmail.com>.
Hi Kishore,

Thanks very much for your detailed instructions, I tried it on my test
cluster, it works!

Thanks
Hang Qi

On Wed, Dec 2, 2015 at 12:54 PM, kishore g <g....@gmail.com> wrote:

> Here are the steps. Please try them on a dummy cluster
>
> Lets call the existing cluster - ServingCluster. First we create a new
> cluster called SuperCluster
>
> helix-admin.sh createCluster SuperCluster
>
> Now add controller nodes C1, C2, C3 as participants to SuperCluster
>
> helix-admin.sh addInstance SuperCluster C1
> helix-admin.sh addInstance SuperCluster C2
> helix-admin.sh addInstance SuperCluster C3
>
> Add a resource named after original cluster, ServingCluster. This resource
> can be set up in any mode.
>
> AUTO ---> one of C1, C2, C3 will start managing ServingCluster
> SEMI_AUTO - leader is selected based on the preference list. If you want
> C2 to be the leader, set it to C2, C3, C1. If C2 crashes, C3 will take over
> automatically.
> CUSTOM- > you get complete control here, if you want to C2  to control the
> ServingCluster, set the IS as follows. Note: there is not automatic
> re-election of leader in this case.
>
> C1:STANDBY,
> C2:LEADER,
> C3:STANDBY
>
> Stop all controllers. Restart them in distributed mode, and this time the
> cluster name you provide to start will be SuperCluster.
>
> Hope this helps.
>
> Once you test your changes, you can go back to standalone mode by simply
> restarting the controllers again in standalone mode and provide the
> ServingCluster as the clustername.
>
> Hope this helps.
>
> Try this out on a dummy cluster.
>
> thanks,
> Kishore G
>
>
> On Wed, Dec 2, 2015 at 12:07 PM, Hang Qi <ha...@gmail.com> wrote:
>
>> Hi Kishore,
>>
>> Thanks very much for your response.
>>
>> We are using Standalone mode.
>>
>> Do you have any instructions how to convert controllers from standalone
>> to distributed mode, I can not find it in
>> http://helix.apache.org/0.6.5-docs/tutorial_controller.html
>>
>> Thanks
>> Hang Qi
>>
>> On Wed, Dec 2, 2015 at 11:55 AM, kishore g <g....@gmail.com> wrote:
>>
>>> What is the mode in which controller is deployed?
>>>
>>> Standalone or Distributed.
>>>
>>> Standalone is the mode where we run 3 controllers independently and one
>>> of them becomes the leader and starts managing.
>>>
>>> In Distributed, the controllers are participant of another super cluster
>>> and cluster to manage will become a resource in the super cluster. This
>>> mode is useful when there are too many clusters and we dont need to bring
>>> up controllers for each cluster.
>>>
>>> What you want can be achieved easily with distributed mode. You can
>>> enable/disable controllers since they come participants of super cluster.
>>>
>>> I cant think of a straight forward way to achieve that in standalone
>>> mode.
>>>
>>> Another option is to convert controllers from standalone to distributed.
>>> This can be done without causing any interruption to running servers.
>>>
>>>
>>> On Wed, Dec 2, 2015 at 11:16 AM, Hang Qi <ha...@gmail.com> wrote:
>>>
>>>> Hi All,
>>>>
>>>> Is there any way to force controller to re-elect leader, or one step
>>>> further, is there any way we can force particular controller to be the
>>>> leader?
>>>>
>>>> The reason I am asking is that we are using customized rebalancer, and
>>>> we need to update all the controllers to let the controller to use the new
>>>> code, it is not very bucket testing friendly.
>>>>
>>>> Thanks
>>>> Hang Qi
>>>>
>>>>
>>>
>>
>>
>> --
>> Qi hang
>>
>
>


-- 
Qi hang

Re: Is there any way to force controller to re-elect leader

Posted by kishore g <g....@gmail.com>.
Here are the steps. Please try them on a dummy cluster

Lets call the existing cluster - ServingCluster. First we create a new
cluster called SuperCluster

helix-admin.sh createCluster SuperCluster

Now add controller nodes C1, C2, C3 as participants to SuperCluster

helix-admin.sh addInstance SuperCluster C1
helix-admin.sh addInstance SuperCluster C2
helix-admin.sh addInstance SuperCluster C3

Add a resource named after original cluster, ServingCluster. This resource
can be set up in any mode.

AUTO ---> one of C1, C2, C3 will start managing ServingCluster
SEMI_AUTO - leader is selected based on the preference list. If you want C2
to be the leader, set it to C2, C3, C1. If C2 crashes, C3 will take over
automatically.
CUSTOM- > you get complete control here, if you want to C2  to control the
ServingCluster, set the IS as follows. Note: there is not automatic
re-election of leader in this case.

C1:STANDBY,
C2:LEADER,
C3:STANDBY

Stop all controllers. Restart them in distributed mode, and this time the
cluster name you provide to start will be SuperCluster.

Hope this helps.

Once you test your changes, you can go back to standalone mode by simply
restarting the controllers again in standalone mode and provide the
ServingCluster as the clustername.

Hope this helps.

Try this out on a dummy cluster.

thanks,
Kishore G


On Wed, Dec 2, 2015 at 12:07 PM, Hang Qi <ha...@gmail.com> wrote:

> Hi Kishore,
>
> Thanks very much for your response.
>
> We are using Standalone mode.
>
> Do you have any instructions how to convert controllers from standalone to
> distributed mode, I can not find it in
> http://helix.apache.org/0.6.5-docs/tutorial_controller.html
>
> Thanks
> Hang Qi
>
> On Wed, Dec 2, 2015 at 11:55 AM, kishore g <g....@gmail.com> wrote:
>
>> What is the mode in which controller is deployed?
>>
>> Standalone or Distributed.
>>
>> Standalone is the mode where we run 3 controllers independently and one
>> of them becomes the leader and starts managing.
>>
>> In Distributed, the controllers are participant of another super cluster
>> and cluster to manage will become a resource in the super cluster. This
>> mode is useful when there are too many clusters and we dont need to bring
>> up controllers for each cluster.
>>
>> What you want can be achieved easily with distributed mode. You can
>> enable/disable controllers since they come participants of super cluster.
>>
>> I cant think of a straight forward way to achieve that in standalone
>> mode.
>>
>> Another option is to convert controllers from standalone to distributed.
>> This can be done without causing any interruption to running servers.
>>
>>
>> On Wed, Dec 2, 2015 at 11:16 AM, Hang Qi <ha...@gmail.com> wrote:
>>
>>> Hi All,
>>>
>>> Is there any way to force controller to re-elect leader, or one step
>>> further, is there any way we can force particular controller to be the
>>> leader?
>>>
>>> The reason I am asking is that we are using customized rebalancer, and
>>> we need to update all the controllers to let the controller to use the new
>>> code, it is not very bucket testing friendly.
>>>
>>> Thanks
>>> Hang Qi
>>>
>>>
>>
>
>
> --
> Qi hang
>

Re: Is there any way to force controller to re-elect leader

Posted by Hang Qi <ha...@gmail.com>.
Hi Kishore,

Thanks very much for your response.

We are using Standalone mode.

Do you have any instructions how to convert controllers from standalone to
distributed mode, I can not find it in
http://helix.apache.org/0.6.5-docs/tutorial_controller.html

Thanks
Hang Qi

On Wed, Dec 2, 2015 at 11:55 AM, kishore g <g....@gmail.com> wrote:

> What is the mode in which controller is deployed?
>
> Standalone or Distributed.
>
> Standalone is the mode where we run 3 controllers independently and one of
> them becomes the leader and starts managing.
>
> In Distributed, the controllers are participant of another super cluster
> and cluster to manage will become a resource in the super cluster. This
> mode is useful when there are too many clusters and we dont need to bring
> up controllers for each cluster.
>
> What you want can be achieved easily with distributed mode. You can
> enable/disable controllers since they come participants of super cluster.
>
> I cant think of a straight forward way to achieve that in standalone mode.
>
> Another option is to convert controllers from standalone to distributed.
> This can be done without causing any interruption to running servers.
>
>
> On Wed, Dec 2, 2015 at 11:16 AM, Hang Qi <ha...@gmail.com> wrote:
>
>> Hi All,
>>
>> Is there any way to force controller to re-elect leader, or one step
>> further, is there any way we can force particular controller to be the
>> leader?
>>
>> The reason I am asking is that we are using customized rebalancer, and we
>> need to update all the controllers to let the controller to use the new
>> code, it is not very bucket testing friendly.
>>
>> Thanks
>> Hang Qi
>>
>>
>


-- 
Qi hang

Re: Is there any way to force controller to re-elect leader

Posted by kishore g <g....@gmail.com>.
What is the mode in which controller is deployed?

Standalone or Distributed.

Standalone is the mode where we run 3 controllers independently and one of
them becomes the leader and starts managing.

In Distributed, the controllers are participant of another super cluster
and cluster to manage will become a resource in the super cluster. This
mode is useful when there are too many clusters and we dont need to bring
up controllers for each cluster.

What you want can be achieved easily with distributed mode. You can
enable/disable controllers since they come participants of super cluster.

I cant think of a straight forward way to achieve that in standalone mode.

Another option is to convert controllers from standalone to distributed.
This can be done without causing any interruption to running servers.


On Wed, Dec 2, 2015 at 11:16 AM, Hang Qi <ha...@gmail.com> wrote:

> Hi All,
>
> Is there any way to force controller to re-elect leader, or one step
> further, is there any way we can force particular controller to be the
> leader?
>
> The reason I am asking is that we are using customized rebalancer, and we
> need to update all the controllers to let the controller to use the new
> code, it is not very bucket testing friendly.
>
> Thanks
> Hang Qi
>
>