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. It is determined by the value of the tenant system variable ob_tcp_invited_nodes, which by default is set to the local IP address. You can customize the tenant allowlist according to business needs. The system supports the following 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 as 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 as therootuser.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 as 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 in again for the modification 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.% | +----------------------+------------+