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

Allow for configuration of Elasticsearch and Hazelcast clusters

parent 8c10b46f
...@@ -410,7 +410,7 @@ ...@@ -410,7 +410,7 @@
<dependency> <dependency>
<groupId>org.elasticsearch</groupId> <groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId> <artifactId>elasticsearch</artifactId>
<version>1.3.2</version> <version>1.5.2</version>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package org.genesys2.spring.config; package org.genesys2.spring.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.Profile;
...@@ -25,13 +26,17 @@ import org.springframework.data.elasticsearch.client.TransportClientFactoryBean; ...@@ -25,13 +26,17 @@ import org.springframework.data.elasticsearch.client.TransportClientFactoryBean;
@Profile({ "aws", "cacher" }) @Profile({ "aws", "cacher" })
public class ElasticsearchConfigAWS { public class ElasticsearchConfigAWS {
private String clusterName = "elasticsearch-genesys"; @Value("${elasticsearch.cluster.name}")
private String clusterName;
@Value("${elasticsearch.cluster.nodes}")
private String clusterNodes;
@Bean @Bean
public TransportClientFactoryBean tcfb() { public TransportClientFactoryBean tcfb() {
TransportClientFactoryBean tcfb = new TransportClientFactoryBean(); TransportClientFactoryBean tcfb = new TransportClientFactoryBean();
tcfb.setClusterName(clusterName); tcfb.setClusterName(clusterName);
tcfb.setClusterNodes("localhost:9300"); tcfb.setClusterNodes(clusterNodes);
tcfb.setClientPingTimeout("10s"); tcfb.setClientPingTimeout("10s");
return tcfb; return tcfb;
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package org.genesys2.spring.config; package org.genesys2.spring.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile; import org.springframework.context.annotation.Profile;
...@@ -25,7 +26,8 @@ import org.springframework.data.elasticsearch.client.NodeClientFactoryBean; ...@@ -25,7 +26,8 @@ import org.springframework.data.elasticsearch.client.NodeClientFactoryBean;
@Profile({ "dev" }) @Profile({ "dev" })
public class ElasticsearchConfigDev { public class ElasticsearchConfigDev {
private String clusterName = "elasticsearch-genesys"; @Value("${elasticsearch.cluster.name}")
private String clusterName;
@Bean @Bean
public NodeClientFactoryBean ncfb() { public NodeClientFactoryBean ncfb() {
......
...@@ -25,7 +25,7 @@ log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %t %5p %c{1}:%L - %m ...@@ -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' ### ### set log levels - for more verbose logging change 'info' to 'debug' ###
log4j.rootLogger=warn, stdout 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.genesys2.server.servlet.controller=debug
#log4j.category.org.hibernate.cfg.Configuration=debug #log4j.category.org.hibernate.cfg.Configuration=debug
#log4j.category.org.hibernate.search=debug #log4j.category.org.hibernate.search=debug
......
...@@ -106,10 +106,11 @@ executor.queue.capacity=100 ...@@ -106,10 +106,11 @@ executor.queue.capacity=100
#scheduler properties #scheduler properties
scheduler.max.pool.size=16 scheduler.max.pool.size=16
# Hazelcast # Hazelcast instance name
hazelcast.instanceName=hz-genesys hazelcast.instanceName=hz-genesys-instance1
hazelcast.name=genesys-hz-3.5 # Hazelcast cluster configuration
hazelcast.password=hazelcasts hazelcast.name=hz-genesys-development
hazelcast.password=hazelcastdevelopment
hazelcast.port=5701 hazelcast.port=5701
# AWS Autodetection # AWS Autodetection
...@@ -136,9 +137,10 @@ cache.tileserver.max-idle-seconds=0 ...@@ -136,9 +137,10 @@ cache.tileserver.max-idle-seconds=0
cache.tileserver.eviction-policy=LRU cache.tileserver.eviction-policy=LRU
# Connection to Elasticsearch # 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.project=genesys-dev
transifex.username=Alexandr19011990 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