1、创建domain模板
#创建域目录
mkdir /weblogic/bea12/user_projects/domains/mydomain -p
cd bea12/user_projects/domains/mydomain
#创建域模板
cat > mydomain.py << EOF
readTemplate("/weblogic/bea12/wlserver/common/templates/wls/wls.jar")
# Config AdminServer Listen Address and Port
cd('Servers/AdminServer')
#用set去重置domain管理服务的名称,这个生产中比较使用,比如一台部署多个domain的场景,方便服务查杀
set('Name','myServer')
#设置domain管理服务端口
set('ListenAddress','')
set('ListenPort', 8000)
# Config username and password of Console User
cd('/')
# 'Security/base_domain/User/weblogic' The 'weblogic' is username
cd('Security/base_domain/User/weblogic')
#domain的用户名密码,生产中密码要严肃点,这里随意了。
cmo.setName('weblogic')