frostfs-contract/docs/globally-unique-domain-zone.md
Alexander Chuprov ff2d165c28 [#114] nns: Add docs
Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
2024-09-27 17:51:29 +03:00

3.8 KiB

Globally unique domain zone

Make sure you understand the basic concepts of NNS.

Globally Unique Domains Zone (GUDZ) is an extension of NNS that ensures unique names across multiple domain zones. When this option is enabled, all newly created domains will automatically receive a corresponding alias in the designated global zone. Deleting a domain will also remove its alias from the global zone.

It's important to note that this feature is not retroactive: domains created before this option is enabled will not receive a global alias. Likewise, if the option is later disabled, domains that already have a GUDZ alias will retain their records. To fully disable GUDZ, all domains must be recreated with the option turned off.

To enable GUDZ, add a cnametgt=$(global domain) TXT record that specifies the global zone.

Example:

Domains:

  • poland
  • sweden
  • animals.org

It is necessary to associate the domain zones .poland and .sweden into the global zone .animals.

Create domains:

frostfs-adm morph nns register --name="poland" --email="email@email.email"
frostfs-adm morph nns register --name="sweden" --email="email@email.email"
frostfs-adm morph nns register --name="org" --email="email@email.email"
frostfs-adm morph nns register --name="animals.org" --email="email@email.email"

Add the cnametgt records:

frostfs-adm morph nns  add-record --name="poland" --data="cnametgt=animals.org" --type="txt" 
frostfs-adm morph nns  add-record --name="sweden" --data="cnametgt=animals.org" --type="txt" 

Create a domain with mapping to the global zone:

frostfs-adm morph nns register --name="bober.poland" --email="email@email.email"

Add any TXT record

frostfs-adm morph nns  add-record --name="bober.poland" --data="CID" --type="txt"

Verify that the created domain has alias in the global zone

frostfs-adm morph nns tokens -v

balance.frostfs
animals.org
group.frostfs
container
org
container.frostfs
proxy.frostfs
policy.frostfs
alphabet0.frostfs
sweden
frostfsid.frostfs
bober.animals.org (CNAME: bober.poland)
netmap.frostfs
frostfs
poland
bober.poland

Create of a conflicting domain

frostfs-adm morph nns register --name="bober.sweden" --email="email@email.email"

unable to register domain: script failed (FAULT state) due to an error: at instruction 1263 (THROW): unhandled exception: "global domain is already taken: bober.animals.org. Domain: bober.poland

Disable GUDZ Delete cnametgt records

frostfs-adm morph nns delete-records --type=txt --name=poland

Create hamster.poland and hamster.sweden

frostfs-adm morph nns register --name="hamster.poland" --email="email@email.email"
frostfs-adm morph nns register --name="hamster.sweden" --email="email@email.email"

hamster.poland and hamster.sweden does not have alias

frostfs-adm morph nns tokens -v
balance.frostfs
animals.org
group.frostfs
container
org
container.frostfs
proxy.frostfs
policy.frostfs
alphabet0.frostfs
sweden
frostfsid.frostfs
bober.animals.org (CNAME: bober.poland)
netmap.frostfs
frostfs
poland
bober.poland
hamster.poland

Delete global alias of bober.poland

 frostfs-adm morph nns delete-records --name="bober.poland" --type="txt"
frostfs-adm morph nns tokens -v
balance.frostfs
animals.org
group.frostfs
container
org
container.frostfs
proxy.frostfs
policy.frostfs
alphabet0.frostfs
sweden
frostfsid.frostfs
netmap.frostfs
frostfs
poland
bober.poland
hamster.poland

Delete bober.poland

 frostfs-adm morph nns delete --name="bober.poland"
frostfs-adm morph nns tokens -v
balance.frostfs
animals.org
group.frostfs
container
org
container.frostfs
proxy.frostfs
policy.frostfs
alphabet0.frostfs
sweden
frostfsid.frostfs
netmap.frostfs
frostfs
poland
hamster.poland