Contents

Introduction

Prerequisites

Requirements

Components used

Background Information

Problem

Procedure to Move sessionmgr from Primary and Change sessionmgr Priority in a Replica Set

Approach 1

Approach 2

Introduction

This document describes the procedure to move sessionmgr from the primary role and change sessionmgr priority in a Cisco Policy Suite (CPS) Replica Set.

Prerequisites

Requirements

Cisco recommends that you have knowledge of these topics:

- Linux

- CPS

- MongoDB

Cisco recommends that you must have privilege Root access to CPS CLI.

Components used

The information in this document is based on these software and hardware versions:

- CPS 20.2

- MongoDB v3.6.17

- UCS-B

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.

Background Information

CPS uses MongoDB where mongod processes runs on Sessionmgr Virtual Machine (VMs) to constitute it's basic Database structure. It possesses multiple replica sets for various purposes, which are ADMIN, Subscriber Profile Repository (SPR), BALANCE, SESSION, REPORTING, and AUDIT.

A replica set in MongoDB is a group of mongod processes that maintain the same data set. Replica sets provide redundancy and high availability.With multiple copies of data on different database servers it allows loadshare read operations.

A replica set contains several nodes that bears data  and optionally one arbiter node. Of the nodes that bears data , one and only one member is deemed the primary node, while the other nodes are deemed secondary nodes (a replica set can have multiple secondaries). The primary node handles all write operations.

The secondaries replicate the primary's Operation logs (oplog) and apply the operations to their data sets such that the secondaries' data sets reflect the primary's data set. If the primary is unavailable, an eligible secondary holds an election to elect itself the new primary. An arbiter participates in elections but does not hold data.

In order to get Replica sets status, run the command diagnostics.sh --get_r from ClusterManager or pcrfclient.

Provided here is a sample Replica Set ie. set07.

| SET NAME - PORT : IP ADDRESS - REPLICA STATE - HOST NAME - HEALTH - LAST SYNC -PRIORITY

|----------------------------------------------------------------------------------------------------------------------------------------|

| SESSION:set07 |

| Status via arbitervip:27727 sessionmgr01:27727 sessionmgr02:27727 |

| Member-1 - 27727 : - SECONDARY - sessionmgr01 - ON-LINE - 0 sec - 2 |

| Member-2 - 27727 : 192.168.10.146 - ARBITER - arbitervip - ON-LINE - -------- - 0 |

| Member-3 - 27727 : - PRIMARY - sessionmgr02 - ON-LINE - -------- - 3 |

|----------------------------------------------------------------------------------------------------------------------------------------|

In order to get Replica set configuration information, use these steps.

Step 1. Log in to the primary MongoDB member of that Replica Set. Run this command from ClusterManager.

Command template:

#mongo --host <sessionmgrXX> --port <Replica Set port>

Sample command:

#mongo --host sessionmgr02 --port 27727

Step 2. Run the command in order to get the Replica Set configuration information.

set07:PRIMARY> rs.conf()

{

"_id" : "set07",

"version" : 2,

"members" : [

{

"_id" : 0,

"host" : "sessionmgr01:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 2,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 1,

"host" : "arbitervip:27727",

"arbiterOnly" : true,

"buildIndexes" : true,

"hidden" : false,

"priority" : 0,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 2,

"host" : "sessionmgr02:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 3,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

}

],

"settings" : {

"chainingAllowed" : true,

"heartbeatIntervalMillis" : 2000,

"heartbeatTimeoutSecs" : 1,

"electionTimeoutMillis" : 10000,

"catchUpTimeoutMillis" : -1,

"catchUpTakeoverDelayMillis" : 30000,

"getLastErrorModes" : {

},

"getLastErrorDefaults" : {

"w" : 1,

"wtimeout" : 0

},

"replicaSetId" : ObjectId("61cdb17a80b097a2e7604c97")

}

}

set07:PRIMARY>

Note: Sessionmgr with the highest priority in a Replica Set functions as Primary member.

Problem

Suppose a sessionmgr performs the role of a primary member in one or more Replica Sets and in these cases you must move Replica Set primary role to some other sessionmgr,

1. Whenever you perform any activity that involves this sessionmgr VM shutdown, for a smooth transition.

2. If sessionmgr health gets degrade due to some reason, to maintain proper function of Replica Set with some other healthy sessionmgr.

Procedure to Move sessionmgr from Primary and Change sessionmgr Priority in a Replica Set

Approach 1

Here priority of sessionmgr in a Replica Set changed directly at MongoDB level. Here are the steps to move sessionmg02 out of a primary role in set07.

Option 1. Change the priority of sessionmgr02.

Step 1. Log in to the primary MongoDB member of that Replica Set.

Command template:

#mongo --host <sessionmgrXX> --port <Replica Set port>

Sample command:

#mongo --host sessionmgr02 --port 27727

Step 2. Run the command to get the Replica Set configuration information.

set07:PRIMARY> rs.conf()

{

"_id" : "set07",

"version" : 2,

"members" : [

{

"_id" : 0, -----> Position 0

"host" : "sessionmgr01:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 2,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 1, -----> Position 1

"host" : "arbitervip:27727",

"arbiterOnly" : true,

"buildIndexes" : true,

"hidden" : false,

"priority" : 0,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 2, -----> Position 2

"host" : "sessionmgr02:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 3,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

}

],

"settings" : {

"chainingAllowed" : true,

"heartbeatIntervalMillis" : 2000,

"heartbeatTimeoutSecs" : 1,

"electionTimeoutMillis" : 10000,

"catchUpTimeoutMillis" : -1,

"catchUpTakeoverDelayMillis" : 30000,

"getLastErrorModes" : {

},

"getLastErrorDefaults" : {

"w" : 1,

"wtimeout" : 0

},

"replicaSetId" : ObjectId("61cdb17a80b097a2e7604c97")

}

}

set07:PRIMARY>

Note: Take a note of the position of respective sessionmgr in the rs.conf() output.

Step 3. Run this command to move the terminal to configuration mode.

set07:PRIMARY> cfg = rs.conf()

{

"_id" : "set07",

"version" : 2,

"members" : [

{

"_id" : 0,

"host" : "sessionmgr01:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 2,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 1,

"host" : "arbitervip:27727",

"arbiterOnly" : true,

"buildIndexes" : true,

"hidden" : false,

"priority" : 0,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 2,

"host" : "sessionmgr02:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 3,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

}

],

"settings" : {

"chainingAllowed" : true,

"heartbeatIntervalMillis" : 2000,

"heartbeatTimeoutSecs" : 1,

"electionTimeoutMillis" : 10000,

"catchUpTimeoutMillis" : -1,

"catchUpTakeoverDelayMillis" : 30000,

"getLastErrorModes" : {

},

"getLastErrorDefaults" : {

"w" : 1,

"wtimeout" : 0

},

"replicaSetId" : ObjectId("61cdb17a80b097a2e7604c97")

}

}

set07:PRIMARY>

Step 4. Run this command to change the priority of sessionmgr.

Command template:

cfg.members[X].priority = X --> put the position here in [].

sample command:

cfg.members[2].priority = 1

Here sessionmgr02 is currently the primary member and its position is 2 and priority is 3.

In order to move this sessionmgr02 out of the primary role, provide the lowest priority number greater than 0 but less than the priority of a secondary member which has the highest priority, eg. 1 in this command.

set07:PRIMARY> cfg.members[2].priority = 1

1

set07:PRIMARY>

Step 5. Run this command to commit the change.

set07:PRIMARY> rs.reconfig(cfg)

{

"ok" : 1,

"operationTime" : Timestamp(1641528658, 1),

"$clusterTime" : {

"clusterTime" : Timestamp(1641528658, 1),

"signature" : {

"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

"keyId" : NumberLong(0)

}

}

}

2022-01-07T04:10:57.280+0000 I NETWORK [thread1] trying reconnect to sessionmgr02:27727 (192.168.10.140) failed

2022-01-07T04:10:57.281+0000 I NETWORK [thread1] reconnect sessionmgr02:27727 (192.168.10.140) ok

set07:SECONDARY>

Step 6. Run the command again to verify the changes in sessionmgr priority.

set07:SECONDARY> rs.conf()

{

"_id" : "set07",

"version" : 3,

"members" : [

{

"_id" : 0,

"host" : "sessionmgr01:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 2,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 1,

"host" : "arbitervip:27727",

"arbiterOnly" : true,

"buildIndexes" : true,

"hidden" : false,

"priority" : 0,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 2,

"host" : "sessionmgr02:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 1, --> Here priority has been changed from 3 to 1.

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

}

],

"settings" : {

"chainingAllowed" : true,

"heartbeatIntervalMillis" : 2000,

"heartbeatTimeoutSecs" : 1,

"electionTimeoutMillis" : 10000,

"catchUpTimeoutMillis" : -1,

"catchUpTakeoverDelayMillis" : 30000,

"getLastErrorModes" : {

},

"getLastErrorDefaults" : {

"w" : 1,

"wtimeout" : 0

},

"replicaSetId" : ObjectId("61cdb17a80b097a2e7604c97")

}

}

set07:SECONDARY>

Step 7. Run the command diagnostics.sh --get_r from ClusterManager or pcrfclient to verify changes in Replica Set status.

| SET NAME - PORT : IP ADDRESS - REPLICA STATE - HOST NAME - HEALTH - LAST SYNC - PRIORITY |

------------------------------------------------------------------------------------------------------------------------------------------

| SESSION:set07 |

| Status via arbitervip:27727 sessionmgr01:27727 sessionmgr02:27727 |

| Member-1 - 27727 : - PRIMARY - sessionmgr01 - ON-LINE - -------- - 2 |

| Member-2 - 27727 : 192.168.10.146 - ARBITER - arbitervip - ON-LINE - -------- - 0 |

| Member-3 - 27727 : - SECONDARY - sessionmgr02 - ON-LINE - 0 sec - 1 |

|----------------------------------------------------------------------------------------------------------------------------------------|

Now, you see that sessionmgr02 has moved to secondary. In order to make sessionmgr02 a primary member again, run the aforementioned Steps 1. to 5. with this command in Step 4.

cfg.members[2].priority = Any number greater than 2 but less than 1001 --> put priority higher than that of the current primary member which is 2 in the sample.

set07:PRIMARY> cfg.members[2].priority = 5

5

set07:PRIMARY> rs.reconfig(cfg)

{

"ok" : 1,

"operationTime" : Timestamp(1641531450, 1),

"$clusterTime" : {

"clusterTime" : Timestamp(1641531450, 1),

"signature" : {

"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

"keyId" : NumberLong(0)

}

}

}

2022-01-07T04:57:31.247+0000 I NETWORK [thread1] trying reconnect to sessionmgr01:27727 (192.168.10.139) failed

2022-01-07T04:57:31.247+0000 I NETWORK [thread1] reconnect sessionmgr01:27727 (192.168.10.139) ok

set07:SECONDARY>

Run the command to verify the changes in sessionmgr priority.

set07:SECONDARY> rs.conf()

{

"_id" : "set07",

"version" : 4,

"members" : [

{

"_id" : 0,

"host" : "sessionmgr01:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 2,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 1,

"host" : "arbitervip:27727",

"arbiterOnly" : true,

"buildIndexes" : true,

"hidden" : false,

"priority" : 0,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 2,

"host" : "sessionmgr02:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 5, --> Here priority has been changed from 1 to 5.

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

}

],

"settings" : {

"chainingAllowed" : true,

"heartbeatIntervalMillis" : 2000,

"heartbeatTimeoutSecs" : 1,

"electionTimeoutMillis" : 10000,

"catchUpTimeoutMillis" : -1,

"catchUpTakeoverDelayMillis" : 30000,

"getLastErrorModes" : {

},

"getLastErrorDefaults" : {

"w" : 1,

"wtimeout" : 0

},

"replicaSetId" : ObjectId("61cdb17a80b097a2e7604c97")

}

}

set07:SECONDARY>

Run the command diagnostics.sh --get_r from ClusterManager or pcrfclient to verify changes in Replica Set status.

| SET NAME - PORT : IP ADDRESS - REPLICA STATE - HOST NAME - HEALTH - LAST SYNC -PRIORITY

|----------------------------------------------------------------------------------------------------------------------------------------|

| SESSION:set07 |

| Status via arbitervip:27727 sessionmgr01:27727 sessionmgr02:27727 |

| Member-1 - 27727 : - SECONDARY - sessionmgr01 - ON-LINE - 14 sec - 2 |

| Member-2 - 27727 : 192.168.10.146 - ARBITER - arbitervip - ON-LINE - -------- - 0 |

| Member-3 - 27727 : - PRIMARY - sessionmgr02 - ON-LINE - -------- - 5 |

|----------------------------------------------------------------------------------------------------------------------------------------|

Now, you can see that sessionmgr02 has become primary again.

Option 2. Change the priority of other secondary sessionmgr in order to make it a Primary member. Here it's sessionmgr01.

In order to make sessionmgr01 as primary member, run the aforementioned steps 1. to 5. in Option 1. with this command in Step 4.

cfg.members[0].priority = Any number greater than 3 but less than 1001 --> Put priority higher than that of the current primary member which is "3" in the sample.

set07:PRIMARY> cfg.members[0].priority = 4

4

set07:PRIMARY> rs.reconfig(cfg)

{

"ok" : 1,

"operationTime" : Timestamp(1641540587, 1),

"$clusterTime" : {

"clusterTime" : Timestamp(1641540587, 1),

"signature" : {

"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

"keyId" : NumberLong(0)

}

}

}

2022-01-07T07:29:46.141+0000 I NETWORK [thread1] trying reconnect to sessionmgr02:27727 (192.168.10.140) failed

2022-01-07T07:29:46.142+0000 I NETWORK [thread1] reconnect sessionmgr02:27727 (192.168.10.140) ok

set07:SECONDARY>

Run the command to confirm the changes.

set07:SECONDARY> rs.conf()

{

"_id" : "set07",

"version" : 4,

"members" : [

{

"_id" : 0,

"host" : "sessionmgr01:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 4, --> Here priority has been changed from 2 to 4.

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 1,

"host" : "arbitervip:27727",

"arbiterOnly" : true,

"buildIndexes" : true,

"hidden" : false,

"priority" : 0,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 2,

"host" : "sessionmgr02:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 3,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

}

],

"settings" : {

"chainingAllowed" : true,

"heartbeatIntervalMillis" : 2000,

"heartbeatTimeoutSecs" : 1,

"electionTimeoutMillis" : 10000,

"catchUpTimeoutMillis" : -1,

"catchUpTakeoverDelayMillis" : 30000,

"getLastErrorModes" : {

},

"getLastErrorDefaults" : {

"w" : 1,

"wtimeout" : 0

},

"replicaSetId" : ObjectId("61cdb17a80b097a2e7604c97")

}

}

set07:SECONDARY>

Run the command diagnostics.sh --get_r from Cluster Manager or pcrfcleint to verify changes in Replica Set status.

| SET NAME - PORT : IP ADDRESS - REPLICA STATE - HOST NAME - HEALTH - LAST SYNC -PRIORITY

|----------------------------------------------------------------------------------------------------------------------------------------|

| SESSION:set07 |

| Status via arbitervip:27727 sessionmgr01:27727 sessionmgr02:27727 |

| Member-1 - 27727 : - PRIMARY - sessionmgr01 - ON-LINE - -------- - 4 |

| Member-2 - 27727 : 192.168.10.146 - ARBITER - arbitervip - ON-LINE - -------- - 0 |

| Member-3 - 27727 : - SECONDARY - sessionmgr02 - ON-LINE - 0 sec - 3 |

|----------------------------------------------------------------------------------------------------------------------------------------|

Now, you can see that sessionmgr01 has become primary, whereas sessionmgr02 became secondary.

In order to make sessionmgr02 as a primary member again, run the aforementioned Steps 1. to 5. in Option 1 with this command in Step 4.

cfg.members[0].priority = Any number less than than 3 but greater than 0 --> Put priority lower than that of sessionmgr02 which is "3" in the sample.

set07:PRIMARY> cfg.members[0].priority = 1

1

set07:PRIMARY> rs.reconfig(cfg)

{

"ok" : 1,

"operationTime" : Timestamp(1641531450, 1),

"$clusterTime" : {

"clusterTime" : Timestamp(1641531450, 1),

"signature" : {

"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),

"keyId" : NumberLong(0)

}

}

}

2022-01-07T08:34:31.165+0000 I NETWORK [thread1] trying reconnect to sessionmgr01:27727 (192.168.10.139) failed

2022-01-07T08:34:31.165+0000 I NETWORK [thread1] reconnect sessionmgr01:27727 (192.168.10.139) ok

set07:SECONDARY>

Run this command to verify the changes in sessionmgr priority.

set07:SECONDARY> rs.conf()

{

"_id" : "set07",

"version" : 4,

"members" : [

{

"_id" : 0,

"host" : "sessionmgr01:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 1, --> Here priority has been changed from 4 to 1.

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 1,

"host" : "arbitervip:27727",

"arbiterOnly" : true,

"buildIndexes" : true,

"hidden" : false,

"priority" : 0,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

},

{

"_id" : 2,

"host" : "sessionmgr02:27727",

"arbiterOnly" : false,

"buildIndexes" : true,

"hidden" : false,

"priority" : 3,

"tags" : {

},

"slaveDelay" : NumberLong(0),

"votes" : 1

}

],

"settings" : {

"chainingAllowed" : true,

"heartbeatIntervalMillis" : 2000,

"heartbeatTimeoutSecs" : 1,

"electionTimeoutMillis" : 10000,

"catchUpTimeoutMillis" : -1,

"catchUpTakeoverDelayMillis" : 30000,

"getLastErrorModes" : {

},

"getLastErrorDefaults" : {

"w" : 1,

"wtimeout" : 0

},

"replicaSetId" : ObjectId("61cdb17a80b097a2e7604c97")

}

}

set07:SECONDARY>

Run the command diagnostics.sh --get_r from ClusterManager or pcrfclient to verify changes in Replica Set status.

| SET NAME - PORT : IP ADDRESS - REPLICA STATE - HOST NAME - HEALTH - LAST SYNC -PRIORITY

|----------------------------------------------------------------------------------------------------------------------------------------|

| SESSION:set07 |

| Status via arbitervip:27727 sessionmgr01:27727 sessionmgr02:27727 |

| Member-1 - 27727 : - SECONDARY - sessionmgr01 - ON-LINE - 14 sec - 1 |

| Member-2 - 27727 : 192.168.10.146 - ARBITER - arbitervip - ON-LINE - -------- - 0 |

| Member-3 - 27727 : - PRIMARY - sessionmgr02 - ON-LINE - -------- - 3 |

|----------------------------------------------------------------------------------------------------------------------------------------|

Now, you can see that sessionmgr02 has become primary, whereas sessionmgr01 is secondary.

Approach 2

You can use CPS script set_priority.sh from ClusterManager to change sessionmgr priority in a Replica Set. By default, priority of members set in order (with higher priority) as defined in /etc/broadhop/mongoConfig.cfg in ClusterManager.

Take set07 for example.

[root@installer broadhop]# cat mongoConfig.cfg

[SESSION-SET2]

SETNAME=set07

OPLOG_SIZE=5120

ARBITER=arbitervip:27727

ARBITER_DATA_PATH=/var/data/sessions.7

MEMBER1=sessionmgr02:27727

MEMBER2=sessionmgr01:27727

DATA_PATH=/var/data/sessions.1/2

[SESSION-SET2-END]

To get Replica set status, run the command diagnostics.sh --get_r from ClusterManager or pcrfclient.

| SET NAME - PORT : IP ADDRESS - REPLICA STATE - HOST NAME - HEALTH - LAST SYNC - PRIORITY |

|----------------------------------------------------------------------------------------------------------------------------------------|

| SESSION:set07 |

| Status via arbitervip:27727 sessionmgr01:27727 sessionmgr02:27727 |

| Member-1 - 27727 : - SECONDARY - sessionmgr01 - ON-LINE - 0 sec - 2 |

| Member-2 - 27727 : 192.168.10.146 - ARBITER - arbitervip - ON-LINE - -------- - 0 |

| Member-3 - 27727 : - PRIMARY - sessionmgr02 - ON-LINE - -------- - 3 |

|----------------------------------------------------------------------------------------------------------------------------------------|

When you compare the aforementioned results, you can see that sessionmgr02 is the 1st member[MEMBER1] of set07 in /etc/broadhop/mongoConfig.cfg , hence sessionmgr02 is the primary member in set07 by default.

Provided here are the CPS High Availability options that use set_priority.sh script to move the sessionmgr02 out of the primary member role in set07.

Step 1. Set the priority in ascending order.

Command template:

sh set_priority.sh --db arg --replSet arg --asc

where ,

--db arg --> arg is database name

[all|session|spr|admin|balance|report|portal|audit|bindings|session_configs|bindings_configs|spr_configs]

--replSet arg -->arg is <setname>

Sample command:

sh set_priority.sh --db session --replSet set07 --asc

[root@installer ~]# sh set_priority.sh --db session --replSet set07 --asc

Set priorities is in progress. check log /var/log/broadhop/scripts/set_priority.log to know the status

Setting priority for Replica-Set: SESSION-SET2

INFO Parsing Mongo Config file

INFO Priority set operation is completed for SESSION-SET2

INFO Priority set to the Database members is finished

INFO Validating if Priority is set correctly for Replica-Set: SESSION-SET2

WARNING Mongo Server trying to reconnect while getting config. Attempt #1

INFO Validated Priority is set correctly for Replica-Set: SESSION-SET2

Primary member sessionmgr01:27727 found for Replica SESSION-SET2

Set priorities process successfully completed.

[root@installer ~]#

Step 2. Run the command diagnostics.sh --get_r from ClusterManager or pcrfclient to verify the change.

| SET NAME - PORT : IP ADDRESS - REPLICA STATE - HOST NAME - HEALTH - LAST SYNC - PRIORITY |

|----------------------------------------------------------------------------------------------------------------------------------------|

| SESSION:set07 |

| Status via arbitervip:27727 sessionmgr01:27727 sessionmgr02:27727 |

| Member-1 - 27727 : - PRIMARY - sessionmgr01 - ON-LINE - -------- - 3 |

| Member-2 - 27727 : 192.168.10.146 - ARBITER - arbitervip - ON-LINE - -------- - 0 |

| Member-3 - 27727 : - SECONDARY - sessionmgr02 - ON-LINE - 0 sec - 2 |

|----------------------------------------------------------------------------------------------------------------------------------------|

Now, sessionmgr01 has become the primary member as a priority has been set in the ascending order as defined in /etc/broadhop/mongoConfig.cfg.

In order to make sessionmgr02 a primary member again, run this command.

[root@installer ~]# sh set_priority.sh --db session --replSet set07

Set priorities is in progress. check log /var/log/broadhop/scripts/set_priority.log to know the status

Setting priority for Replica-Set: SESSION-SET2

INFO Parsing Mongo Config file

INFO Priority set operation is completed for SESSION-SET2

INFO Priority set to the Database members is finished

INFO Validating if Priority is set correctly for Replica-Set: SESSION-SET2

WARNING Mongo Server trying to reconnect while getting config. Attempt #1

INFO Validated Priority is set correctly for Replica-Set: SESSION-SET2

Primary member sessionmgr02:27727 found for Replica SESSION-SET2

Set priorities process successfully completed.

[root@installer ~]#

Note: By default, priority has been set in descending order.

Run the command diagnostics.sh --get_r from ClusterManager or pcrfclient to verify the change.

| SET NAME - PORT : IP ADDRESS - REPLICA STATE - HOST NAME - HEALTH - LAST SYNC - PRIORITY |

|----------------------------------------------------------------------------------------------------------------------------------------|

| SESSION:set07 |

| Status via arbitervip:27727 sessionmgr01:27727 sessionmgr02:27727 |

| Member-1 - 27727 : - SECONDARY - sessionmgr01 - ON-LINE - 0 sec - 2 |

| Member-2 - 27727 : 192.168.10.146 - ARBITER - arbitervip - ON-LINE - -------- - 0 |

| Member-3 - 27727 : - PRIMARY - sessionmgr02 - ON-LINE - -------- - 3 |

|----------------------------------------------------------------------------------------------------------------------------------------|

Now, you can see that sessionmgr02 has become primary, whereas sessionmgr01 is secondary.