集群启动与停止一键操作
集群往往横跨多台物理机器,每次启动停止需要分别连上多台机器,比较麻烦。
可以通过一个脚本来完成这些工作如下:
一两台机器为例,其中两个ManagedServer,一个Admin Server,一个Proxy Server。
Environment: Solaris 10 X86 + Weblogic 10.2
Configuration:
Weblogic user configuration:
Server1:
bash-3.00$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/weblogic/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/weblogic/.ssh/id_rsa.
Your public key has been saved in /export/home/weblogic/.ssh/id_rsa.pub.
The key fingerprint is:
6c:3a:d1:69:e1:aa:69:5d:c6:23:d9:96:6d:ba:cd:be weblogic@unknown
Server2:
bash-3.00$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/export/home/weblogic/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /export/home/weblogic/.ssh/id_rsa.
Your public key has been saved in /export/home/weblogic/.ssh/id_rsa.pub.
The key fingerprint is:
c0:c0:78:3b:8b:be:9e:1c:c7:73:3d:bc:60:ea:71:69 weblogic@unknown
Server1:
bash-3.00$ scp /export/home/weblogic/.ssh/id_rsa.pub Server2 IP:/export/home/weblogic/.ssh/authorized_keys
Password:
id_rsa.pub 100% |***************************************************| 226 00:00
Server2:
bash-3.00$ scp /export/home/weblogic/.ssh/id_rsa.pub Server1 IP:/export/home/weblogic/.ssh/authorized_keys
Password:
id_rsa.pub 100% |******************************************| 226 00:00
bash-3.00$
Start Cluster:
Use weblogic user to login:
bash-3.00$ start_ABC_cluster.sh
Stop Cluster:
bash-3.00$ stop_ABC_cluster.sh
Shell Script:
Start:
Stop: