所有节点分发/etc/hosts,这里我添加两个节点,一个是上次删除的节点,另一个是什么都没有的节点,尝试添加
服务器介绍什么的都在这hosts文件了,大家自己琢磨下
[grid@node1 ~]$ cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.0.194 node2
192.168.0.193 node1
192.168.0.196 node3
192.168.0.183 node1vip
192.168.0.182 node2vip
192.168.0.185 node3vip
172.168.0.196 node3prv
172.168.0.194 node2prv
172.168.0.193 node1prv
192.168.0.176 dbscan
192.168.0.16 standby
二,添加节点(一)---弃用方案
01,验证节点通信
./runSSHSetup.sh -user grid -hosts "node1 node2" -advanced -noPromptPassphrase
./runSSHSetup.sh -user Oracle -hosts "node1 node2" -advanced -noPromptPassphrase
[oracle@node1 bin]$ pwd
/oracle/app/oracle/product/11.2.0/db_1/oui/bin
[oracle@node1 bin]$ ls
addLangs.sh detachHome.sh filesList.sh runConfig.sh runSSHSetup.sh
addNode.sh filesList.bat lsnodes runInstaller
attachHome.sh filesList.properties resource runInstaller.sh
[oracle@node1 bin]$ ./runSSHSetup.sh -user grid -hosts "node1 node2" -advanced -noPromptPassphrase
This script will setup SSH Equivalence from the host 'node1' to specified remote hosts.
ORACLE_HOME = /oracle/app/oracle/product/11.2.0/db_1
JAR_LOC = /oracle/app/oracle/product/11.2.0/db_1/oui/jlib
SSH_LOC = /oracle/app/oracle/product/11.2.0/db_1/oui/jlib
OUI_LOC = /oracle/app/oracle/product/11.2.0/db_1/oui
JAVA_HOME = /oracle/app/oracle/product/11.2.0/db_1/jdk
Checking if the remote hosts are reachable.
ClusterLogger - log file location: /oracle/app/oracle/product/11.2.0/db_1/oui/bin/Logs/remoteInterfaces2019-03-14_04-52-46-PM.log
Failed Nodes : node1 node2
Remote host reachability check succeeded.
All hosts are reachable. Proceeding further...
NOTE :
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. You may be prompted for
the password during the execution of the script.
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEDGES TO THESE
directories.
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
If The files containing the client public and private keys already exist on the local host. The current private key may or may not have a passphrase associated with it. In case you remember the passphrase and do not want to re-run ssh-keygen, type 'no'. If youtype 'yes', the script will remove the old private/public key files and, any previous SSH user setups would be reset.
Enter 'yes', 'no'
yes
Enter the password:
Logfile Location : /oracle/app/oracle/product/11.2.0/db_1/oui/bin/SSHSetup2019-03-14_04-52-54-PM
Checking binaries on remote hosts...
Doing SSHSetup...
Please be patient, this operation might take sometime...Dont press Ctrl+C...
ClusterLogger - log file location: /oracle/app/oracle/product/11.2.0/db_1/oui/bin/Logs/remoteInterfaces2019-03-14_04-52-54-PM.log
Plugin : oracle.sysman.prov.remoteinterfaces.plugins.RemoteCommandSSH found in class path
Changing Default Plugin from : oracle.sysman.prov.remoteinterfaces.plugins.RemoteCommandSSH to : oracle.sysman.prov.remoteinterfaces.plugins.RemoteCommandSSH
Local Platform:- Linux
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user grid.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~grid or ~grid/.ssh on the remote host may not be owned by grid.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the <OMS HOME>/sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--node1:--
Running /usr/bin/ssh -x -l grid node1 date to verify SSH connectivity has been setup from local host to node1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
grid@node1's password:
Thu Mar 14 16:53:35 CST 2019
------------------------------------------------------------------------
--node2:--
Running /usr/bin/ssh -x -l grid node2 date to verify SSH connectivity has been setup from local host to node2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
grid@node2's password:
Thu Mar 14 16:53:38 CST 2019
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from node1 to node1
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
grid@node1's password:
bash: -c: line 0: unexpected EOF while looking for matching `"'
bash: -c: line 1: syntax error: unexpected end of file
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from node1 to node2
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
grid@node1's password:
bash: -c: line 0: unexpected EOF while looking for matching `"'
bash: -c: line 1: syntax error: unexpected end of file
------------------------------------------------------------------------
-Verification from complete-
SSH verification complete.
[oracle@node1 bin]$ ./runSSHSetup.sh -user oracle -hosts "node1 node2" -advanced -noPromptPassphrase
This script will setup SSH Equivalence from the host 'node1' to specified remote hosts.