RAC节点层命令osnodes
语法:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
[grid@rac1 ~]$ olsnodes -h Usage: olsnodes [ [-n] [-i] [-s] [-t] [<node> | -l [-p]] | [-c] ] [-g] [-v] where -n print node number with the node name -p print private interconnect address for the local node -i print virtual IP address with the node name <node> print information for the specified node -l print information for the local node -s print node status - active or inactive -t print node type - pinned or unpinned -g turn on logging -v Run in debug mode; use at direction of Oracle Support only. -c print clusterware name [grid@rac1 ~]$ |
测试如下:
1:olsnodes不任何参数,显示节点名
1 2 3 4 |
[grid@rac1 ~]$ olsnodes rac1 rac2 [grid@rac1 ~]$ |
2:[-n] 打印节点编号和节点名
1 2 3 4 |
[grid@rac1 ~]$ olsnodes -n rac1 1 rac2 2 [grid@rac1 ~]$ |
3:[-l] 显示本地节点信息
1 2 3 |
[grid@rac1 ~]$ olsnodes -l rac1 [grid@rac1 ~]$ |
4:[p] 显示私有IP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
[grid@rac1 ~]$ olsnodes -l -p rac1 192.168.100.101 [grid@rac1 ~]$ ##帮助信息中[<node> | -l [-p]],这段可以这样理解<node> [-p]或[-l][-p],当然也可以理解为<node> 或 -l [-p] ##可能是环境的问题<node> [-p]这个组合执行不了 [grid@rac1 ~]$ olsnodes rac2 rac2 [grid@rac1 ~]$ olsnodes rac2 -p Usage: olsnodes [ [-n] [-i] [-s] [-t] [<node> | -l [-p]] | [-c] ] [-g] [-v] where -n print node number with the node name -p print private interconnect address for the local node -i print virtual IP address with the node name <node> print information for the specified node -l print information for the local node -s print node status - active or inactive -t print node type - pinned or unpinned -g turn on logging -v Run in debug mode; use at direction of Oracle Support only. -c print clusterware name [grid@rac1 ~]$ |
5:[-i]打印虚拟 IP 名和节点名
1 2 3 4 |
[grid@rac1 ~]$ olsnodes -i rac1 rac1-vip rac2 rac2-vip [grid@rac1 ~]$ |
6:[-s]打印节点状态active or inactive
1 2 3 4 |
[grid@rac1 ~]$ olsnodes -s rac1 Active rac2 Active [grid@rac1 ~]$ |
7:[-t]打印节点类型pinned or unpinned
1 2 3 4 5 6 7 8 9 10 11 12 |
[grid@rac1 ~]$ olsnodes -t rac1 Unpinned rac2 Unpinned [grid@rac1 ~]$ ##注:11.2 RAC安装的时候默认都是UNPINNED状态,但如果是从旧版本升级到11.2,这样的话它的状态是PINNED,如果我们想删除一个节点,需要把它改成UNPINNED状态。 ##如果状态为pinned,那么需要执行下面命令crsctl unpin css -n <node1>,帮助信息如下: [grid@rac1 ~]$ crsctl unpin -h Usage: crsctl unpin css -n <node1>[...] Unpin the nodes (allow leases to expire). [grid@rac1 ~]$ |
8:[-c]打印集群名称
1 2 3 |
[grid@rac1 ~]$ olsnodes -c rac-cluster [grid@rac1 ~]$ |
9:组合用法
1 2 3 4 5 6 7 |
[grid@rac1 ~]$ olsnodes -n -i -s -t -l -p rac1 1 192.168.100.101 rac1-vip Active Unpinned [grid@rac1 ~]$ [grid@rac1 ~]$ olsnodes -n -i -s -t rac1 1 rac1-vip Active Unpinned rac2 2 rac2-vip Active Unpinned [grid@rac1 ~]$ |