-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure-server-b.cli
37 lines (27 loc) · 2.67 KB
/
configure-server-b.cli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#Script to configure server-a
echo Configure Service Name
:write-attribute(name=name,value=service-a)
echo Add postgres module
module add --name=org.postgresql.jdbc --resources=${SERVERS_ROOT}/postgresql-42.7.3.jar --dependencies=java.se,jakarta.transaction.api
echo Create postgres driver
/subsystem=datasources/jdbc-driver=postgresql:add(driver-name=postgresql,driver-module-name=org.postgresql.jdbc,driver-xa-datasource-class-name=org.postgresql.xa.PGXADataSource)
#echo Reload after define postgresql driver
#reload
echo Create xa-data-source
xa-data-source add --name=postgresqlXA --jndi-name=java:jboss/datasources/postgresdsXA --driver-name=postgresql --xa-datasource-class=org.postgresql.xa.PGXADataSource --user-name=wildfly --password=password --min-pool-size=1 --max-pool-size=100 --valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLValidConnectionChecker --validate-on-match=true --background-validation=false --exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.postgres.PostgreSQLExceptionSorter --xa-datasource-properties={"ServerName"=>"localhost","DatabaseName"=>"service","PortNumber"=>"15432"}
echo Enable jdbc statistics
/subsystem=datasources/xa-data-source=postgresqlXA/statistics=jdbc:write-attribute(name=statistics-enabled,value=true)
/subsystem=datasources/xa-data-source=postgresqlXA/statistics=pool:write-attribute(name=statistics-enabled,value=true)
echo Configure transaction id
/subsystem=transactions:write-attribute(name=node-identifier,value=service-a)
/subsystem=transactions:write-attribute(name=recovery-listener,value=true)
echo Configure authentication
/subsystem=elytron/authentication-configuration=ejb-user:add(authentication-name=wildfly, authorization-name=wildfly, credential-reference={clear-text=R3dH4t1!}, realm="ApplicationRealm", sasl-mechanism-selector="DIGEST-MD5")
/subsystem=elytron/authentication-context=ejb-context:add(match-rules=[{authentication-configuration=ejb-user}])
/socket-binding-group=standard-sockets/remote-destination-outbound-socket-binding=remote-ejb-service-b:add(host=localhost, port=8180)
echo Configure remote connection
/subsystem=remoting/remote-outbound-connection=remote-ejb-service-b-connection:add(outbound-socket-binding-ref=remote-ejb-service-b, authentication-context=ejb-context)
/subsystem=remoting/remote-outbound-connection=remote-ejb-service-b-connection/property=SASL_POLICY_NOANONYMOUS:add(value=false)
/subsystem=remoting/remote-outbound-connection=remote-ejb-service-b-connection/property=SSL_ENABLED:add(value=false)
/subsystem=remoting/remote-outbound-connection=remote-ejb-service-b-connection/property=SASL_DISALLOWED_MECHANISMS:add(value=JBOSS-LOCAL-USER)
reload