我正在使用安装在UBUNTU环境中的带有Kundera的Cassandra,我收到此错误: com.datastax.driver.core.exceptions.NoHostAvailableException:
我正在使用DSClient协议(com.impetus.kundera.client.cassandra.dsdriver.DSClientFactory)和端口9042。 什么是internting是当我测试它本地(在我的widons环境)它工作,但尝试访问Linux,(安装cassandra)它不起作用。
你对此有所了解吗?
persistence.xml
档案:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="default-cassandra-kundera-persistence-unit"
transaction-type="RESOURCE_LOCAL">
<class>com.blablabla.model</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
</persistence-unit>
</persistence>
我手动设置配置,如下所示:
public static final String PROPERTY_KUNDERA_CLIENT = "kundera.client.lookup.class";
public static final String CASSANDRA_DATASTAX_CLIENT = "com.impetus.kundera.client.cassandra.dsdriver.DSClientFactory";
persistenceUnitProperties.put(PROPERTY_KUNDERA_CLIENT, CASSANDRA_DATASTAX_CLIENT );