Commit 5381dd7f authored by Matija Obreza's avatar Matija Obreza

Allow for configuration of Elasticsearch and Hazelcast clusters

parent 8c10b46f
......@@ -410,7 +410,7 @@
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>1.3.2</version>
<version>1.5.2</version>
</dependency>
<dependency>
......
......@@ -16,6 +16,7 @@
package org.genesys2.spring.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
......@@ -25,13 +26,17 @@ import org.springframework.data.elasticsearch.client.TransportClientFactoryBean;
@Profile({ "aws", "cacher" })
public class ElasticsearchConfigAWS {
private String clusterName = "elasticsearch-genesys";
@Value("${elasticsearch.cluster.name}")
private String clusterName;
@Value("${elasticsearch.cluster.nodes}")
private String clusterNodes;
@Bean
public TransportClientFactoryBean tcfb() {
TransportClientFactoryBean tcfb = new TransportClientFactoryBean();
tcfb.setClusterName(clusterName);
tcfb.setClusterNodes("localhost:9300");
tcfb.setClusterNodes(clusterNodes);
tcfb.setClientPingTimeout("10s");
return tcfb;
}
......
......@@ -16,6 +16,7 @@
package org.genesys2.spring.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
......@@ -25,7 +26,8 @@ import org.springframework.data.elasticsearch.client.NodeClientFactoryBean;
@Profile({ "dev" })
public class ElasticsearchConfigDev {
private String clusterName = "elasticsearch-genesys";
@Value("${elasticsearch.cluster.name}")
private String clusterName;
@Bean
public NodeClientFactoryBean ncfb() {
......
......@@ -25,7 +25,7 @@ log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %t %5p %c{1}:%L - %m
### set log levels - for more verbose logging change 'info' to 'debug' ###
log4j.rootLogger=warn, stdout
log4j.category.org.genesys2.server.service=debug
log4j.category.org.genesys2=info
#log4j.category.org.genesys2.server.servlet.controller=debug
#log4j.category.org.hibernate.cfg.Configuration=debug
#log4j.category.org.hibernate.search=debug
......
......@@ -106,10 +106,11 @@ executor.queue.capacity=100
#scheduler properties
scheduler.max.pool.size=16
# Hazelcast
hazelcast.instanceName=hz-genesys
hazelcast.name=genesys-hz-3.5
hazelcast.password=hazelcasts
# Hazelcast instance name
hazelcast.instanceName=hz-genesys-instance1
# Hazelcast cluster configuration
hazelcast.name=hz-genesys-development
hazelcast.password=hazelcastdevelopment
hazelcast.port=5701
# AWS Autodetection
......@@ -136,9 +137,10 @@ cache.tileserver.max-idle-seconds=0
cache.tileserver.eviction-policy=LRU
# Connection to Elasticsearch
elasticsearch.url=http://localhost:9200/
elasticsearch.cluster.name=es-genesys-development
# Connect to external ES nodes. Comma separated list of hostname:port
# elasticsearch.cluster.nodes=localhost:9300,otherhost:9300
elasticsearch.cluster.nodes=
transifex.project=genesys-dev
transifex.username=Alexandr19011990
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment