{"id":116,"date":"2012-10-24T00:01:32","date_gmt":"2012-10-23T22:01:32","guid":{"rendered":"http:\/\/www.dolicapax.org\/?p=116"},"modified":"2012-10-24T12:22:51","modified_gmt":"2012-10-24T10:22:51","slug":"adding-an-additional-listener-to-oda","status":"publish","type":"post","link":"https:\/\/www.dolicapax.org\/?p=116","title":{"rendered":"Adding an additional listener to ODA"},"content":{"rendered":"<p>After deploying an Oracle Database Appliance, a standard set of production listeners are configured on <em>bond0.<\/em> This includes one listener on each of the virtual ip interfaces, and two SCAN listeners.<\/p>\n<p>In my environment, I would very much like to have additional listeners on <em>bond1. <\/em>I use this as a management network, and find it convenient to let DBAs and operators run their tools over this network.<\/p>\n<p>According to Oracle Support, there should not be any special considerations on ODA, and thus we can follow support note ID\u00a01063571.1 just like we would with any other 11gR2 RAC\u00a0infrastructure.<\/p>\n<p>In my humble opinion, this particular support note isn&#8217;t too clear even if you have access to My Oracle Support, so I&#8217;ll describe the steps I used for my setup:<\/p>\n<p>Production network on bond0 is 10.20.30.0\/24<br \/>\nManagement network on bond1 is 192.168.0.0\/24<\/p>\n<p>First out we need host file entries on both nodes for the new VIP interfaces:<\/p>\n<blockquote><p>\/etc\/hosts:<\/p>\n<p># VIP HOSTNAMES<br \/>\n10.20.30.42 oda1-vip.dolicapax.org oda1-vip<br \/>\n10.20.30.43 oda2-vip.dolicapax.org oda2-vip<\/p>\n<p><strong>192.168.0.23 oda1m-vip.dolicapax.org oda1m-vip<\/strong><br \/>\n<strong>192.168.0.24 oda2m-vip.dolicapax.org oda2m-vip<\/strong><\/p><\/blockquote>\n<p>Next we add the virtual ip interfaces to CRS. The network resource (specified with the -k 2 option) should be create implicitly:<\/p>\n<blockquote><p>&nbsp;<\/p>\n<p>su &#8211; root<br \/>\ncd\u00a0\/u01\/app\/11.2.0.3\/grid\/bin\/<br \/>\n.\/srvctl add vip -n oda1 -k 2 -A 192.168.0.23\/255.255.255.0\/bond1<br \/>\n.\/srvctl add vip -n oda2 -k 2 -A 192.168.0.24\/255.255.255.0\/bond1<\/p><\/blockquote>\n<p>We can verify that the network resource and the virtual ip interfaces have been created with <em>crsctl:<\/em><\/p>\n<blockquote><p>[root@oda1 bin]# .\/crsctl stat res -t |grep -E &#8216;net|vip&#8217;<br \/>\nora.net1.network<br \/>\n<strong>ora.net2.network<\/strong><br \/>\nora.oda1.vip<br \/>\n<strong>ora.oda1m-vip.vip<\/strong><br \/>\nora.oda2.vip<br \/>\n<strong>ora.oda2m-vip.vip<\/strong><br \/>\nora.scan1.vip<br \/>\nora.scan2.vip<\/p><\/blockquote>\n<p>The final step is to create the actual listener. Oracle reccomends that you do this with the \u00a0network configuration assistant <em>netca.\u00a0<\/em>The command must be run from the grid user.<\/p>\n<blockquote><p>roy@kayna:~$ ssh oda1 -l grid -X<br \/>\ngrid@oda1&#8217;s password:<br \/>\nLast login: Tue Oct 23 22:15:41 2012 from 192.168.0.46<br \/>\n\/usr\/bin\/xauth: creating new authority file \/home\/grid\/.Xauthority<br \/>\n[grid@oda1 ~]$ netca<\/p><\/blockquote>\n<p>Just select <em>Listener confguration<\/em> and then <em>Add<\/em> and walk through the wizard, selecting the correct network resource (subnet) along the way. Note that <em>netca<\/em>\u00a0sees the original listener on\u00a0\u00a0default port of 1521, and will not allow another on the same port. I went with a name of LISTENER_M and a port of 1522 for my configuration.<\/p>\n<p>This will take care of both listener.ora and OCR configuration.<\/p>\n<p>However, I really do want the new listener to be listening the default port of 1521. <em>netca\u00a0<\/em>complains that another listener is already configured on this port, even though it&#8217;s not on the same interface. The workaround is to manually remove and recreate the listener with srvctl using the -s option.<\/p>\n<blockquote><p>su &#8211; grid<br \/>\nsrvctl stop listener -l LISTENER_M<br \/>\nsrvctl remove listener LISTENER_M<br \/>\nsrvctl add listener -l LISTENER_M -s -p 1521 -k 2<br \/>\nsrvctl start listener -l LISTENER_M<\/p><\/blockquote>\n<p>We&#8217;re all set, and can now see the new listener (along with the default listeners) on the correct interface and port using <em>netstat<\/em>.<\/p>\n<blockquote><p>[grid@oda1 ~]$ netstat -ln | grep 1521<br \/>\n<strong>tcp 0 0 192.168.0.23:1521 0.0.0.0:* LISTEN<\/strong><br \/>\ntcp 0 0 10.20.30.32:1521 0.0.0.0:* LISTEN<br \/>\ntcp 0 0 10.20.30.30:1521 0.0.0.0:* LISTEN<br \/>\ntcp 0 0 10.20.30.34:1521 0.0.0.0:* LISTEN<br \/>\n[grid@oma1 ~]$ ssh oma2<br \/>\n[grid@oma2 ~]$ netstat -ln | grep 1521<br \/>\n<strong>tcp 0 0 192.168.0.24:1521 0.0.0.0:* LISTEN\u00a0<\/strong><br \/>\ntcp 0 0 10.20.30.33:1521 0.0.0.0:* LISTEN<br \/>\ntcp 0 0 10.20.30.31:1521 0.0.0.0:* LISTEN<br \/>\ntcp 0 0 10.20.30.35:1521 0.0.0.0:* LISTEN<\/p><\/blockquote>\n<p>or with lsnrctl<\/p>\n<blockquote><p>[grid@oda2 ~]$ lsnrctl status LISTENER_M<\/p>\n<p>LSNRCTL for Linux: Version 11.2.0.3.0 &#8211; Production on 23-OCT-2012 22:47:00<\/p>\n<p>Copyright (c) 1991, 2011, Oracle. All rights reserved.<\/p>\n<p>Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_M)))<br \/>\nSTATUS of the LISTENER<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>\nAlias LISTENER_M<br \/>\nVersion TNSLSNR for Linux: Version 11.2.0.3.0 &#8211; Production<br \/>\nStart Date 23-OCT-2012 22:36:49<br \/>\nUptime 0 days 0 hr. 10 min. 13 sec<br \/>\nTrace Level off<br \/>\nSecurity ON: Local OS Authentication<br \/>\nSNMP OFF<br \/>\nListener Parameter File \/u01\/app\/11.2.0.3\/grid\/network\/admin\/listener.ora<br \/>\nListener Log File \/u01\/app\/11.2.0.3\/grid\/log\/diag\/tnslsnr\/oda2\/listener_m\/alert\/log.xml<br \/>\nListening Endpoints Summary&#8230;<br \/>\n(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_M)))<br \/>\n(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.24)(PORT=1521)))<br \/>\nThe listener supports no services<br \/>\nThe command completed successfully<\/p><\/blockquote>\n<p>As you can see, the listener is up but supporting no services. Unless we want this to be a static listener, we need to tell the database to make it&#8217;s presence known.<\/p>\n<p>We accomplish this by using the new LISTENER_NETWORKS parameter.<\/p>\n<blockquote><p>SQL&gt; alter system set listener_networks = &#8216;((NAME=MGMT_NET)(LOCAL_LISTENER=oda1m-vip:1521)(REMOTE_LISTENER=oda2m-vip:1521))&#8217; SID=&#8217;testdb1&#8242; SCOPE=both;<\/p>\n<p>System altered.<\/p>\n<p>SQL&gt; alter system set listener_networks = &#8216;((NAME=MGMT_NET)(LOCAL_LISTENER=oda2m-vip:1521)(REMOTE_LISTENER=oda1m-vip:1521))&#8217; SID=&#8217;testdb2&#8242; scope=both;<\/p>\n<p>System altered.<\/p><\/blockquote>\n<p>A new look at the listener status will show that the instances are now properly registered:<\/p>\n<blockquote><p>Services Summary&#8230;<br \/>\nService &#8220;TESTDB&#8221; has 2 instance(s).<br \/>\nInstance &#8220;TESTSB1&#8221;, status READY, has 1 handler(s) for this service&#8230;<br \/>\nInstance &#8220;TESTDB2&#8221;, status READY, has 1 handler(s) for this service&#8230;<br \/>\nThe command completed successfully<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After deploying an Oracle Database Appliance, a standard set of production listeners are configured on bond0. This includes one listener on each of the virtual ip interfaces, and two SCAN listeners. In my environment, I would very much like to &hellip; <a href=\"https:\/\/www.dolicapax.org\/?p=116\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19,20,4],"tags":[26,35,25,18,24],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-oda-oracle","category-oracle","category-tech","tag-11gr2","tag-listener","tag-network","tag-oda","tag-oracle-2"],"_links":{"self":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=116"}],"version-history":[{"count":7,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":123,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions\/123"}],"wp:attachment":[{"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dolicapax.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}