# PBS\_PRIMARY/PBS\_SECONDARY vs PBS\_LEAF\_NAME

**URL:** <https://community.openpbs.org/t/pbs-primary-pbs-secondary-vs-pbs-leaf-name/2651>\
**Category:** Users/Site Administrators\
**Created:** [June 14, 2021, 11:31am UTC](https://community.openpbs.org/t/pbs-primary-pbs-secondary-vs-pbs-leaf-name/2651 "2021-06-14T11:31:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![boboshaq](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@boboshaq](https://community.openpbs.org/u/boboshaq)\
**Post date:** [June 14, 2021, 11:31am UTC](https://community.openpbs.org/t/pbs-primary-pbs-secondary-vs-pbs-leaf-name/2651/1 "2021-06-14T11:31:13Z")

</div>

Hi,  
Can You tell me that I understanding well meaning PBS\_RIMARY and PBS\_SECONDARY parameter when I have been set PBS\_LEAF\_NAME parameter according which this table:

 ![tab-failover](https://canada1.discourse-cdn.com/flex030/uploads/pbspro/original/1X/ae22202380904cabd0eb360796a119683b1ea100.png)

| parameters in pbs.conf | on server1(primary) | on server2(secondary) |
| --- | --- | --- |
| PBS\_SERVER | h1.domain | h2.domain |
| PBS\_LEAF\_NAME | comm\_h1 | comm\_h2 |
| PBS\_PRIMARY | comm\_h1 | comm\_h1 |
| PBS\_SECONDARY | comm\_h2 | comm\_h2 |

And I need add to file /etc/hosts alias: comm\_h1 on server1 and comm\_h2 to the same file on server2, yes?

Regards!

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [June 14, 2021, 9:33pm UTC](https://community.openpbs.org/t/pbs-primary-pbs-secondary-vs-pbs-leaf-name/2651/2 "2021-06-14T21:33:29Z")

</div>

PBS\_PRIMARY is the primary PBS Server in the PBS Failover configuration and PBS\_SECONDARY is the secondary PBS server.

The value of PBS\_LEAF\_NAME should be the hostname of the interface over which you want PBS Pro to communicate, not the domain name. Unless you have multiple NICs, you should not need to set this value at all. Please try removing PBS\_LEAF\_NAME from /etc/pbs.conf and try starting PBS Pro.

> [@boboshaq](#):
>
> And I need add to file /etc/hosts alias: comm\_h1 on server1 and comm\_h2 to the same file on server2, yes?

Make sure the /etc/hosts file are identical and resolvable from both primary and secondary.

The /etc/pbs.conf of Primary and Secondary are as below respectively

**Primary** :  
PBS\_EXEC=/opt/pbs  
PBS\_SERVER=/mnt/file\_locking\_enabled\_storage/pbsworks  
PBS\_START\_SERVER=1  
PBS\_START\_SCHED=1  
PBS\_START\_COMM=1  
PBS\_START\_MOM=0  
PBS\_HOME=/var/spool/pbs  
PBS\_CORE\_LIMIT=unlimited  
PBS\_SCP=/usr/bin/scp  
PBS\_PRIMARY=primary\_server  
PBS\_SECONDARY=secondary\_server

**Secondary** :

PBS\_EXEC=/opt/pbs  
PBS\_SERVER=primary\_server # edited for correctness  
PBS\_START\_SERVER=1  
PBS\_START\_SCHED=0  
PBS\_START\_COMM=1  
PBS\_START\_MOM=0  
PBS\_HOME=/mnt/file\_locking\_enabled\_storage/pbsworks  
PBS\_CORE\_LIMIT=unlimited  
PBS\_SCP=/usr/bin/scp  
PBS\_PRIMARY=primary\_server  
PBS\_SECONDARY=secondary\_server

---

<div class="post-metadata">

**Author:** ![boboshaq](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@boboshaq](https://community.openpbs.org/u/boboshaq)\
**Post date:** [June 15, 2021, 11:03am UTC](https://community.openpbs.org/t/pbs-primary-pbs-secondary-vs-pbs-leaf-name/2651/3 "2021-06-15T11:03:41Z")

</div>

> [@adarsh](#):
>
> PBS\_PRIMARY is the primary PBS Server in the PBS Failover configuration and PBS\_SECONDARY is the secondary PBS server.

I understand it.

> [@adarsh](#):
>
> the hostname of the interface

You mean hostname in /etc/hosts, yes?

> [@adarsh](#):
>
> not the domain name.

I do not provide domain name in previous example, I was entered short hostname from /etc/hosts, is this OK?

> [@adarsh](#):
>
> Unless you have multiple NICs, you should not need to set this value at all

I have multiple NICs and I want to enable Failover configuration. So did my previous example is OK or not? On primary server, value of PBS\_LEAF\_NAME is comm\_h1 (which is hostname from /etc/hosts for one of my internal network), and value of PBS\_LEAF\_NAME on secondary server is set analogously.

> [@adarsh](#):
>
> PBS\_SERVER=/mnt/file\_locking\_enabled\_storage/pbsworks

Why You entered here path? It should be hostname, Yes? I entered FQDN hostname here in my example.

> [@adarsh](#):
>
> PBS\_PRIMARY=primary\_server  
> PBS\_SECONDARY=secondary\_server

You entered here short hostnames of Your primary and secondary hosts, which are set in /etc/hosts?

Maybe, to better understanding my question, I enter here example of /etc/hosts which relate to my above example:

- primary server hosts file  
10.10.10.1 h1.domain h1 comm\_h1

-secondary hosts file  
10.10.10.2 h2.domain h2 comm\_h2

Which, for example, h1.domain is FQDN hostname and h1 is short hostname and comm\_h1 is additional hostname for communication deamon to set PBS\_LEAF\_NAME value in pbs.conf

Is those settings are good or I misunderstanding how to set FAILOVER?

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [June 15, 2021, 8:06pm UTC](https://community.openpbs.org/t/pbs-primary-pbs-secondary-vs-pbs-leaf-name/2651/4 "2021-06-15T20:06:04Z")

</div>

> [@boboshaq](#):
>
> Why You entered here path? It should be hostname, Yes? I entered FQDN hostname here in my example.

That was my mistake, i have edited and updated it. Thank you

> [@boboshaq](#):
>
> Which, for example, h1.domain is FQDN hostname and h1 is short hostname and comm\_h1 is additional hostname for communication deamon to set PBS\_LEAF\_NAME value in pbs.conf

PBS\_PRIMARY=h1  
PBS\_SECONDARY=h2

Please check whether they are resolvable using: pbs\_hostn -v h1 from h2 and on all the nodes and same for h2.

Start the PBS Services , try to submit jobs, check whether jobs are running fine, then you are all set. If for some reason (from the respective logs) the daemons are communicating on a different IP on the NIC , then tell PBS to use the correct hostname using PBS\_LEAF\_NAME.

---

<div class="post-metadata">

**Author:** ![boboshaq](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@boboshaq](https://community.openpbs.org/u/boboshaq)\
**Post date:** [June 16, 2021, 8:39am UTC](https://community.openpbs.org/t/pbs-primary-pbs-secondary-vs-pbs-leaf-name/2651/5 "2021-06-16T08:39:28Z")

</div>

Thanks for quickly respond.

> [@adarsh](#):
>
> then tell PBS to use the correct hostname using PBS\_LEAF\_NAME.

All this topic is about how to tell PBS to use the correct hostname using PBS\_LEAF\_NAME, so if I should do this, I need replace PBS\_PRIMARY and PBS\_SECONDARY attribute respectively to:  
PBS\_PRIMARY=comm\_h1  
PBS\_SECONDARY=comm\_h2  
in pbs.conf on both machines, yes ?

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [June 16, 2021, 11:30am UTC](https://community.openpbs.org/t/pbs-primary-pbs-secondary-vs-pbs-leaf-name/2651/6 "2021-06-16T11:30:18Z")

</div>

> [@boboshaq](#):
>
> All this topic is about how to tell PBS to use the correct hostname using PBS\_LEAF\_NAME,

Correct, if in case the intended name was not picked.

> [@boboshaq](#):
>
> I need replace PBS\_PRIMARY and PBS\_SECONDARY attribute respectively to:  
> PBS\_PRIMARY=comm\_h1  
> PBS\_SECONDARY=comm\_h2  
> in pbs.conf on both machines, yes ?

Correct

---

<div class="post-metadata">

**Author:** ![boboshaq](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@boboshaq](https://community.openpbs.org/u/boboshaq)\
**Post date:** [July 29, 2021, 1:04pm UTC](https://community.openpbs.org/t/pbs-primary-pbs-secondary-vs-pbs-leaf-name/2651/7 "2021-07-29T13:04:06Z")

</div>

> [@adarsh](#):
>
> > [@boboshaq](#):
> >
> > I need replace PBS\_PRIMARY and PBS\_SECONDARY attribute respectively to:
> > 
> > > PBS\_PRIMARY=comm\_h1  
> > > PBS\_SECONDARY=comm\_h2  
> > > in pbs.conf on both machines, yes ?
> 
> Correct

In failover configuration wrong!

> [@Comm daemon and failover](https://community.openpbs.org/t/comm-daemon-and-failover/2709/12):
>
> Without the 192.169.x.x network. So you need this: and this: This way, the value in PBS\_LEAF\_NAME matches the FQDN of the secondary host, secondary.domain exactly

on both servers and endpoints:  
PBS\_PRIMARY=h1.domain  
PBS\_SECONDARY=h2.domain

on primary  
PBS\_LEAF\_NAME=h1.domain  
on secondary:  
PBS\_LEAF\_NAME=h2.domain  
on endpoints:  
PBS\_LEAF\_NAME=hostname.domain
