2016-08-26 5 views
8

मैं एलैस्टिकसेर्च के साथ वसंत-बूट का उपयोग कर रहा हूं। परियोजना jhipster का उपयोग कर बनाया गया था।स्प्रिंग लोचदार खोज - कॉन्फ़िगर किए गए नोड्स में से कोई भी उपलब्ध नहीं है

pom.xml शामिल हैं:

<parent> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <groupId>org.springframework.boot</groupId> 
    <version>1.4.0.RELEASE</version> 
    <relativePath/> 
</parent> 

और

<dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId> 
</dependency> 

उत्पादन मोड में, निम्न त्रुटि होती है:

AbstractElasticsearchRepository : failed to load elasticsearch nodes :  
org.elasticsearch.client.transport.NoNodeAvailableException: None of 
the configured nodes are available: [{#transport#-1}{127.0.0.1} 
{localhost/127.0.0.1:9300}] 

मैं कैसे इस त्रुटि को हल कर सकते हैं?

+0

यदि आप डिफॉल्ट लोचदार खोज कॉन्फ़िगरेशन के साथ जिप्स्टर प्रोजेक्ट चलाते हैं तो सुनिश्चित करें कि आपका लोचस्टेस सर्वर संस्करण 1.7 है क्योंकि jhipster जावा प्रोजेक्ट इस संस्करण के साथ काम करता है। विकास प्रोफाइल में – ismail

+0

ऐसी समस्या थी जिसे मैं अभी तक हल नहीं कर सका। – ismail

+0

ठीक काम करता है। धन्यवाद – Jean

उत्तर

5

विकास प्रोफ़ाइल में, जेएचप्स्टर एक एम्बेडेड लोचदार खोज का उपयोग करता है।

उत्पादन प्रोफ़ाइल में, यह डिफ़ॉल्ट रूप से कोशिश करता है एक स्थानीय क्लस्टर से कनेक्ट करने, इसलिए या तो आप अपने स्थानीय मशीन पर Elasticsearch स्थापित नहीं है या आप application-prod.yml में सही URL कॉन्फ़िगर नहीं किया है एक मौजूदा क्लस्टर से कनेक्ट करने के ।

0

सबसे पहले धन्यवाद Gaël Marziou। मैंने अपनी स्थानीय मशीन पर लोचदार खोज स्थापित की लेकिन समस्या बनी रहती है। तो, यह मेरा आवेदन-prod.yml फ़ाइल है।

# =================================================================== 
# Spring Boot configuration for the "prod" profile. 
# 
# This configuration overrides the application.yml file. 
# =================================================================== 

# =================================================================== 
# Standard Spring Boot properties. 
# Full reference is available at: 
# http://docs.spring.io/spring-      
boot/docs/current/reference/html/common-application-properties.html 
# =================================================================== 


spring: 
    devtools: 
     restart: 
     enabled: false 
    livereload: 
     enabled: false 
datasource: 
    type: com.zaxxer.hikari.HikariDataSource 
    url: jdbc:postgresql://localhost:5432/gestor_6_0?useUnicode=true&characterEncoding=utf8&useSSL=false 
    name: 
    username: postgres 
    password: abcdef 
    hikari: 
     data-source-properties: 
      cachePrepStmts: true 
      prepStmtCacheSize: 250 
      prepStmtCacheSqlLimit: 2048 
      useServerPrepStmts: true 
jpa: 
    database-platform: com.everest.gestor.domain.util.FixedPostgreSQL82Dialect 
    database: POSTGRESQL 
    show-sql: false 
    properties: 
     hibernate.cache.use_second_level_cache: true 
     hibernate.cache.use_query_cache: false 
     hibernate.generate_statistics: false 
     hibernate.cache.region.factory_class: org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory 
data: 
    elasticsearch: 
     cluster-name: 
     cluster-nodes: localhost:9300 
mail: 
    host: localhost 
    port: 25 
    username: 
    password: 
thymeleaf: 
    cache: true 

liquibase: 
contexts: prod 

server: 
port: 8080 
compression: 
    enabled: true 
    mime-types: text/html,text/xml,text/plain,text/css, application/javascript, application/json 
    min-response-size: 1024 

# =================================================================== 
# JHipster specific properties 
# =================================================================== 

jhipster: 
http: 
    cache: # Used by the CachingHttpHeadersFilter 
     timeToLiveInDays: 1461 
cache: # Hibernate 2nd level cache, used by CacheConfiguration 
    timeToLiveSeconds: 3600 
    ehcache: 
     maxBytesLocalHeap: 256M 
security: 
    rememberMe: 
     # security key (this key should be unique for your application, and kept secret) 
     key: 33ec72f5b6d07e227df6bcad7ca844c50a40abb1 
mail: # specific JHipster mail property, for standard properties see MailProperties 
    from: [email protected] 
metrics: # DropWizard Metrics configuration, used by MetricsConfiguration 
    jmx.enabled: true 
    spark: 
     enabled: false 
     host: localhost 
     port: 9999 
    graphite: 
     enabled: false 
     host: localhost 
     port: 2003 
     prefix: gestor_6_0 
    logs: # Reports Dropwizard metrics in the logs 
     enabled: false 
     reportFrequency: 60 # in seconds 
logging: 
    logstash: # Forward logs to logstash over a socket, used by LoggingConfiguration 
     enabled: false 
     host: localhost 
     port: 5000 
     queueSize: 512 
+0

यह काम कर रहा है ?? –

+0

अब इसके काम। धन्यवाद। – Jean

0

मैं अपनी लोचदार टेम्पलेट विधि को ElasticSearchConfiguration.java में बदलता हूं और ठीक काम करता है। मैं सिर्फ अनुवर्ती लाइनों को जोड़ता हूं और अपने क्लस्टर नोड नाम को Elasticsearch 2.0 में "गिबोरिम" पर सेट करता हूं।

Settings settings = Settings.settingsBuilder() 
     .put("client.transport.sniff", true).put("name","Gibborim").put("cluster.name", "elasticsearch").put("network.host","127.0.0.1").build(); 

    client = TransportClient.builder().settings(settings).build().addTransportAddress(new InetSocketTransportAddress(new InetSocketAddress("127.0.0.1", 9300))); 
0

आप डिफ़ॉल्ट elasticsearch विन्यास के साथ परियोजना jhipster चलाने तो सुनिश्चित करें कि आपके elasticsearh सर्वर संस्करण 1.7 है कि इसकी वजह jhipster जावा परियोजना इस संस्करण के साथ काम करता है (उत्पादन प्रोफ़ाइल में)

विकास प्रोफाइल में नहीं था इस तरह के एक हो तो समस्या जो मैं अभी तक हल नहीं कर सका

संबंधित मुद्दे