Skip to content

Instantly share code, notes, and snippets.

@Karm
Created March 3, 2017 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Karm/094060aabd16ee9cc120da5d2641b505 to your computer and use it in GitHub Desktop.
Save Karm/094060aabd16ee9cc120da5d2641b505 to your computer and use it in GitHub Desktop.
clustered.xml, Infinispan example
<?xml version="1.0" ?>
<server xmlns="urn:jboss:domain:4.0">
<extensions>
<extension module="org.infinispan.extension"/>
<extension module="org.infinispan.server.endpoint"/>
<extension module="org.jboss.as.connector"/>
<extension module="org.jboss.as.deployment-scanner"/>
<extension module="org.jboss.as.jdr"/>
<extension module="org.jboss.as.jmx"/>
<extension module="org.jboss.as.logging"/>
<extension module="org.jboss.as.naming"/>
<extension module="org.jboss.as.remoting"/>
<extension module="org.jboss.as.security"/>
<extension module="org.jboss.as.transactions"/>
<extension module="org.jgroups.extension"/>
<extension module="org.wildfly.extension.io"/>
</extensions>
<management>
<security-realms>
<security-realm name="ManagementRealm">
<authentication>
<local default-user="$local" skip-group-loading="true"/>
<properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>
</authentication>
<authorization map-groups-to-roles="false">
<properties path="mgmt-groups.properties" relative-to="jboss.server.config.dir"/>
</authorization>
</security-realm>
<security-realm name="ApplicationRealm">
<authentication>
<local default-user="$local" allowed-users="*" skip-group-loading="true"/>
<properties path="application-users.properties" relative-to="jboss.server.config.dir"/>
</authentication>
<authorization>
<properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>
</authorization>
</security-realm>
</security-realms>
<audit-log>
<formatters>
<json-formatter name="json-formatter"/>
</formatters>
<handlers>
<file-handler name="file" formatter="json-formatter" relative-to="jboss.server.data.dir" path="audit-log.log"/>
</handlers>
<logger log-boot="true" log-read-only="false" enabled="false">
<handlers>
<handler name="file"/>
</handlers>
</logger>
</audit-log>
<management-interfaces>
<http-interface security-realm="ManagementRealm" http-upgrade-enabled="true">
<socket-binding http="management-http"/>
</http-interface>
</management-interfaces>
<access-control provider="simple">
<role-mapping>
<role name="SuperUser">
<include>
<user name="$local"/>
</include>
</role>
</role-mapping>
</access-control>
</management>
<profile>
<subsystem xmlns="urn:jboss:domain:logging:3.0">
<console-handler name="CONSOLE">
<level name="${infinispan_loglevel}"/>
<formatter>
<named-formatter name="COLOR-PATTERN"/>
</formatter>
</console-handler>
<size-rotating-file-handler name="FILE" autoflush="true">
<file relative-to="jboss.server.log.dir" path="server.log"/>
<rotate-size value="500M"/>
<max-backup-index value="4"/>
<level name="${infinispan_loglevel}"/>
</size-rotating-file-handler>
<logger category="com.arjuna">
<level name="WARN"/>
</logger>
<logger category="org.jboss.as.config">
<level name="DEBUG"/>
</logger>
<logger category="sun.rmi">
<level name="WARN"/>
</logger>
<root-logger>
<level name="${infinispan_loglevel}"/>
<handlers>
<handler name="CONSOLE"/>
<handler name="FILE"/>
</handlers>
</root-logger>
<formatter name="PATTERN">
<pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
<formatter name="COLOR-PATTERN">
<pattern-formatter pattern="%K{level}%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n"/>
</formatter>
</subsystem>
<subsystem xmlns="urn:jboss:domain:deployment-scanner:2.0">
<deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" runtime-failure-causes-rollback="${jboss.deployment.scanner.rollback.on.failure:false}"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:datasources:4.0">
<datasources>
<datasource jta="true" jndi-name="java:jboss/postgresql" pool-name="postgresql" enabled="true" use-ccm="false">
<connection-url>jdbc:postgresql://192.168.122.156:5432/testdb</connection-url>
<driver-class>org.postgresql.Driver</driver-class>
<driver>postgresql</driver>
<transaction-isolation>TRANSACTION_READ_UNCOMMITTED</transaction-isolation>
<pool>
<min-pool-size>10</min-pool-size>
<max-pool-size>30</max-pool-size>
<prefill>true</prefill>
</pool>
<security>
<user-name>testdb</user-name>
<password>blablabla</password>
</security>
<validation>
<validate-on-match>false</validate-on-match>
<background-validation>false</background-validation>
</validation>
<statement>
<share-prepared-statements>true</share-prepared-statements>
<prepared-statement-cache-size>256</prepared-statement-cache-size>
</statement>
</datasource>
<drivers>
<driver name="postgresql" module="org.postgresql">
<datasource-class>org.postgresql.ds.PGPoolingDataSource</datasource-class>
</driver>
</drivers>
</datasources>
</subsystem>
<subsystem xmlns="urn:infinispan:server:core:8.2" default-cache-container="clusteredX">
<cache-container name="clusteredX" default-cache="default" statistics="true">
<transport lock-timeout="60000" channel="cluster" initial-cluster-size="1" />
<distributed-cache name="default" mode="SYNC" segments="40" owners="2" remote-timeout="60000" start="EAGER">
<locking acquire-timeout="120000" concurrency-level="100" striping="false"/>
<transaction mode="NONE"/>
</distributed-cache>
<distributed-cache name="same-as-default" mode="SYNC" segments="40" owners="2" remote-timeout="60000" start="EAGER">
<locking acquire-timeout="120000" concurrency-level="100" striping="false"/>
<transaction mode="NONE"/>
</distributed-cache>
<replicated-cache-configuration name="default-replicated" mode="ASYNC" start="EAGER">
</replicated-cache-configuration>
<replicated-cache-configuration name="infinispan-rules" mode="ASYNC" start="EAGER">
<state-transfer timeout="60000"/>
<expiration lifespan="-1" max-idle="-1" interval="-1"/>
<indexing index="LOCAL">
<property name="default.directory_provider">ram</property>
<property name="hibernate.search.default.worker.execution">async</property>
<property name="hibernate.search.lucene_version">LUCENE_CURRENT</property>
<property name="default.indexmanager">near-real-time</property>
</indexing>
<eviction strategy="NONE"/>
<transaction mode="NONE"/>
<locking acquire-timeout="60000" concurrency-level="100" striping="false"/>
<string-keyed-jdbc-store fetch-state="false"
preload="true"
shared="true"
read-only="false"
purge="false"
passivation="false"
datasource="java:jboss/postgresql">
<write-behind flush-lock-timeout="60000" modification-queue-size="1024" shutdown-timeout="120000" thread-pool-size="10"/>
<property name="databaseType">
POSTGRES
</property>
<string-keyed-table drop-on-exit="false" create-on-start="true" prefix="ISPN_infinispan_rules">
<id-column name="ID_COLUMN" type="VARCHAR(255)"/>
<data-column name="DATA_COLUMN" type="BYTEA"/>
<timestamp-column name="TIMESTAMP_COLUMN" type="BIGINT"/>
</string-keyed-table>
</string-keyed-jdbc-store>
</replicated-cache-configuration>
</cache-container>
</subsystem>
<subsystem xmlns="urn:infinispan:server:endpoint:8.0">
<hotrod-connector socket-binding="hotrod" cache-container="clusteredX">
<topology-state-transfer lazy-retrieval="false" lock-timeout="20000" replication-timeout="60000"/>
</hotrod-connector>
<rest-connector socket-binding="rest" cache-container="clusteredX"/>
<websocket-connector socket-binding="websocket" cache-container="clusteredX"/>
</subsystem>
<subsystem xmlns="urn:infinispan:server:jgroups:8.0">
<channels default="cluster">
<channel name="cluster" stack="azure"/>
</channels>
<stacks default="${jboss.default.jgroups.stack:azure}">
<stack name="azure">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<protocol type="azure.AZURE_PING">
<property name="storage_account_name">
${jboss.jgroups.azure_ping.storage_account_name}
</property>
<property name="storage_access_key">
${jboss.jgroups.azure_ping.storage_access_key}
</property>
<property name="container">
${jboss.jgroups.azure_ping.container}
</property>
</protocol>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd">
<property name="get_cache_timeout">
3000
</property>
<property name="sock_conn_timeout">
2000
</property>
</protocol>
<protocol type="FD_ALL"/>
<protocol type="VERIFY_SUSPECT">
<property name="bind_interface_str">
ens3
</property>
<property name="bind_addr">
${jboss.bind.address}
</property>
<property name="timeout">
20000
</property>
</protocol>
<protocol type="pbcast.NAKACK2">
<property name="use_mcast_xmit">
false
</property>
<property name="print_stability_history_on_failed_xmit">
true
</property>
</protocol>
<protocol type="UNICAST3">
<property name="ack_batches_immediately">
true
</property>
</protocol>
<protocol type="pbcast.STABLE">
<property name="max_bytes">
10485760
</property>
</protocol>
<protocol type="pbcast.GMS">
<property name="join_timeout">
10000
</property>
<property name="max_join_attempts">
6
</property>
<property name="merge_timeout">
10000
</property>
<property name="print_physical_addrs">
true
</property>
</protocol>
<protocol type="MFC"/>
<protocol type="FRAG2">
<property name="frag_size">
1400
</property>
</protocol>
</stack>
</stacks>
</subsystem>
<subsystem xmlns="urn:jboss:domain:io:1.1">
<worker name="default"/>
<buffer-pool name="default"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jca:4.0">
<archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>
<bean-validation enabled="true"/>
<default-workmanager>
<short-running-threads>
<core-threads count="50"/>
<queue-length count="50"/>
<max-threads count="50"/>
<keepalive-time time="10" unit="seconds"/>
</short-running-threads>
<long-running-threads>
<core-threads count="50"/>
<queue-length count="50"/>
<max-threads count="50"/>
<keepalive-time time="10" unit="seconds"/>
</long-running-threads>
</default-workmanager>
<cached-connection-manager/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:jdr:1.0"/>
<subsystem xmlns="urn:jboss:domain:jmx:1.3">
<expose-resolved-model/>
<expose-expression-model/>
<remoting-connector/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:naming:2.0">
<remote-naming/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:remoting:3.0">
<endpoint/>
<http-connector name="http-remoting-connector" connector-ref="default" security-realm="ApplicationRealm"/>
</subsystem>
<subsystem xmlns="urn:jboss:domain:security:1.2">
<security-domains>
<security-domain name="other" cache-type="default">
<authentication>
<login-module code="Remoting" flag="optional">
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
<login-module code="RealmDirect" flag="required">
<module-option name="password-stacking" value="useFirstPass"/>
</login-module>
</authentication>
</security-domain>
<security-domain name="jboss-web-policy" cache-type="default">
<authorization>
<policy-module code="Delegating" flag="required"/>
</authorization>
</security-domain>
<security-domain name="jboss-ejb-policy" cache-type="default">
<authorization>
<policy-module code="Delegating" flag="required"/>
</authorization>
</security-domain>
<security-domain name="jaspitest" cache-type="default">
<authentication-jaspi>
<login-module-stack name="dummy">
<login-module code="Dummy" flag="optional"/>
</login-module-stack>
<auth-module code="Dummy"/>
</authentication-jaspi>
</security-domain>
</security-domains>
</subsystem>
<subsystem xmlns="urn:jboss:domain:transactions:3.0">
<core-environment node-identifier="${infinispan_hostname}">
<process-id>
<uuid/>
</process-id>
</core-environment>
<recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
</subsystem>
</profile>
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:127.0.0.1}"/>
<nic name="ens3"/>
</interface>
<interface name="private">
<inet-address value="${jboss.bind.address.private:127.0.0.1}"/>
<nic name="ens3"/>
</interface>
</interfaces>
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
<socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>
<socket-binding name="management-https" interface="management" port="${jboss.management.https.port:9993}"/>
<socket-binding name="hotrod" port="11222"/>
<socket-binding name="hotrod-internal" port="11223"/>
<socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:234.99.54.14}" multicast-port="45700"/>
<socket-binding name="jgroups-tcp" port="7600"/>
<socket-binding name="jgroups-tcp-fd" port="57600"/>
<socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:234.99.54.14}" multicast-port="45688"/>
<socket-binding name="jgroups-udp-fd" port="54200"/>
<socket-binding name="rest" port="8080"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<socket-binding name="websocket" port="8181"/>
<outbound-socket-binding name="remote-store-hotrod-server">
<remote-destination host="remote-host" port="11222"/>
</outbound-socket-binding>
<outbound-socket-binding name="remote-store-rest-server">
<remote-destination host="remote-host" port="8080"/>
</outbound-socket-binding>
</socket-binding-group>
</server>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment