# Backup Priority settings not giving expected results

**URL:** <https://forums.percona.com/t/backup-priority-settings-not-giving-expected-results/32500>\
**Category:** Percona Backup for MongoDB\
**Created:** [August 21, 2024, 5:49pm UTC](https://forums.percona.com/t/backup-priority-settings-not-giving-expected-results/32500 "2024-08-21T17:49:12Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![werekind](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/werekind/32/17700_2.png) [@werekind](https://forums.percona.com/u/werekind)\
**Post date:** [August 21, 2024, 5:49pm UTC](https://forums.percona.com/t/backup-priority-settings-not-giving-expected-results/32500/1 "2024-08-21T17:49:12Z")

</div>

I configured the priorities using the configuration file:

pitr:  
enabled: false  
oplogSpanMin: 0  
compression: s2  
storage:  
type: azure  
azure:  
account: dummyname  
container: pbm-test  
prefix: pbm  
credentials:  
key: ‘\*\*\*’  
backup:  
oplogSpanMin: 0  
priority:  
fuzion-mongo-test-node-1.domain.internal:28018: 0.5  
fuzion-mongo-test-node-2.domain.internal:28018: 0.5  
fuzion-mongo-test-reporting-1.domain.internal:28018: 0.5  
mongo-test-node-01.domain.internal:28018: 1  
mongo-test-node-02.domain.internal:28018: 2  
mongo-test-reporting-01.domain.internal:28018: 2.5  
compression: s2

I used the following output from MongoDB to identify which server is running the backup (is there an easier way to do this?):

rsTest [direct: secondary] admin\> db.pbmLock.find({type: “backup”})  
[  
{  
\_id: ObjectId(‘66c623fcbf206bc62285c1ed’),  
type: ‘backup’,  
replset: ‘rsTest’,  
node: ‘mongo-test-node-01.domain.internal:27018’,  
opid: ‘66c623fa4e5cff0810425134’,  
epoch: Timestamp({ t: 1724261337, i: 11 }),  
hb: Timestamp({ t: 1724261502, i: 1 })  
}  
]

I expected mongo-test-reporting-01 to run the backup with the priority setting of 2.5.

Any suggestions would be appreciated!

---

<div class="post-metadata">

**Author:** ![radoslaw.szulgo](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/radoslaw.szulgo/32/17315_2.png) [@radoslaw.szulgo](https://forums.percona.com/u/radoslaw.szulgo)\
**Post date:** [August 21, 2024, 7:20pm UTC](https://forums.percona.com/t/backup-priority-settings-not-giving-expected-results/32500/2 "2024-08-21T19:20:45Z")

</div>

> [@werekind](#):
>
> mongo-test-reporting-01.domain.internal:28018: 2.5

In the output, you had port :27018 - the default for MongoDB. But in the configuration of priorities you have ports :28018.

Is that a misspelling?

---

<div class="post-metadata">

**Author:** ![werekind](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/werekind/32/17700_2.png) [@werekind](https://forums.percona.com/u/werekind)\
**Post date:** [August 22, 2024, 12:26am UTC](https://forums.percona.com/t/backup-priority-settings-not-giving-expected-results/32500/3 "2024-08-22T00:26:13Z")

</div>

Thanks for responding, Radoslaw. No, we are running on alternate port 27018 (not sure what was behind that initially).

I’ve used that port in the connection string written to the environmental file, etc, and everything else seems to work as expected.

---

<div class="post-metadata">

**Author:** ![radoslaw.szulgo](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/radoslaw.szulgo/32/17315_2.png) [@radoslaw.szulgo](https://forums.percona.com/u/radoslaw.szulgo)\
**Post date:** [August 22, 2024, 8:42am UTC](https://forums.percona.com/t/backup-priority-settings-not-giving-expected-results/32500/4 "2024-08-22T08:42:58Z")

</div>

so to make it clear - problem solved now ? 🙂

---

<div class="post-metadata">

**Author:** ![werekind](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/werekind/32/17700_2.png) [@werekind](https://forums.percona.com/u/werekind)\
**Post date:** [August 22, 2024, 2:32pm UTC](https://forums.percona.com/t/backup-priority-settings-not-giving-expected-results/32500/5 "2024-08-22T14:32:59Z")

</div>

No, the problem is exactly as I stated. I’ve defined the priorities as the documentation described and I show the output of the config file in the original post. The nodes are identified correctly, they are referencing the correct service point as I have clarified, and they are setting priorities to favor “mongo-test-reporting-01”. But the node running the backup is not the one with the highest priority, instead its “mongo-test-node-01” as the output of the mongo query shows.

Can you help me?

---

<div class="post-metadata">

**Author:** ![Boris\_Ilijic](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/boris_ilijic/32/24165_2.png) [@Boris\_Ilijic](https://forums.percona.com/u/Boris_Ilijic)\
**Post date:** [August 22, 2024, 3:01pm UTC](https://forums.percona.com/t/backup-priority-settings-not-giving-expected-results/32500/6 "2024-08-22T15:01:14Z")

</div>

Hi,  
Can you please try to execute:

```auto
pbm status

```

In the ‘Cluster’ section of the command’s output, you’ll be able to see exact names of all available agents (rs-name/hostname:port combination or just hostname:port combination). Please use hostname:port combination when specifying the backup priority for particular agent.

As Radoslaw pointed out it seems that you referenced wrong name in the config’s priority section.

---

<div class="post-metadata">

**Author:** ![Boris\_Ilijic](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/boris_ilijic/32/24165_2.png) [@Boris\_Ilijic](https://forums.percona.com/u/Boris_Ilijic)\
**Post date:** [August 22, 2024, 3:17pm UTC](https://forums.percona.com/t/backup-priority-settings-not-giving-expected-results/32500/7 "2024-08-22T15:17:21Z")

</div>

To answering your second question:

> I used the following output from MongoDB to identify which server is running the backup (is there an easier way to do this?)

The easiest way is to see it in pbm log, so if you execute ‘pbm logs’ you’ll be able to see log entry similar to this one:

```auto
2024-08-22T15:08:33Z I [rs1/rs102:27017] [backup/2024-08-22T15:08:32Z] backup started

```

‘Backup started’ message means that backup has been started on a particular agent, in the above case ‘rs102:27017’.

---

<div class="post-metadata">

**Author:** ![werekind](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/werekind/32/17700_2.png) [@werekind](https://forums.percona.com/u/werekind)\
**Post date:** [August 22, 2024, 7:30pm UTC](https://forums.percona.com/t/backup-priority-settings-not-giving-expected-results/32500/8 "2024-08-22T19:30:47Z")

</div>

Thank you, Boris and Radoslaw. I was looking right at the number and still not seeing it. I moved all the port numbers to 27018 and now it works as expected.

Thanks again…
