{question}
From client connection to the database, how can I check which TE I am connected to?
{question}
{answer}
In case of a multiple TEs system, a connection to the database using nuosql process will choose the current available TE randomly.
There are two options that could be helpful to understand which TE the client is connected to.
(Option 1) Check ID column in system.nodes table:
$ /opt/nuodb/bin/nuosql <db_name> --user <db_user> --password <db_password>
SQL> select * from system.nodes where localid = 0;
ID LOCALID PORT ADDRESS HOSTNAME STATE TYPE CONNSTATE MSGQSIZE TRIPTIME GEOREGION PLATFORM_VER RELEASE_VER
--- -------- ----- ---------- --------- ------- ----------- ---------- --------- --------- ---------- ------------- ------------------
2 0 48007 172.17.0.4 localhost Running Transaction Ready 0 0 0 1245184 3.4.2-2-44245c06ec
(Option 2) Use GETNODEID() system function:
SQL> select GETNODEID() from dual;
GETNODEID
----------
2
From this example, we are currently connected to node ID=2.
More information can be found here and here.
{answer}
Comments