Through the tenant allowlist feature, you can set which clients are allowed to access the current tenant.
Background information
The tenant allowlist is a list of clients that are allowed to log in to the tenant, which is specified by the tenant's system variable ob_tcp_invited_nodes. You can customize the tenant allowlist according to your business requirements. The system supports the following IP address formats for the tenant allowlist:
Regular IP address format, for example
10.10.10.10,10.10.10.11Subnet/mask format, for example
10.10.10.0/24Fuzzy matching format, for example
10.10.10.%or10.10.10._Mixed format, for example
10.10.10.10, 10.10.10.11, 10.10.10.%, 10.10.10._, 10.10.10.0/24
View the tenant allowlist
Log in to the database using the tenant administrator.
obclient -h172.30.xx.xx -P2883 -uroot@mq_t1#cluster -AView the tenant allowlist.
obclient> SHOW VARIABLES LIKE 'ob_tcp_invited_nodes'; +----------------------+-------+ | Variable_name | Value | +----------------------+-------+ | ob_tcp_invited_nodes | % | +----------------------+-------+
Set the tenant allowlist
The tenant allowlist can be set by the administrator of the sys tenant or the administrator of the current tenant.
Set the tenant allowlist using the administrator of the sys tenant
Log in to the
systenant of the cluster using the root user.obclient -h172.30.xx.xx -P2883 -uroot@sys#cluster -p**** -AModify the allowlist configuration of the tenant.
obclient> ALTER TENANT mq_t1 VARIABLES ob_tcp_invited_nodes = '10.10.10.%';
Set the tenant allowlist using the administrator of the current tenant
Log in to the database using the tenant administrator.
obclient -h172.30.xx.xx -P2883 -uroot@mq_t1#cluster -AModify the allowlist configuration of the tenant.
obclient> SET GLOBAL ob_tcp_invited_nodes='10.10.10.%';After the modification, exit the current session and log on again for the modifications to take effect.
View the modification result.
obclient> SHOW VARIABLES LIKE 'ob_tcp_invited_nodes'; +----------------------+------------+ | Variable_name | Value | +----------------------+------------+ | ob_tcp_invited_nodes | 10.10.10.% | +----------------------+------------+