Changing the Default Multicast Address in Wildfly - jboss7.x

As described in the doc: Controlling the Default Multicast Address with -u. I changed the default multicast address in my Wildfly server from:
standalone.bat -u=230.12.345.67
to placing it inside the config file standalone.xml. I added this to the system property:
<system-properties>
<property name="jboss.default.multicast.address" value="230.12.345.67"/>
</system-properties>
Which should be picked up by the socket-binding-group:
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
...
<socket-binding name="jgroups-mping" port="0" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45700"/>
<socket-binding name="jgroups-udp" port="55200" multicast-address="${jboss.default.multicast.address:230.0.0.4}" multicast-port="45688"/>
However, it seems to be ignored and defaults to 230.0.0.4.

Related

infinispan, get cachemanager by passing cache configuration name

I have this infinispan.xml configuration:
<infinispan>
<cache-container default-cache="dist-sync">
<transport/>
<local-cache name="local">
<expiration lifespan="-1" max-idle="5000" />
</local-cache>
<invalidation-cache name="invalidation" mode="SYNC"/>
<replicated-cache name="repl-sync" mode="SYNC"/>
<distributed-cache name="dist-sync" mode="SYNC"/>
</cache-container>
</infinispan>
How can I instantiate DefaultCacheManager with the cache name configuration local instead of the default cache (dist-sync)
Something like this:
DefaultCacheManager cacheManager = new DefaultCacheManager("infinispan.xml");
Cache<K, V> cache = cacheManager.getCache("local");
More info in the documentation: https://infinispan.org/docs/stable/titles/configuring/configuring.html#cache_modes
Or javadoc: https://docs.jboss.org/infinispan/11.0/apidocs/org/infinispan/manager/DefaultCacheManager.html#getCache(java.lang.String)
As a side note, DefaultCacheManager.getCache() returns the cache with name defined in the default-cache attribute (<cache-container default-cache="dist-sync">)

WildFly 10 Jgroups allways binding to localhost interface

Hi I'm trying to develop a clustered application that uses Infinispan for caching. First I tried to run in replicated mode by starting two instance of wildfly using the localhost as binding interface (with port offsets). This worked fine. But once I start the server using interface IP, cluster is not forming. Still I can access other services using the interface IP.
I tried to telnet the Jgroups port using interface IP address and it failed. But telnetting to localhost works for Jgorups port.
(Then entered localhsot[port] IP's to initial host configuration element in tcpping. Then cluster formation worked.)
So my question is why does it bind to localhost even after starting wildfly using interface IP.
Here is my configuration. (I cant use UDP, therefore need to use tcpping for cluster formation)
Started the wilfly server using
standalone.bat -Djboss.server.base.dir=../standalone_isuru -c standalone-full-ha.xml -b 192.168.17.33 -Djboss.node.name=isuru -Djboss.socket.binding.port-offset=1
Jgourps configuration
<subsystem xmlns="urn:jboss:domain:jgroups:4.0">
<channels default="ee">
<channel name="ee" stack="tcpping"/>
</channels>
<stacks>
<stack name="udp">
.
.
</stack>
<stack name="tcp">
.
.
</stack>
<stack name="tcpping">
<transport type="TCP" socket-binding="jgroups-tcp"/>
<protocol type="TCPPING">
<property name="initial_hosts">
192.168.17.33[7601], 192.168.14.39[7700], 192.168.17.33[7800]
</property>
<property name="num_initial_members">
2
</property>
<property name="port_range">
5
</property>
<property name="timeout">
1000
</property>
</protocol>
<protocol type="MERGE3"/>
<protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
<protocol type="FD"/>
<protocol type="VERIFY_SUSPECT"/>
<protocol type="pbcast.NAKACK2"/>
<protocol type="UNICAST3"/>
<protocol type="pbcast.STABLE"/>
<protocol type="pbcast.GMS"/>
<protocol type="MFC"/>
<protocol type="FRAG2"/>
</stack>
</stacks>
Infinispan cache config
<cache-container name="replicated_cache" default-cache="default" module="org.wildfly.clustering.server" jndi-name="infinispan/replicated_cache">
<transport lock-timeout="60000"/>
<replicated-cache name="customer" jndi-name="infinispan/replicated_cache/customer" mode="SYNC">
<transaction locking="OPTIMISTIC" mode="FULL_XA"/>
<eviction strategy="NONE"/>
</replicated-cache>
</cache-container>
I posted the same question in Jboss developer since I didn't get any answer here.
And this is the answer I got from there.
By default Jgroups bind to private interface. When starting the server this IP can be provided as well.
standalone.bat -b 192.168.17.39 -bprivate=192.168.17.39
You can refer to the interfaces section for interface configuration.
<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}"/>
</interface>
<interface name="private">
<inet-address value="${jboss.bind.address.private:127.0.0.1}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>
socket bindings, binds jgroups to private interface
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
.
<socket-binding name="jgroups-tcp" interface="private" port="7600"/>
.
</socket-binding-group>
Jgroups subsystem
<stack name="tcpping">
<transport type="TCP" socket-binding="jgroups-tcp"/>
.
</stack>

Wildfly 10 HTTPS certificate fine on 8443 but on 443 says bad certificate

I am trying to configure Wildfly (10) to use an SSL certificate for HTTPS. It seems to work fine for 8443 (using https://example.com:8443 -- no errors and certificate shows it is signed by the CA), but when I switch the HTTPS to port 443, whenever I access the site (via https://example.com it tells me my certificate was not installed right, the connection is not secure and it's using a self-signed key).
Here are snippets from my standalone.xml file:
Security Realm
<security-realm name="ApplicationRealm">
<server-identities>
<ssl>
<keystore path="devifs.jks" relative-to="jboss.server.config.dir" keystore-password="yadayada" alias="tomcat" key-password="yadayada"/>
</ssl>
</server-identities>
<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>
Undertow Subsystem
<subsystem xmlns="urn:jboss:domain:undertow:3.0">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http" redirect-socket="https"/>
<https-listener name="default-ssl" security-realm="ApplicationRealm" socket-binding="https"/>
<host name="default-host" default-web-module="hatteras.war" alias="localhost">
<location name="/" handler="welcome-content"/>
<location name="/reports/" handler="ifsreports"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
</host>
</server>
....
</subsystem>
Socket Binding Group
<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="ajp" port="${jboss.ajp.port:8009}"/>
<socket-binding name="http" port="${jboss.http.port:8080}"/>
<socket-binding name="https" port="${jboss.https.port:443}"/>
<socket-binding name="txn-recovery-environment" port="4712"/>
<socket-binding name="txn-status-manager" port="4713"/>
<outbound-socket-binding name="mail-smtp">
<remote-destination host="localhost" port="25"/>
</outbound-socket-binding>
</socket-binding-group>
I've restarted Wildfly and even the server after making the standalone.xml changes. No luck.
Stack:
Wildfly 10.0.0.final
Ubuntu 14.04.4 LTS
AWS
Any suggestions?
My SSL contact pointed out that JBoss cannot run on 443 because it's a privileged port. This lead me to research and I found I should redirect the port using: iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-port 8443 Is this the correct method? Seems to work fine.

Activemq Shutdown fails and then kills process

I am implementing replicated leveldb activemq setup. I have 3 instance of activemq running on same box. I am changing their rmiPort, amqpport and openwire port in config file.
config like lookslie this:
<?xml version="1.0" encoding="UTF-8"?><beans xmlns=" http://www.springframework.org /schema/beans" xmlns:amq=" http://activemq.apache.org/schema/core" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
<!-- Allows us to use system properties as variables in this configuration file -->
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.conf}/credentials.properties</value>
</property>
</bean>
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="activemq_8200" dataDirectory="${activemq.data}">
<destinationPolicy>
<policyMap>
<policyEntries>
<policyEntry producerFlowControl="false" topic=">">
<!-- The constantPendingMessageLimitStrategy is used to prevent
slow topic consumers to block producers and affect other consumers
by limiting the number of messages that are retained
For more information, see:
http://activemq.apache.org/slow-consumer-handling.html
-->
<pendingMessageLimitStrategy>
<constantPendingMessageLimitStrategy limit="1000"/>
</pendingMessageLimitStrategy>
</policyEntry>
<policyEntry producerFlowControl="false" queue=">">
<deadLetterStrategy>
<!--
Use the prifix 'DLQ.' for the destination name, and make the DLQ a queue rather than a topic
-->
<individualDeadLetterStrategy queuePrefix="DLQ." useQueueForQueueMessages="true"/>
</deadLetterStrategy>
<!-- Use VM cursor for better latency
For more information, see:
http://activemq.apache.org/message-cursors.html
<pendingQueuePolicy>
<vmQueueCursor/>
</pendingQueuePolicy>
-->
</policyEntry>
</policyEntries>
</policyMap>
</destinationPolicy>
<!--
The managementContext is used to configure how ActiveMQ is exposed in
JMX. By default, ActiveMQ uses the MBean server that is started by
the JVM. For more information, see:
http://activemq.apache.org/jmx.html
-->
<managementContext>
<managementContext createConnector="false"/>
</managementContext>
<persistenceAdapter>
<replicatedLevelDB bind="tcp://0.0.0.0:0" directory="${activemq.data}/leveldb" replicas="3" zkAddress="gwxdev05.northamerica.cerner.net:2181,gwxdev05.northamerica.cerner.net:2182,gwxdev05.northamerica.cerner.net:2183" zkPassword="password" zkPath="/opt/gwx/activemqdata"/>
</persistenceAdapter>
<systemUsage>
<systemUsage sendFailIfNoSpace="true">
<memoryUsage>
<memoryUsage limit="256 mb"/>
</memoryUsage>
<storeUsage>
<storeUsage limit="1 gb"/>
</storeUsage>
<tempUsage>
<tempUsage limit="128 mb"/>
</tempUsage>
</systemUsage>
</systemUsage>
<transportConnectors>
<!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
<transportConnector name="openwire" uri="tcp://0.0.0.0:${openwirePort}?maximumConnections=1000&wireformat.maxFrameSize=104857600"/>
<transportConnector name="amqp" uri="amqp://0.0.0.0:${amqpPort}?maximumConnections=1000&wireformat.maxFrameSize=104857600"/>
</transportConnectors>
<!-- destroy the spring context on shutdown to stop jetty -->
<shutdownHooks>
<bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook"/>
</shutdownHooks>
</broker>
<import resource="jetty.xml"/>
my instance file looks like this:
ACTIVEMQ_BASE=`cd "$ACTIVEMQ_BASE" && pwd`
## Add system properties for this instance here (if needed), e.g
#export ACTIVEMQ_OPTS_MEMORY="-Xms256M -Xmx1G"
#export ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS_MEMORY
-Dorg.apache.activemq.UseDedicatedTaskRunner=true
-Djava.util.logging.config.file=logging.properties"
export ACTIVEMQ_SUNJMX_CONTROL="-Dactivemq.jmx.url=service:jmx:rmi:///jndi/rmi://127.0.0.1:8100/jmxrmi"
#
ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=8100 "
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
export ACTIVEMQ_SUNJMX_START=$ACTIVEMQ_SUNJMX_START
export ACTIVEMQ_HOME=/opt/gwx/apache-activemq-5.10-SNAPSHOT
export ACTIVEMQ_BASE=$ACTIVEMQ_BASE
export JAVA_HOME=/opt/gwx/apache-activemq-5.10-SNAPSHOT/jdk1.7.0_25
${ACTIVEMQ_HOME}/bin/activemq "$#"
Here is exception I get:
Connecting to pid: 2410
INFO: failed to resolve jmxUrl for pid:2410, using default JMX url Connecting to JMX URL: service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
ERROR: java.lang.RuntimeException: Failed to execute stop task. Reason: java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused] java.lang.RuntimeException: Failed to execute stop task. Reason: java.io.IOException: Failed to retrieve RMIServer stub:
javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is: java.net.ConnectException: Connection refused]
at
I checked firewall. It not issue.
Any idea what might be causing this issue.
Activemq version 5.10 snapshot
Java 1.7
OS linux 6.4
If it still helps someone:
When I had in bin/env this
export ACTIVEMQ_SUNJMX_CONTROL="-Dactivemq.jmx.url=service:jmx:rmi:///jndi/rmi://127.0.0.1:8100/jmxrmi"
#
ACTIVEMQ_SUNJMX_START="-Dcom.sun.management.jmxremote.port=8100 "
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.authenticate=false"
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.ssl=false"
, it did not work, process failed even without logging.
I don't know why, but this method works(for AMQ 5.13): u add to xml this:
<managementContext>
<managementContext connectorPort="1099"/>
</managementContext>
and nothing like ACTIVEMQ_SUNJMX_START in env file

Configuring jboss7 ajp connector timeout

I am setting up Jboss7 to work with apache http using ajp.
My server.xml has the following entry to open ajp port
<subsystem xmlns="urn:jboss:domain:web:1.1" native="false" default-virtual-server="default-host">
<connector name="http" protocol="HTTP/1.1" scheme="http" port="8080"/>
<connector name="ajp" protocol="AJP/1.3" port=8009 enabled="true" />
<virtual-server name="default-host" enable-welcome-root="false">
<alias name="localhost"/>
<alias name="example.com"/>
</virtual-server>
</subsystem>
However when i try adding connectionTimeOut="10000" after port definition, I get the following error in boot.log
Caused by:
org.jboss.as.controller.persistence.ConfigurationPersistenceException:
JBAS014676: Failed to parse configuration at
org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:125)
[jboss-as-controller-7.1.0.Final.jar:7.1.0.Final] at
org.jboss.as.controller.AbstractControllerService.boot(AbstractControllerService.java:187)
[jboss-as-controller-7.1.0.Final.jar:7.1.0.Final] at
org.jboss.as.server.ServerService.boot(ServerService.java:261)
[jboss-as-server-7.1.0.Final.jar:7.1.0.Final] at
org.jboss.as.controller.AbstractControllerService$1.run(AbstractControllerService.java:155)
[jboss-as-controller-7.1.0.Final.jar:7.1.0.Final] ... 1 more Caused
by: javax.xml.stream.XMLStreamException: ParseError at
[row,col]:[411,13] Message: JBAS014788: Unexpected attribute
'connectionTimeout' encountered at
org.jboss.as.controller.parsing.ParseUtils.unexpectedAttribute(ParseUtils.java:104)
[jboss-as-controller-7.1.0.Final.jar:7.1.0.Final] at
org.jboss.as.web.WebSubsystemParser.parseConnector(WebSubsystemParser.java:831)
at
org.jboss.as.web.WebSubsystemParser.readElement(WebSubsystemParser.java:389)
at
org.jboss.as.web.WebSubsystemParser.readElement(WebSubsystemParser.java:60)
at
org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
[staxmapper-1.1.0.Final.jar:1.1.0.Final] at
org.jboss.staxmapper.XMLExtendedStreamReaderImpl.handleAny(XMLExtendedStreamReaderImpl.java:69)
[staxmapper-1.1.0.Final.jar:1.1.0.Final] at
org.jboss.as.server.parsing.StandaloneXml.parseServerProfile(StandaloneXml.java:893)
[jboss-as-server-7.1.0.Final.jar:7.1.0.Final] at
org.jboss.as.server.parsing.StandaloneXml.readServerElement_1_1(StandaloneXml.java:329)
[jboss-as-server-7.1.0.Final.jar:7.1.0.Final] at
org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:126)
[jboss-as-server-7.1.0.Final.jar:7.1.0.Final] at
org.jboss.as.server.parsing.StandaloneXml.readElement(StandaloneXml.java:100)
[jboss-as-server-7.1.0.Final.jar:7.1.0.Final] at
org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:110)
[staxmapper-1.1.0.Final.jar:1.1.0.Final] at
org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:69)
[staxmapper-1.1.0.Final.jar:1.1.0.Final] at
org.jboss.as.controller.persistence.XmlConfigurationPersister.load(XmlConfigurationPersister.java:117)
[jboss-as-controller-7.1.0.Final.jar:7.1.0.Final] ... 4 more
15:47:20,423 INFO [org.jboss.as] JBAS015950: JBoss AS 7.1.0.Final "Thunder" stopped in 29ms
My question is how do we configure timeout in jboss7.
I folllowed http://docs.jboss.org/jbossweb/latest/config/ajp.html and I could not make out the configuration required in server.xml .
Solution found from jboss experts
https://community.jboss.org/message/779774?_sscc=t