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. |
# pbdbutil --svc -N --force
# 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 }
# 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 }
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}
pbdbutil --svc -g '{ "cn" : "pbuild" }'
Result:
{"addrs":[{"family":4,"addr":"192.168.16.138","port":24351}],"cn":"pbuild","uuid":"969ecab2-93d8-4322-a8cf-6314457053bb","$
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","$
pbdbutil --svc -g '{ "primary" : "registry_name_svc" }'
Result:
{"svcgid":1,"svcgname":"registry_name_svc","svc":"registry","updated":1465228621,"deleted":0,"hostid":1,"role":"primary","$
pbdbutil --svc -L pbuild
Result:
{"fqdn":"pbuild","cn":"pbuild","uuid":"969ecab2-93d8-4322-a8cf-6314457053bb","addrs":[{"addr":"192.168.16.138","family":4,$
# 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 }
# pbdbutil --svc -u '{ "cn" : "pbtest" , "uuid" : "969ecab2-93d8-4322-a8cf-6314457053bf" }'
# pbdbutil --svc -u '{ "svcgname" : "foobar", "svc" : "logsvr" }'
# pbdbutil --svc -u '{ "svcgname" : "foobar", "cn" : "pbtest" }'
# pbdbutil --svc -d '{ "cn" : "pbtest" }'
# pbdbutil --svc -u '{ "svcgname" : "foobar", "cn" : "pbtest", "role" : "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 $.
# pbdbutil --svc -d '{ "svcgname" : "foobar" }' --force
# pbdbutil --svc -p foobar pbtest