[ClusterLabs] creating a resource on a specific node
Dennis Jacobfeuerborn
dennisml at conversis.de
Sat Oct 3 15:15:16 UTC 2015
On 03.10.2015 16:46, Jorge Fábregas wrote:
> On 10/03/2015 10:27 AM, Vijay Partha wrote:
>> any command while adding a resource to a node to make it run only on a
>> particular node
>
> Hi,
>
> I don't think there's such a thing (specify a location at creation
> time). Since you can't create a location constraint for a resource that
> doesn't exist, what I would do in a running cluster is:
>
> - create the resource with a target-role of "Stopped"
> - create the location constraint for it
> - change resource taget-role to "Started" (and it should start where you
> indicated in the constraint).
I think in general it is a bad idea to update the cluster in single
command increments like above. Instead:
1. Get a copy of the current CIB: pcs cluster cib cib.xml
2. Add resources, constraints, etc. to that file by using the regular
command but with the "-f cib.xml" option.
3. Commit the changes atomically to the cluster:
pcs cluster cib-push cib.xml
No need to worry about creating resources in the state "stopped" and
then starting them after some other contraints have been configured.
Regards,
Dennis
More information about the Users
mailing list