Document Type | Technical Information
Category | Administration
Applicable Product Versions | T6, T7
Document Number | TADTI169
Overview
In Tibero, the Listener is the process that accepts connection requests to the DBMS.
The Listener receives connection requests through the LISTENER_PORT.
Previously, only one LISTENER_PORT could be configured, but with this feature, multiple LISTENER_PORT settings are possible.
Method
Feature Test
Dynamic Listener Port Allocation and Release
ALTER SYSTEM LISTENER ADD|DELETE PORT [port_to_use] syntax can be used to configure this.
1. Add Listener Port Allocation
$tbsql sys/tibero
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> ALTER SYSTEM LISTENER ADD PORT 2527;
System altered.
2. Check port status with netstat
$ netstat -nap | grep tblistener
tcp 0 0 0.0.0.0:1527 0.0.0.0:* LISTEN 1726840/tblistener
tcp 0 0 0.0.0.0:2527 0.0.0.0:* LISTEN 1726840/tblistener
3. Register new port connection info in $TB_HOME/client/config/tbdsn.tbr file
#-------------------------------------------------
# /tibero/user/seungah_ham/test/tibero7/client/config/tbdsn.tbr
# Network Configuration File.
TEST=(
(INSTANCE=(HOST=localhost)
(PORT=1527)
(DB_NAME=TEST)
)
)
TEST_2=(
(INSTANCE=(HOST=localhost)
(PORT=2527)
(DB_NAME=TEST)
)
)
4. Confirm normal connection to new port
$tbsql sys/tibero@TEST_2
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero using TEST_2.
5. Check connection status with netstat
netstat -na | grep 2527
tcp 0 0 0.0.0.0:2527 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2527 127.0.0.1:57728 ESTABLISHED
tcp 0 0 127.0.0.1:57728 127.0.0.1:2527 ESTABLISHED
6. Release the allocated port
-- It can be performed even if there are sessions connected to the port to be deleted.
-- Existing sessions remain connected.
$tbsql sys/tibero
tbSQL 7
TmaxTibero Corporation Copyright (c) 2020-. All rights reserved.
Connected to Tibero.
SQL> ALTER SYSTEM LISTENER DELETE PORT 2527;
System altered.
7. Check port status with netstat
$ netstat -nap | grep tblistener
tcp 0 0 0.0.0.0:1527 0.0.0.0:* LISTEN 1726840/tblistener
Static Listener Port Allocation and Release
You can assign desired ports by adding the EXTRA_LISTENER_PORTS parameter in the TIP file.
1. Modify TIP file
-- Multiple ports can be set using ; as a delimiter
$ vi $TB_HOME/config/$TB_SID.tip
... (omitted) ...
DB_NAME=TEST
LISTENER_PORT=1527
EXTRA_LISTENER_PORTS=2527;3527;
... (omitted) ...
2. Restart required (TIP file applies on restart)
$ tbdown immediate
$ tbboot
3. Check port status with netstat
$ netstat -nap | grep tblistener
tcp 0 0 0.0.0.0:1527 0.0.0.0:* LISTEN 390518/tblistener
tcp 0 0 0.0.0.0:2527 0.0.0.0:* LISTEN 390518/tblistener
tcp 0 0 0.0.0.0:3527 0.0.0.0:* LISTEN 390518/tblistener
Listener Process Restart Function
Be cautious as the DB may go down if background processes other than the Listener process are terminated.
1. Check tblistener process PID using ps -fu command
$ ps -fu $USER | grep tblistener
UID PID PPID C STIME TTY TIME CMD
tibero 390518 390517 0 16:26 pts/11 00:00:00 /tibero/user/seungah_ham/test/tibero7/bin/tblistener -n 11 -t NORMAL -SVR_SID TEST
2. Force kill tblistener process using kill -9 command
$ kill -9 390518
3. Confirm it restarts
$ Listener port = 1527
$ ps -fu $USER | grep tblistener
tibero 397246 390517 0 16:43 pts/11 00:00:00 /tibero/user/seungah_ham/test/tibero7/bin/tblistener -n 11 -t NORMAL -SVR_SID TEST