码迷,mamicode.com
首页 > Web开发 > 详细

Centos 7 Saltstack自动化部署weblogic 12c

时间:2017-11-18 12:48:53      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:centos7 saltstack weblogic12c 自动化部署域   集群   受管。   

# pwd

/etc/salt/base


# tree cluster/

cluster/

├── files

│   ├── creat.rsp             -------------1

│   ├── startSer01.sh      --------------2

│   └── startSer02.sh      -------------3

└── weblogic.sls             --------------4


1.creat.rsp

read template from "/home/weblogic/Oracle/Middleware/Oracle_Home/wlserver/common/templates/wls/wls.jar";

set JavaHome "/usr/java/jdk1.8.0_141";

set ServerStartMode "dev";

find Server "AdminServer" as AdminServer;

set AdminServer.ListenAddress "";

set AdminServer.ListenPort "7001";

create Cluster "Cluster-0" as Clustername1;


create Server "Server-1" as BASE;

set BASE.ListenAddress "";

set BASE.ListenPort "8001";

set BASE.cluster "Cluster-0";


create Server "Server-2" as BASE2;

set BASE2.ListenAddress "";

set BASE2.ListenPort "8002";

set BASE.cluster "Cluster-0";


find User "weblogic" as weblogic;

set weblogic.password "weblogic123";

write domain to "/home/weblogic/domains/jydomains";

close template;




2.startSer01.sh


#!/bin/bash

export  USER_MEM_ARGS="-Xms1024m -Xmx2048m -XX:PermSize=1024m"

pidb=$(ps -ef|grep java|grep ‘weblogic.Name=Server-1‘|awk ‘{print $2}‘)

echo ‘kill ‘$pidb

kill -9 $pidb 1>/dev/null

sleep 5

domains=/home/weblogic/domains/jydomains

cd $domains

./bin/startManagedWebLogic.sh Server-1 http://IP:7001 1>$domains/servers/Server-1/logs/Server-1.log  2>$domains/servers/Server-1/logs/Server-1-stderr.log &


3.startSer02.sh

#!/bin/bash

export  USER_MEM_ARGS="-Xms1024m -Xmx2048m -XX:PermSize=1024m"

pidb=$(ps -ef|grep java|grep ‘weblogic.Name=Server-2‘|awk ‘{print $2}‘)

echo ‘kill ‘$pidb

kill -9 $pidb 1>/dev/null

sleep 5

domains=/home/weblogic/domains/jydomains

cd $domains

./bin/startManagedWebLogic.sh Server-2 http://IP:7001 1>$domains/servers/Server-2/logs/Server-2.log  2>$domains/servers/Server-2/logs/Server-2-stderr.log &



4.weblogic.sls 

include:

  - weblogic.install



startSer01:

  file.managed:

    - name: /home/weblogic/domains/jydomains/startSer01.sh

    - source: salt://cluster/files/startSer01.sh

    - user: weblogic

    - group: weblogic

    - mode: 755


startSer02:

  file.managed:

    - name: /home/weblogic/domains/jydomains/startSer02.sh

    - source: salt://cluster/files/startSer02.sh

    - user: weblogic

    - group: weblogic

    - mode: 755


weblogic-service:

  file.managed:

    - name: /tmp/creat.rsp

    - source: salt://cluster/files/creat.rsp

    - user: weblogic

    - group: weblogic

    - mode: 755


  cmd.run:

    - name:  export  CONFIG_JVM_ARGS=‘-Djava.security.egd=file:/dev/urandom‘ &&  /home/weblogic/Oracle/Middleware/Oracle_Home/wlserver/common/bin/config.sh -mode=silent -silent_script=/tmp/creat.rsp & 

    - user: weblogic




# tree weblogic/

weblogic/

├── files

│   ├── fmw_12.2.1.2.0_infrastructure.jar     -----------1

│   ├── fmw_12.2.1.2.0_infrastructure.rsp    -----------2

│   ├── jdk-8u141-linux-x64.rpm                -----------3

│   └── oraInst.loc                                         ----------4

└── install.sls                                                 ---------5



1.fmw_12.2.1.2.0_infrastructure.jar

2.fmw_12.2.1.2.0_infrastructure.rsp

[ENGINE]

Response File Version=1.0.0.0.0

[GENERIC]

DECLINE_AUTO_UPDATES=true

MOS_USERNAME=

MOS_PASSWORD=<SECURE VALUE>

AUTO_UPDATES_LOCATION=

SOFTWARE_UPDATES_PROXY_SERVER=

SOFTWARE_UPDATES_PROXY_PORT=

SOFTWARE_UPDATES_PROXY_USER=

SOFTWARE_UPDATES_PROXY_PASSWORD=<SECURE VALUE>

ORACLE_HOME=/home/weblogic/Oracle/Middleware/Oracle_Home

INSTALL_TYPE=Fusion Middleware Infrastructure

MYORACLESUPPORT_USERNAME=

MYORACLESUPPORT_PASSWORD=<SECURE VALUE>

DECLINE_SECURITY_UPDATES=true

SECURITY_UPDATES_VIA_MYORACLESUPPORT=false

PROXY_HOST=

PROXY_PORT=

PROXY_USER=

PROXY_PWD=<SECURE VALUE>

COLLECTOR_SUPPORTHUB_URL=



3.jdk-8u141-linux-x64.rpm


4.oraInst.loc

inventory_loc=/home/weblogic/oraInventory

inst_group=weblogic


5.install.sls


include:

  - pkg.jdk-init


weblogic:

  group.present:

    - name: weblogic

    - gid: 2000

  user.present:

    - fullname: weblogic

    - shell: /bin/bash

    - password: ‘Pa$$w0rd‘

    - home: /home/weblogic

    - uid: 2000

    - gid: 2000

    


/tmp/oraInst.loc:

    file.managed:

    - source: salt://weblogic/files/oraInst.loc

    - mode: 755

    - user: weblogic

    - group: weblogic


/tmp/fmw_12.2.1.2.0_infrastructure.rsp:

  file.managed:

    - source: salt://weblogic/files/fmw_12.2.1.2.0_infrastructure.rsp

    - mode: 755

    - user: weblogic

    - group: weblogic


weblogic-install:

  file.managed:

    - name: /tmp/fmw_12.2.1.2.0_infrastructure.jar

    - source: salt://weblogic/files/fmw_12.2.1.2.0_infrastructure.jar

    - mode: 755

    - user: weblogic

    - group: weblogic


  cmd.run:

    - name: /usr/java/jdk1.8.0_141/bin/java  -jar /tmp/fmw_12.2.1.2.0_infrastructure.jar -silent -responseFile /tmp/fmw_12.2.1.2.0_infrastructure.rsp -invPtrLoc /tmp/oraInst.loc   & 

    - user: weblogic

    - require:

      - file: weblogic-install 


本文出自 “运维成长之路” 博客,请务必保留此出处http://pankuo.blog.51cto.com/8651697/1982971

Centos 7 Saltstack自动化部署weblogic 12c

标签:centos7 saltstack weblogic12c 自动化部署域   集群   受管。   

原文地址:http://pankuo.blog.51cto.com/8651697/1982971

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!