I m novice to apache ignite.
My requirement is to replace the coherence cache with the ignite cache.
As per my understanding to make the cache distributed used the below cache configuration.
<bean class="org.apache.ignite.spi.discovery.tcp.ipfinder.multicast.TcpDiscoveryMulticastIpFinder">
<property name="addresses">
<list>
<!-- In distributed environment, replace with actual host IP address. -->
<value>1xx.xxx.xx.xxx</value>
<value>1xx.xxx.xx.xxx</value>
<value>1xx.xxx.xx.xxx</value>
<value>1xx.xxx.xx.xxx</value>
<value>myapplicationport</value>
</list>
</property>
</bean>
with same configuration Integrating spring boot with ignite developed a microservice and deployed in all the 4 servers.
Could see only in one server my microservice is up and running while in the other servers ignite got stopped.
Even i tried without providing the port only the ip address.
case2:
Deployed only in one server with one ip in cache configuration the cache stopped with 2 days of deployment.
What should be done to make the cache to be up always.
Because we are also planning to migrate a schema of DB into cache.
Please help on this
Related
I am trying to use Hazelcast caching with Spring Boot, having read some documentation I decided to settle for Near Cache configurations, I would like to cache some method calls and use it for Hibernate L2 caching.. the trouble is I haven't exactly seen an example of using Near Cache specifically creating near cache clients and starting the server.
Can I have some code examples for in configuring that setup (nearcache configurations) and how to start the server side.
Configure Hibernate to use Hazelcast client:
<!-- hibernate.cfg.xml -->
<property name="hibernate.cache.hazelcast.use_native_client">true</property>
<property name="hibernate.cache.hazelcast.configuration_file_path">hazelcast-client.xml</property>
and in client config, configure near-cache:
<!-- hazelcast-client.xml -->
<near-cache name="default">
<time-to-live-seconds>90</time-to-live-seconds>
<max-idle-seconds>100</max-idle-seconds>
<in-memory-format>OBJECT</in-memory-format>
</near-cache>
Alternatively, you can set different configurations for each cache region via:
<near-cache name="<entity-cache-region-name>">
These will enable client's near-cahce for Hibernate L2C. You do not need to add any additional config on server side at this point. However, if you also want to configure near-cache for members, you can configure them independently of Hibernate & client side.
Configuration details for both client and member are here in the documentation.
I had configured the Spring-XD, application context.xml to connect to remote gemfire db. I am unable to connect to remote DB. It goes and connect to local gemfire which comes as part of Spring XD installation. Please can anyone assist what must be wrong.
Configuration to disable local gemfire and configure to connect remote :
/spring-xd-1.2.0.RELEASE/xd/config/modules/modules.yml
gemfire:
useLocator: true
host: remote-ip-address
port: 44444
**Configuration to remote connection gemfire - spring-module.xml**
<bean id="template" class="org.springframework.data.gemfire.GemfireTemplate">
<property name="region" ref="restaurants" />
</bean>
<util:properties id="gemfire-props">
<prop key="log-level">warning</prop>
</util:properties>
<gfe:cache properties-ref="gemfire-props" />
<gfe:cache-server bind-address="localhost" port="44444" />
<gfe:replicated-region id="restaurants">
</gfe:replicated-region>
When we deploy custom moudules and run it on spring-xd shell which access and store object in gemfire template it goes and saves it in local gmefire instead of remote gemfire database. Please can anyone guide or suggest right way of confuguring gemfire db.
Regards,
Cleophus P.
XD modules that access Gemfire, e.g., the gemfire source and gemfire sink use client-server configuration.
You have a remote cache server and the module is a client. Connecting via a locator requires all servers and clients in the grid to share the locator addresses. Assuming your Gemfire server installation already has one or more locators running, the module context should contain a client-cache configured with the same locator addresses as the remote cache server. If you are not familiar with Gemfire client-server topology, I suggest you review the product documentation and get a simple stand alone example running against your cache server before attempting to deploy your XD modules.
I'm implementing a project with ActiveMQ embedded in a cluster instance with schema DB shared in MuleSoft 3.5.1.
The broker has been configured with spring bean
<spring:beans>
<spring:bean class="org.apache.activemq.xbean.BrokerFactoryBean"
id="broker">
<spring:property value="classpath:testActivemq.xml"
name="config" />
<spring:property value="true" name="start" />
</spring:bean>
</spring:beans>
I have tested the system in local mule server stand alone to simululate cluster.
The problem is when I make the deploy the first broker, it grabs an exclusive lock on a table to ensure that no other ActiveMQ broker can access the database at the same time,but the other broker doesn't finish the deploy process and so when I try to undeploy the first broker the server goes in block.
How to resolve my issue?
What you are looking at is ActiveMQ's built in master-slave functionality. To start multiple brokers in the same VM, you need to point their storage locations to different databases (if using JDBC storage) or filesystem locations (if using KahaDB or LevelDB).
See the following on how to do that:
JDBC http://activemq.apache.org/jdbc-master-slave.html
KahaDB http://activemq.apache.org/kahadb.html
LevelDB http://activemq.apache.org/leveldb-store.html
I have one two ec2 instances. One is a web service with DB and another one is a simple web module. Web service connects to DB locally while I want web module instance to connect to the web service instance DB. Both have a stack of Java- Hibernate inside Tomcat with MySQL as database.
I have created one security group and assigned that to both the server. Configuration for DB is as below:
MySQL - TCP Protocol - 3306 port - Source as the Group ID for the same configuration.
The hibernate configuration for web module looks like below:
<property name="connection.url">jdbc:mysql://<web service server ip>:3306/<db name></property>
<property name="connection.username">root</property>
<property name="connection.password">password</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
But I am not able to connect to the DB. If I change the server configuration to accept any IP connection then I can connect but with security group, it fails.
Any pointers?
I think that your DB server is setup to refuse external connections.
Solution
I a using ehcache with JMS replication and ActiveMQ as a JMS server.
It is currently used to cache database results with Hibernate 3.6.7
My cacheManager is configured as above:
<cacheManagerPeerProviderFactory
class="net.sf.ehcache.distribution.jms.JMSCacheManagerPeerProviderFactory" properties="initialContextFactoryName=br.com.sonner.iss.jms.ExampleActiveMQInitialContextFactory,
providerURL=failover:tcp://localhost:6969,userName=XXX,password=YYYY,
replicationTopicConnectionFactoryBindingName=topicConnectionFactory,
replicationTopicBindingName=ehcache,
getQueueConnectionFactoryBindingName=queueConnectionFactory,
getQueueBindingName=ehcacheGetQueue"
propertySeparator=","
/>
The replication and failover is working as it should. If the JMS goes down (the replication stops) and the starts over again when the JMS server starts again.
The only problem that I am facing is that if the JMS server is down at the moment of the startup of my app. The app does not start.
Probably because when Spring goes up it reads the hibernate configurations and when hibernate is loading the app just freezes waiting for the broker.
Does anyone has a work-arround this issue?
I am thinking if there is a way to use the spring jmsTemplate configuration to configure ehcache.xml jndi entries.