Impact of modifying SSH ports on Oracle Clusters

Source: Internet
Author: User
Recently, some customers have asked me about the impact of SSH modification on oracleRAC. I have also read the documents about this problem and it has no impact on the running of the oracleRAC, but "speaking" is not powerful. Today, we are relatively idle. We will test SSH throughout the entire process, record the test process, and share it with you. PartI. Pre-test

Recently, some customers have asked me about the impact of SSH modification on oracle RAC. I have read the relevant materials and it has no impact on the running of oracle RAC, but "speaking" is not powerful. Today, we are relatively idle. We will test SSH throughout the entire process, record the test process, and share it with you. Part I. Test prefix

Recently, some customers have asked me about the impact of SSH modification on oracle RAC. I have read the relevant materials and it has no impact on the running of oracle RAC, but "speaking" is not powerful.

Today, we are relatively idle. We will test SSH throughout the entire process, record the test process, and share it with you.

Part I. Status collection before testing

1. The database version is two node RAC of 11.2.0.4, namely node111g and node211g.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing options

2. The cluster status is normal.

[grid@node111g ~]$ crsctl status res -t --------------------------------------------------------------------------------NAME TARGET STATE SERVER STATE_DETAILS--------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.DATA.dg               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.DGROUP_01.dg               ONLINE ONLINE node111g               OFFLINE OFFLINE node211gora.FRA.dg               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.LISTENER.lsnr               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.LISTENER_TEST.lsnr               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.OCR.dg               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.VOTE3D.dg               ONLINE ONLINE node111g               OFFLINE OFFLINE node211gora.asm               ONLINE ONLINE node111g Started               ONLINE ONLINE node211g Startedora.gsd               OFFLINE OFFLINE node111g               OFFLINE OFFLINE node211gora.net1.network               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.ons               ONLINE ONLINE node111g               ONLINE ONLINE node211g--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.TEST_SCAN1.lsnr      1 ONLINE ONLINE node111gora.cvu      1 ONLINE ONLINE node211gora.node111g.vip      1 ONLINE ONLINE node111gora.node211g.vip      1 ONLINE ONLINE node211gora.oc4j      1 ONLINE ONLINE node211gora.orcl.db      1 ONLINE ONLINE node111g Open      2 ONLINE ONLINE node211g Openora.orcl.romi.svc      1 ONLINE ONLINE node111gora.orcl.test.svc      1 ONLINE ONLINE node211g      2 ONLINE ONLINE node111gora.scan1.vip      1 ONLINE ONLINE node111g

3. In the SSH configuration file, the default SSH port is 22, which is mentioned in the file. We do not recommend modifying the default value, !!! I just want to change it. What should I do ??

[root@node111g ~]# more /etc/ssh/sshd_config# $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $# This is the sshd server system-wide configuration file. See# sshd_config(5) for more information.# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin# The strategy used for options in the default sshd_config shipped with# OpenSSH is to specify options with their default value where# possible, but leave them commented. Uncommented options change a# default value.#Port 22#Protocol 2,1Protocol 2#AddressFamily any#ListenAddress 0.0.0.0#ListenAddress ::......[root@node111g ~]#[root@node211g ~]# more /etc/ssh/sshd_config# $OpenBSD: sshd_config,v 1.73 2005/12/06 22:38:28 reyk Exp $# This is the sshd server system-wide configuration file. See# sshd_config(5) for more information.# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin# The strategy used for options in the default sshd_config shipped with# OpenSSH is to specify options with their default value where# possible, but leave them commented. Uncommented options change a# default value.#Port 22#Protocol 2,1Protocol 2#AddressFamily any#ListenAddress 0.0.0.0#ListenAddress ::# HostKey for protocol version 1#HostKey /etc/ssh/ssh_host_key# HostKeys for protocol version 2#HostKey /etc/ssh/ssh_host_rsa_key#HostKey /etc/ssh/ssh_host_dsa_key# Lifetime and size of ephemeral version 1 server key#KeyRegenerationInterval 1h

Part II Actual modification Part

1. We plan to change the port to 6001. First, we need to confirm whether the port is used.

[Root @ node211g ~] # Lsof-I: 22 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAMEsshd 4543 root 3u IPv4 16317 TCP *: ssh (LISTEN) sshd 16000 root 3r IPv4 57216374 TCP node211g: ssh-> node111g: 56437 (ESTABLISHED) <22 port bei ssh use sshd 16004 oracle 3u IPv4 57216374 TCP node211g: ssh-> node111g: 56437 (ESTABLISHED) sshd 17907 root 3r IPv4 57462432 TCP node211g: ssh-> node111g: 59861 (ESTABLISHED) sshd 17911 oracle 3u IPv4 57462432 TCP Node211g: ssh-> node111g: 59861 (ESTABLISHED) [root @ node211g ~] # Lsof-I: 1521 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAMEoracle 1437 oracle 14u IPv4 68052787 TCP node211g: 20651-> node-cluster-scan: ncube-lm (ESTABLISHED) <1521 Port scan uses oracle 14412 grid 15u IPv4 1313392 TCP node211g: 34873-> node-cluster-scan: ncube-lm (ESTABLISHED) tnslsnr 14882 grid 16u IPv4 1332718 TCP node211g: ncube-lm (LISTEN) tnslsnr 14882 grid 17u IPv4 1332719 TCP node211g-vip: ncube-lm ( LISTEN) [root @ node211g ~] # Lsof-I: Port 60016001 is not used

2. Add Port 6001 to the SSH configuration file on both nodes.

[Root @ node111g ~] # Vi/etc/ssh/sshd_config # Port 22 Port 6001 # Protocol 2, 1 Protocol 23. Restart the ssh service to bring the Port into effect [root @ node111g ~] # Service sshd restartStopping sshd: [OK] Starting sshd: [OK] [root @ node211g ~] # Service sshd restart Stopping sshd: [OK] Starting sshd: [OK] 4. view the port, which has been used by SSH [root @ node111g ~] # Lsof-I: 6001 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAMEsshd 28964 root 3u IPv4 111172702 TCP *: 6001 (LISTEN) [root @ node211g ~] # Lsof-I: 6001 COMMAND PID USER FD TYPE DEVICE SIZE NODE NAMEsshd 18371 root 3u IPv4 70993328 TCP *: 6001 (LISTEN) [root @ node211g ~] #5. port 22 cannot connect to [oracle @ node111g archive_log] $ ssh node111gssh: connect to host node111g port 22: Connection refused [oracle @ node111g archive_log] $ ssh node211gssh: connect to host node211g port 22: Connection refused

Impact of Part III testing on RAC

1. The connection through port 6001 is normal, and the RAC equivalence is not affected. Here, the SSH equivalence is not affected by the port.

It can be simply understood that node1 and node2 have the access key of the other party, as long as the other party has the access key, and do not care about the access from any port.

[oracle@node111g archive_log]$ ssh -p 6001 node211gLast login: Fri Dec 19 10:19:05 2014 from node111g[oracle@node211g ~]$ hostnamenode211g[oracle@node211g ~]$ exitlogoutConnection to node211g closed.

2. The port has been modified successfully. Check the crs status. Everything is normal.

[grid@node111g ~]$ crsctl status res -t--------------------------------------------------------------------------------NAME TARGET STATE SERVER STATE_DETAILS--------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.DATA.dg               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.DGROUP_01.dg               ONLINE ONLINE node111g               OFFLINE OFFLINE node211gora.FRA.dg               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.LISTENER.lsnr               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.LISTENER_TEST.lsnr               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.OCR.dg               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.VOTE3D.dg               ONLINE ONLINE node111g               OFFLINE OFFLINE node211gora.asm               ONLINE ONLINE node111g Started               ONLINE ONLINE node211g Startedora.gsd               OFFLINE OFFLINE node111g               OFFLINE OFFLINE node211gora.net1.network               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.ons               ONLINE ONLINE node111g               ONLINE ONLINE node211g--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.TEST_SCAN1.lsnr      1 ONLINE ONLINE node111gora.cvu      1 ONLINE ONLINE node211gora.node111g.vip      1 ONLINE ONLINE node111gora.node211g.vip      1 ONLINE ONLINE node211gora.oc4j      1 ONLINE ONLINE node211gora.orcl.db      1 ONLINE ONLINE node111g Open      2 ONLINE ONLINE node211g Openora.orcl.romi.svc      1 ONLINE ONLINE node111gora.orcl.test.svc      1 ONLINE ONLINE node211g      2 ONLINE ONLINE node111gora.scan1.vip      1 ONLINE ONLINE node111g

3. Start to restart CRS to check whether there is any impact and disable it.

[Root @ node211g ~] #/U01/app/11.2.0/grid/bin/crsctl stop crsCRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'node211g' has completedCRS-4133: oracle High Availability Services has been stopped.4. Start CRS... [root @ node111g ~] #/U01/app/11.2.0/grid/bin/crsctl start crs

5. The status is normal and can be started completely.

[grid@node111g ~]$ crsctl status res -t--------------------------------------------------------------------------------NAME TARGET STATE SERVER STATE_DETAILS--------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.DATA.dg               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.DGROUP_01.dg               ONLINE ONLINE node111g               OFFLINE OFFLINE node211gora.FRA.dg               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.LISTENER.lsnr               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.LISTENER_TEST.lsnr               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.OCR.dg               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.VOTE3D.dg               ONLINE ONLINE node111g               OFFLINE OFFLINE node211gora.asm               ONLINE ONLINE node111g Started               ONLINE ONLINE node211g Startedora.gsd               OFFLINE OFFLINE node111g               OFFLINE OFFLINE node211gora.net1.network               ONLINE ONLINE node111g               ONLINE ONLINE node211gora.ons               ONLINE ONLINE node111g               ONLINE ONLINE node211g--------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.TEST_SCAN1.lsnr      1 ONLINE ONLINE node111gora.cvu      1 ONLINE ONLINE node111gora.liyou.db      1 OFFLINE OFFLINE Instance Shutdown      2 OFFLINE OFFLINE Instance Shutdownora.node111g.vip      1 ONLINE ONLINE node111gora.node211g.vip      1 ONLINE ONLINE node211gora.oc4j      1 ONLINE ONLINE node111gora.orcl.db      1 ONLINE ONLINE node111g Open      2 ONLINE ONLINE node211g Openora.orcl.romi.svc      1 ONLINE ONLINE node111gora.orcl.test.svc      1 ONLINE ONLINE node211g      2 ONLINE ONLINE node111gora.scan1.vip      1 ONLINE ONLINE node111g

6. Check the data again. You can rest assured !!

$ sqlplus / as sysdbaOracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL> select username from dba_users;select username from dba_users;USERNAME------------------------------------------------------------------------------------------MGMT_VIEWSYSSYSTEMDBSNMPSYSMANSCOTT......38 rows selected.

Stage Summary: SSH is not used during normal operation after the database and GI are installed. oracle nodes communicate with each other through their own processes, through TCP and UDP communication, using SSH here does not affect the operation of the RAC database.

7. That !!! What if we make a patch? Hey !!

Unfortunately, this test database has applied the latest PSU 11.2.0.4.4, so we will uninstall it first ......

Cd $ ORACLE_HOME/OPatch [oracle @ node111g OPatch] $./opatch lsinventoryOracle Interim Patch Installer 11.2.0.3.6Copyright (c) 2013, Oracle Corporation. All rights reserved. Oracle Home:/u01/app/oracle/product/11.2.0/dbhome_1Central Inventory:/u01/app/oraInventory from:/u01/app/oracle/product/11.2.0/dbhome_1/oraInst. locOPatch version: 11.2.0.3.6OUI version: 11.2.0.4.0Log file location:/u01/app/oracle/product/11.2.0/dbhome_1/export toollogs/opatch/opatch2014-12-19_15-59-03 midday _ 1. logLsinventory Output file location:/u01/app/oracle/product/11.2.0/dbhome_1/export toollogs/opatch/lsinv/lsinventory2014-12-19_15-59-03 .txt export Oracle Database 11g 11.2.0.4.0 Patch 19121551: applied on Thu Nov 27 17:50:58 CST 2014 Unique Patch ID: 17949166 Patch description: "Database Patch Set Update: 11.2.0.4.4 (19121551) "<Created on 6 Oct 2014, 10:07:57 hrs PST8PDTSub-patch 18522509;" Database Patch Set Update: 11.2.0.4.3 (18522509) "Sub-patch 18031668; "Database Patch Set Update: 11.2.0.4.2 (18031668)" Sub-patch 17478514; "Database Patch Set Update: 11.2.0.4.1 (17478514)" Bugs fixed :...... patch 18031740: applied on Thu Nov 27 14:29:51 CST 2014 Unique Patch ID: 17253722 Patch description: "OCW Patch Set Update: 11.2.0.4.2 (18031740)" Created on 19 Mar 2014, 09:06:31 hrs PST8PDT Bugs fixed :...... local node = node111g Remote node = node211g ---------------------------------------------------------------------------- OPatch succeeded.

8. Rollback failed. This indicates that during the rollback process, if you want to perform operations on the peer node, you need to access the node through SSH. However, if the port is changed, the connection will fail.

Similarly, when applying a patch and adding or deleting a node, you also need to copy the file to the other node. This problem also occurs.

(I borrowed my colleague's test environment from Japanese, but I haven't changed it to English via LANG = en_US. This part is accompanied by Japanese. With the help of my colleague, I understand what it means. However, it is good to guess in Japanese. "delete" = "Delete" and "fail" do not need to be translated. Hey !!)

All-node error message = too many errors have been reported before using them '/u01/app/oracle/product/11.2.0/dbhome_1 /. patch_storage/NRollback/2014-12-19_16-49 after noon/rac/remove_files.txt.instantiated 'zookeeper zookeeper and zookeeper node211g' zookeeper too many requests. OPatch remote node node211g, delete the file fail. When the row is deleted successfully. [Y | n] yUser Responded with: YInstantiating the file "/u01/app/oracle/product/11.2.0/dbhome_1 /. patch_storage/NRollback/2014-12-19_16-49/rac/remove_dirs.txt.instantiated "by replacing $ ORACLE_HOME in"/u01/app/oracle/product/11.2.0/dbhome_1 /. patch_storage/NRollback/2014-12-19_16-49 after noon/rac/remove_dirs.txt "with actual path. removing directories on remote nodes... OPatch zookeeper has been removed before 'node211g' has been removed. In addition to loss of memory. Required Bytes: '/u01/app/oracle/product/11.2.0/dbhome_1 /. patch_storage/NRollback/2014-12-19_16-49 after noon/rac/remove_dirs.txt.instantiated 'zookeeper was removed when there are too many other users. [PRKC-1083: Specify zookeeper "node211g" zookeeper, "/u01/app/oracle/product/11.2.0/dbhome_1 /. patch_storage/NRollback/2014-12-19_16-49 after noon/rac/remove_dirs.txt.instantiated "indicates that the primary Primary Secondary. Slave slave node211g: PRKC-1044: zookeeper users/usr/bin/ssh zookeeper/usr/bin/rsh users use zookeeper node211g zookeeper when there are too many failures, when there is no loss <
 <使用 usr bin sshおよび rsh执行远端node211g命令检查失败。node211g: connection refused fail.< pre>
  

Part IV test the effect of modifying IP addresses on SSH equivalence

1. next we will test whether modifying the IP address will affect the SSH equivalence (note that modifying the private IP address must be done by synchronously adjusting the inter-connect network information recorded in GI, otherwise, the GI cannot communicate normally. oracle provides related documents to introduce how to modify the Public and Pricate IP addresses)

2. Start with the Private IP address. You only need to modify node node2.

# ifconfig eth2eth2 Link encap:Ethernet HWaddr 00:0C:29:4D:2D:D0          inet addr:10.0.0.2 Bcast:10.0.0.255 Mask:255.255.255.0          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1          RX packets:8739422 errors:0 dropped:0 overruns:0 frame:0          TX packets:11094020 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000          RX bytes:5201547204 (4.8 GiB) TX bytes:8400210712 (7.8 GiB) [root@node211g tmp]# more /etc/hosts# Do not remove the following line, or various programs# that require network functionality will fail.127.0.0.1 node211g localhost192.168.1.1 node111g192.168.1.2 node211g192.168.1.3 node111g-vip192.168.1.4 node211g-vip192.168.1.5 node-cluster-scan10.0.0.1 node111g-priv10.0.0.2 node211g-priv <<<<<<<<<<<<<<<<<<<

3. Change the Private IP address of the NIC to 10.0.0.12.

[root@node211g tmp]# ifconfig eth2 10.0.0.12 netmask 255.255.255.0

4. Check that the modification is successful.

[root@node211g tmp]# ifconfig eth2eth2 Link encap:Ethernet HWaddr 00:0C:29:4D:2D:D0          inet addr:10.0.0.12 Bcast:10.0.0.255 Mask:255.255.255.0          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1          RX packets:8744646 errors:0 dropped:0 overruns:0 frame:0          TX packets:11100718 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000          RX bytes:5204200949 (4.8 GiB) TX bytes:8404710975 (7.8 GiB)

5. after switching to the grid user test, we found that the password was still required during the first connection, but it was not required for the second connection. This indicates that SSH is equivalent and it will be affected after the IP address is changed, you need to record the authorization information for new IP login in the RSA file, but you do not need to reconfigure the equivalence.

[root@node211g tmp]# su - grid[grid@node211g ~]$ ssh -p 6001 10.0.0.1Last login: Mon Dec 22 10:34:07 2014 from node211g-priv[grid@node111g ~]$ ssh -p 6001 10.0.0.12The authenticity of host '10.0.0.12 (10.0.0.12)' can't be established.RSA key fingerprint is 9b:11:59:5b:0f:0d:85:17:94:0c:e0:76:be:c4:7e:9e.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '10.0.0.12' (RSA) to the list of known hosts.Last login: Thu Dec 18 14:45:30 2014 from dhcp-tokyo-twvpn-1-vpnpool-10-191-12-97.vpn.oracle.com[grid@node211g ~]$ exitlogoutConnection to 10.0.0.12 closed.[grid@node111g ~]$ ssh -p 6001 10.0.0.12Last login: Mon Dec 22 10:34:55 2014 from node111g-priv

At this point, this test ends, respectively testing the impact on RAC when the SSH port is changed. There is also the impact of modifying IP addresses on SSH equivalence.

------------ Test is persuasive !!! ------------

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.