Skip to content

Instantly share code, notes, and snippets.

@sercheo87
Last active June 7, 2019 19:39
Show Gist options
  • Save sercheo87/c5b39642b90652a1b1a955af5529ecf6 to your computer and use it in GitHub Desktop.
Save sercheo87/c5b39642b90652a1b1a955af5529ecf6 to your computer and use it in GitHub Desktop.
export JKS_PASS=Passw0rd
export JKS_ALIAS=jbosseap
export NAME_JKS=master
$JAVA_HOME/bin/keytool -genkeypair -alias $NAME_JKS -storetype jks -keyalg RSA -keysize 2048 -keypass $JKS_PASS -keystore /root/jboss/host-domain/domain/configuration/$NAME_JKS.jks -storepass $JKS_PASS -dname "CN=jbosseap,OU=Sales,O=Cobiscorp,L=Raleigh,ST=NC,C=US"
export JKS_PASS=Passw0rd
export JKS_ALIAS=jbosseap
export NAME_JKS=master
$JAVA_HOME/bin/keytool -genkeypair -alias $NAME_JKS -storetype jks -keyalg RSA -keysize 2048 -keypass $JKS_PASS -keystore /root/jboss/host-slave1/domain/configuration/$NAME_JKS.jks -storepass $JKS_PASS -dname "CN=jbosseap,OU=Sales,O=Cobiscorp,L=Raleigh,ST=NC,C=US"
export JKS_PASS=Passw0rd
export JKS_ALIAS=jbosseap
export NAME_JKS=master
$JAVA_HOME/bin/keytool -genkeypair -alias $NAME_JKS -storetype jks -keyalg RSA -keysize 2048 -keypass $JKS_PASS -keystore /root/jboss/host-slave2/domain/configuration/$NAME_JKS.jks -storepass $JKS_PASS -dname "CN=jbosseap,OU=Sales,O=Cobiscorp,L=Raleigh,ST=NC,C=US"
sh $JBOSS_HOME/bin/jboss-cli.sh --connect --controller=192.168.64.98:9999 --command='/host=master/core-service=management/security-realm=ApplicationRealm/server-identity=ssl:add(keystore-path=master.jks, keystore-relative-to=jboss.domain.config.dir, keystore-password=Passw0rd, alias=master)'
sh $JBOSS_HOME/bin/jboss-cli.sh --connect --controller=192.168.64.98:9999 --command='/host=host-slave1/core-service=management/security-realm=ApplicationRealm/server-identity=ssl:add(keystore-path=master.jks, keystore-relative-to=jboss.domain.config.dir, keystore-password=Passw0rd, alias=master)'
sh $JBOSS_HOME/bin/jboss-cli.sh --connect --controller=192.168.64.98:9999 --command='/host=host-slave2/core-service=management/security-realm=ApplicationRealm/server-identity=ssl:add(keystore-path=master.jks, keystore-relative-to=jboss.domain.config.dir, keystore-password=Passw0rd, alias=master)'
sh $JBOSS_HOME/bin/jboss-cli.sh --connect --controller=192.168.64.98:9999 --command="/host=master:reload"
sh $JBOSS_HOME/bin/jboss-cli.sh --connect --controller=192.168.64.98:9999 --command='/profile=full-ha/subsystem=undertow/server=default-server/https-listener=https:add(socket-binding=https, security-realm= ApplicationRealm)'
sh $JBOSS_HOME/bin/jboss-cli.sh --connect --controller=192.168.64.98:9999 --command='/profile=full-ha/subsystem=remoting/http-connector=http-remoting-connector:write-attribute(name=connector-ref,value=https)'
sh $JBOSS_HOME/bin/jboss-cli.sh --connect --controller=192.168.64.98:9999 --command='/core-service=management/access=authorization/role-mapping=Administrator:add'
sh $JBOSS_HOME/bin/jboss-cli.sh --connect --controller=192.168.64.98:9999 --command='/core-service=management/access=authorization/role-mapping=Administrator/include=ALIAS:add(name=cobismaster, realm=ApplicationRealm, type=USER)'
sh $JBOSS_HOME/bin/jboss-cli.sh --connect --controller=192.168.64.98:9999 --command='/profile=full-ha/subsystem=security/security-domain=ApplicationRealm:add(cache-type=default)'
sh $JBOSS_HOME/bin/jboss-cli.sh --connect --controller=192.168.64.98:9999 --command='/profile=full-ha/subsystem=security/security-domain=ApplicationRealm/authentication=classic:add(login-modules=[{"code"=>"UsersRoles", "flag"=>"required", "module-options"=>[("usersProperties"=>"application-users.properties"),("rolesProperties"=>"application-roles.properties")]}])'
rm -rf /root/jboss/host-domain/domain/log/* /root/jboss/host-domain/domain/servers/* *.log
nohup jboss-eap-7.0/bin/domain.sh --host-config=host-master.xml -Djboss.domain.base.dir=host-domain/domain/ -b=0.0.0.0 -bmanagement=0.0.0.0 -bprivate=0.0.0.0 > start-domain.log &
tail -f start-domain.log
rm -rf /root/jboss/host-slave1/domain/log/* /root/jboss/host-slave1/domain/servers/* *.log
nohup jboss-eap-7.0/bin/domain.sh --host-config=host-slave.xml -Djboss.domain.base.dir=host-slave1/domain/ -Djboss.domain.master.address=192.168.64.98 -b=0.0.0.0 -bmanagement=0.0.0.0 > start-slave-1.log &
tail -f start-slave-1.log
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment