How to make connection to the database using teiid VDB in mod_cluster?
kulbhushanc Nov 17, 2016 12:56 AMI have created cluster using one master and one slave.
I am trying to make a connection with the help of jboss application user and not admin user, In server logs I can see VDB gets activated when I deployed it using admin user but when I am trying to make connection it throws an exception
org.teiid.jdbc.TeiidSQLException: TEIID20020 Error establishing socket to host and port: <IP_Address>:31000. Reason: Connection refused: connect
and code line is:
connection = DriverManager.getConnection("jdbc:teiid:" + VDBName + "@mm://" + IPAddress + ":" + port + ";", userName, password);
After this exception when I checked server logs on master and I found teiid instance acquire the port 31250 because of port-offset was set to 250 and on slave it was 31450, So I changed my configuration and 31250 is set to access teiid and it worked. Now Its time to check whether I can access VDB when master is not running so I shutdown it and it failed to connect to the database.
Later I created a demo dynamic web application zclusterDemo and deployed it on a master just to check if my configurations are correct it gets deployed on both the node and worked as well when master is completely down.
here it is how mod_cluster-manager page looks like, here I can see zclusterDemo application but not any VDB.
mod_cluster/1.3.1.Final
Auto Refresh show DUMP output show INFO output
Node slave_local:server-three-slave (ajp://<IP_Addr>:8459):
Enable Contexts Disable Contexts Stop Contexts
Balancer: main-server-group,LBGroup: ,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 65,Ttl: 60000000,Status: OK,Elected: 0,Read: 0,Transferred: 0,Connected: 0,Load: 100
Virtual Host 1:
Contexts:
/zclusterDemo, Status: ENABLED Request: 0 Disable Stop
Aliases:
localhost
default-host
Node master:server-three (ajp://<IP_Addr>:8259):
Enable Contexts Disable Contexts Stop Contexts
Balancer: main-server-group,LBGroup: ,Flushpackets: Off,Flushwait: 10000,Ping: 10000000,Smax: 65,Ttl: 60000000,Status: OK,Elected: 0,Read: 0,Transferred: 0,Connected: 0,Load: 100
Virtual Host 1:
Contexts:
/zclusterDemo, Status: ENABLED Request: 0 Disable Stop
Aliases:
localhost
default-host