Registry Name Service Options

These options allow the maintenance and interrogation of the Registry Name Services.

Usage

pbdbutil --svc [<options>] [ <file> <file> ...]
-u '{ "svcgname" : "name", params... }' Create/Update Registry Name Service Group.
-u '{ "cn" : "hname", params... }' Create/Update Registry Name Service Host.
-u '{ "cn" : "hname", "uuid" : "", params... }' Create/Update external Host in Registry Name Service.
     [--bycn hname] Specify existing common name to update (change to the cn and uuid specified in -u, optional)
-u '{ "svcgname" : "name", "cn" : "hname", params... }' Add/Update Registry Name Service Host to Service Group.
-g '{ "svcgname" : "name" }' Retrieve Registry Name Service Group information.
-g '{ "primary" : "name" }' Lookup the Primary Server within the Registry Name Service Group.
-g '{ "cn" : "name" }' Retrieve Registry Name Service Host information by host common name.
-g '{ "uuid" : "name" }' Retrieve Registry Name Service Host information by uuid.
-d '{ "svcgname" : "name" }' Delete Registry Name Service Group.
-d '{ "svcgname" : "name", "cn" : "name" }'

Remove a host from Registry Name Service Group.

After deleting a server from registry name service group (registry_name_service), execute the following command to force a service cache update on all servers and clients.

# pbadmin --scache -R --all

-d '{ "cn" : "name" }'

Delete Registry Name Service Host by host common name.

         [--remove] Remove the Registry Name Service Host completely from the database (optional).
-z <oldgrp> <newgrp> Rename Registry Name Service Group.
-l [<wildcard(s)>] List all the Registry Name Service Groups that match wildcard(s).
    -l Add an extra -l to list Servers in the Registry Name Service Group(s).
        -l Add a third -l to list all hosts in the Registry Name Service Groups.
-L [<wildcard(s)>] List all the Hosts that match wildcard(s).

    -L

Add an extra -L to list Service Group membership and role.
-p <svcgrp> <host

Promote host to primary service within the specified Registry Name Service Group.

After promoting a server in registry name service group (registry_name_service), execute the following command to force a service cache update on all servers and clients.

# pbadmin --scache -R --all

-N [[<cn> [<port>]] Create and initialize Primary Registry Name Service database.
-n Create new Registry Name Service database.
-m <msg> Specify message. Required for modification commands when change management enabled.

 

Recreate the Registry Name Service Database
# pbdbutil --svc -N --force
List Service Groups from Registry Name Service Database
# pbdbutil -P --svc -l

Result:

{
    "svcgid": 1,
    "svcgname": "registry_name_svc",
    "svc": "registry",
    "updated": "2016-06-09 15:42:33",
    "deleted": 0
}
{
    "svcgid": 2,
    "svcgname": "dfl_pb_policy_svc",
    "svc": "pbpolicy",
    "updated": "2016-06-09 15:42:33",
    "deleted": 0
}
{
    "svcgid": 3,
    "svcgname": "dfl_log_svc",
    "svc": "logsvr",
    "updated": "2016-06-09 15:42:33",
    "deleted": 0
}
{
    "svcgid": 4,
    "svcgname": "dfl_sudo_policy_svc",
    "svc": "sudopolicy",
    "updated": "2016-06-09 15:42:33",
"deleted": 0
}
List primary and secondary servers within the Service Groups
# pbdbutil -P --svc -l -l

Result:

{
    "svcgid": 1,
    "svcgname": "registry_name_svc",
    "svc": "registry",
    "updated": "2016-06-14 10:43:14",
    "deleted": 0,
    "svcs": [
{
    "svcgid": 1,
    "hostid": 1,
    "role": "primary",
    "created": "2016-06-14 10:43:14",
    "updated": "2016-06-14 09:43:14",
    "deleted": 0,
    "cn": "pbuild",
    "uuid": "969ecab2-93d8-4322-a8cf-6314457053bb",
    "fqdn": "pbuild",
    "addrs": [
    {
    "family": 4,
    "port": 24351,
    "addr": "192.168.16.138"
    }
    "tnlzone": 0
    }
    ]
    }
    {
    "svcgid": 2,
    "svcgname": "dfl_pb_policy_svc",
    "svc": "pbpolicy",
    "updated": "2016-06-14 10:43:14",
    "deleted": 0
    }
    {
    "svcgid": 3,
    "svcgname": "dfl_log_svc",
    "svc": "logsvr",
    "updated": "2016-06-14 10:43:14",
    "deleted": 0
    }
    {
    "svcgid": 4,
    "svcgname": "dfl_sudo_policy_svc",
    "svc": "sudopolicy",
    "updated": "2016-06-14 10:43:14",
    "deleted": 0
}
Retrieve specified Service Group
pbdbutil --svc -g '{ "svcgname" : "registry_name_svc" }'

Result:

{"svcgid":1,"svcgname":"registry_name_svc","svc":"registry","updated":"2016-06-06 16:56:53","deleted":0}
Retrieve Specified Host by "cn"
pbdbutil --svc -g '{ "cn" : "pbuild" }'

Result:

{"addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"cn":"pbuild","uuid":"969ecab2-93d8-4322-a8cf-6314457053bb","$
Retrieve Specified Host by "uuid"
pbdbutil --svc -g '{ "uuid" : "969ecab2-93d8-4322-a8cf-6314457053bb" }'

Result:

{"addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"cn":"pbuild","uuid":"969ecab2-93d8-4322-a8cf-6314457053bb","$
Retrieve Host Entry for the Primary of the Specified Service Group
pbdbutil --svc -g '{ "primary" : "registry_name_svc" }'

Result:

{"svcgid":1,"svcgname":"registry_name_svc","svc":"registry","updated":1465228621,"deleted":0,"hostid":1,"role":"primary","$
Retrieve Host Information for Specified Host
pbdbutil --svc -L pbuild

Result:

{"fqdn":"pbuild","cn":"pbuild","uuid":"969ecab2-93d8-4322-a8cf-6314457053bb","addrs":[{"addr":"192.168.16.138","family":4,$
List All Hosts
# pbdbutil -P --svc -L

Result:

{
"hostid": 1,
"cn": "pbuild",
"uuid": "969ecab2-93d8-4322-a8cf-6314457053bb",
"fqdn": "pbuild",
"addrs": [
{
"family": 4,
"port": 24351,
"addr": "192.168.16.138"
}
],
"tnlzone": 0,
"updated": 1465897394,
"deleted": 0
}
{
"hostid": 4,
"cn": "pbtest",
"uuid": "969ecab2-93d8-4322-a8cf-6314457053bf",
"fqdn": "pbtest",
"addrs": [
{
"family": 4,
"port": 24351,
"addr": "192.168.16.184"
}
],
"tnlzone": 0,
"updated": 1465898703,
"deleted": 0
}
Add a Specified Host ("cn" Common Name and "uuid" Are Required)
# pbdbutil --svc -u '{ "cn" : "pbtest" , "uuid" : "969ecab2-93d8-4322-a8cf-6314457053bf" }'
Add New Service Group
# pbdbutil --svc -u '{  "svcgname" : "foobar", "svc" : "logsvr" }'
Add Host to Service Group
# pbdbutil --svc -u '{ "svcgname" : "foobar", "cn" : "pbtest" }'
Delete Host
# pbdbutil --svc -d '{ "cn" : "pbtest" }'
Add Host to Service Group as Primary Server
# pbdbutil --svc -u '{ "svcgname" : "foobar", "cn" : "pbtest", "role" : "primary" }'
Delete Host When It Is a Primary
# pbdbutil --svc -d '{ "cn" : "pbtest" }'

4011.01 Host is a primary server. Please reassign primary before deleting host from service group, or use force on the $.

Delete the Service Group
# pbdbutil --svc -d '{ "svcgname" : "foobar" }' --force
Promote a Host That Is Currently a Secondary Server to a Primary Server
# pbdbutil --svc -p foobar pbtest