When one osd is set to weighatge 1 and rest all to zeros, then the osd
which is set to 1 is taken as a primary osd everytime. Can someone let me
know is this the correct way of setting primary afffinity.
1. Have a  crush rule set to take osds 4,9,14,18
2. Changed primary affinity weightage of osd 4 to 1 and rest all to zeros.
3. Placed objects in pool. Everytime it takes 4 as primary osd as expected
(Tried by placing 15 objects in pool, everytime it took osd 4. Need to
check how it behaves when IO tool is used)
4. Changed primary affinity weightage of osd 4 to 1 and osd.9->0.75,
osd.14->0.70, osd.18->0.6799
5. When a object is placed it takes osds in different order, it not
considering 4 as primary osd.
6. Changed primary affinity weighatge of osd 4 to 0.90 and rest all to
zeros.
7. It is taking osds in different order, not considering 4 as primary.
8. Only when one OSD is set to 1 and all other to 0, it is taking osd with
weight 1 as primary.
9. If we use different osds in each rule set and if we don't repeat the
osds in other rules, point 8 will meet our requirement.

On Tue, Jun 14, 2016 at 6:06 PM, Kanchana. P <kanchanared...@vedams.com>
wrote:

> Thanks for the reply shylesh, but the procedure is not working. In
> ceph.com it is mentioned that we can make particular osd as a primary osd
> by setting primary affinity weightage between 0-1. But it is not working.
> On 14 Jun 2016 16:15, "shylesh kumar" <shylesh.mo...@gmail.com> wrote:
>
>> Hi,
>>
>> I think you can edit the crush rule something like below
>>
>> rule another_replicated_ruleset {
>>         ruleset 1
>>         type replicated
>>         min_size 1
>>         max_size 10
>>         step take default
>>         step take osd1
>>         step choose firstn 1 type osd
>>         step emit
>>         step take osd2
>>         step choose firstn 1 type osd
>>         step emit
>>         step take osd5
>>         step choose firstn 1 type osd
>>         step emit
>>         step take osd4
>>         step choose firstn 1 type osd
>>         step emit
>> }
>>
>> and create pool using this rule.
>>
>> It might work , though I am not 100% sure.
>>
>> Thanks,
>> Shylesh
>>
>> On Tue, Jun 14, 2016 at 4:05 PM, Kanchana. P <kanchanared...@vedams.com>
>> wrote:
>>
>>> Hi,
>>>
>>> How to select particular OSD to act as primary OSD.
>>> I modified the ceph.conf file and added
>>> [mon]
>>> ...
>>> mon osd allow primary affinity = true
>>> Restarted ceph target, now primary affinity is set to true in all
>>> monitor nodes.
>>> Using the below commands set some weights to the osds.
>>>
>>> $ ceph osd primary-affinity osd.1 0.25
>>> $ ceph osd primary-affinity osd.6 0.50
>>> $ ceph osd primary-affinity osd.11 0.75
>>> $ ceph osd primary-affinity osd.16 1
>>>
>>> Created a pool "poolA" and set a crush_ruleset so that it takes OSDs in
>>> order 16,11,6,1
>>> Even after setting the primary affinity weight, it took osds in
>>> different order.
>>> Can we select the primary OSD, if so, how can we do that. Please let me
>>> know what I am missing here to set an OSD as a primary OSD.
>>>
>>> _______________________________________________
>>> ceph-users mailing list
>>> ceph-users@lists.ceph.com
>>> http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com
>>>
>>>
>>
>>
>> --
>> Thanks & Regards
>> Shylesh Kumar M
>>
>>
>
_______________________________________________
ceph-users mailing list
ceph-users@lists.ceph.com
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com

Reply via email to