所有主机尝试查询失败(尝试:PC

时间:2015-12-24 12:12:24

标签: java spring cassandra spring-data-cassandra

我正在用cassandra DB做Spring Dao。但是我无法建立连接。

我收到此错误

SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder”。 SLF4J:默认为无操作(NOP)记录器实现 SLF4J:有关详细信息,请参阅http://www.slf4j.org/codes.html#StaticLoggerBinder

  

线程“main”中的异常   com.datastax.driver.core.exceptions.NoHostAvailableException:全部   尝试查询失败的主机(尝试:PC264506 / 10.249.67.4:9042   (com.datastax.driver.core.TransportException:   [PC264506 / 10.249.67.4:9042]无法连接))   com.datastax.driver.core.ControlConnection.reconnectInternal(ControlConnection.java:223)     在   com.datastax.driver.core.ControlConnection.connect(ControlConnection.java:78)     在com.datastax.driver.core.Cluster $ Manager.init(Cluster.java:1230)     在com.datastax.driver.core.Cluster.init(Cluster.java:157)at   com.datastax.driver.core.Cluster.connect(Cluster.java:245)at   com.datastax.driver.core.Cluster.connect(Cluster.java:278)at   org.spring.cassandra.example.CassandraApp.main(CassandraApp.java:32)

我的POM:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.spring.cassandra.example</groupId>
  <artifactId>app-cass-tutorial1</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>app-cass-tutorial1</name>
  <url>http://maven.apache.org</url>

  <repositories>
  <repository>
    <id>spring-milestone</id>
    <name>Spring Maven MILESTONE Repository</name>
    <url>http://repo.spring.io/libs-milestone</url>
  </repository>
</repositories>

  <dependencies>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
    </dependency>

    <dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>4.2.4.RELEASE</version>
    </dependency>

    <dependency>
    <groupId>com.datastax.cassandra</groupId>
    <artifactId>cassandra-driver-core</artifactId>
    <version>2.1.9</version>
    </dependency>

    <dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-cassandra</artifactId>
    <version>1.3.0.RELEASE</version>
    </dependency>

  </dependencies>
  </project>

我还验证了cassandra.yaml设置......

0 个答案:

没有答案