gremlin console - can not connect using cassandra config - cassandra

I installed janus server (0.4) and cassandra (3.11) on my machine. They start correctly.
When I start the janus client to operate from the console
I run
:remote connect tinkerpop.server conf/remote.yaml
the connection is successful
then if I use this command
graph = JanusGraphFactory.open ('conf/janusgraph-cassandra.properties')
I get the following error message
WARN org.janusgraph.diskstorage.cassandra.thrift.CassandraThriftStoreManager - Cassandra Thrift protocol is deprecated and will be removed with JanusGraph 0.5.0. Please switch to the CQL backend.
Could not open global configuration
The warning is clear while the error that it cannot load the global configuration does not.

Analyzing the configuration file in question I noticed the following property:
storage.backend
This property sets the driver. By changing its value from:
cassandrathrift
to
CQL
everything works fine.
The warning should be an error if you need to use cql as a driver.
Instead, the message suggests that it is looking for a default configuration file.
It could be that, when using cassandrathrift as driver, some properties are not set and therefore look for their default value. At the moment I don't know in which path this default file should exist and how it should be done. Considering that the cassandrathrift driver is deprecated, I think it is a good solution.

In the same conf/ dir as the Thrift-based config file, you should also see a janusgraph-cql.properties file.
This file should already have storage.backend=cql set, as well as a few other parameters allowing you to connect to a local Cassandra instance running on 127.0.0.1 (without security enabled).

Related

Warnings on startup with atomikos starter dependency

I have a spring boot application with postgresql and rabbitmq. I wanted to use a best-effort JTA transaction that contains both a postgres and rabbitmq transaction.
I have added the spring-boot-started-jta-atomikos dependency. When I start my application I receive this warning multiple times:
atomikos connection proxy for Pooled connection wrapping physical connection org.postgresql.jdbc.PgConnection#99c4993: WARNING: transaction manager not running?
Do I need any additional configuration?
I also get this warning at startup:
AtomikosDataSoureBean 'dataSource': poolSize equals default - this may cause performance problems!
I run with the following settings, but setMinPoolSize is never called
spring.jta.atomikos.connectionfactory.max-pool-size: 10
spring.jta.atomikos.connectionfactory.min-pool-size: 5
The documentation at:
https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.jta.atomikos
https://www.atomikos.com/Documentation/SpringBootIntegration
just says I can add the starter dependency. But it seems like spring boot doesn't properly auto-configure some things.
spring.jta.atomikos.connectionfactory properties are for controlling a JMS connectionFactory.
You should use the spring.jta.atomikos.datasource properties for controlling JDBC DataSource configuration.

Unknown peer xxx, excluding from schema agreement check

Since upgrading to Cassandra Java driver v4.x, we keep seeing the following messages in the client app logs:
[s1] Unknown peer xxx, excluding from schema agreement check
FWIW, xxx seems like a UUID, not an IP.
We are connecting to Azure Cosmos DB using the Cassandra Java driver v4.6.1. The message seems to be emanating from SchemaAgreementChecker, but it's pretty useless because it doesn't suggest any way to fix the supposed problem. After digging into the code, I think the problem is that the following query returns a new host_id each time it's executed.
SELECT host_id, schema_version FROM system.peers;
SchemaAgreementChecker.java#L143
It seems the driver is trying to match up the host_id received from peer gossip with the nodes received from InternalDriverContext. I'm not a Cassandra or Azure admin, so I'm not sure what the implication of this is, but given that this warning wasn't shown before, there's some assumption made in the code that isn't holding up.
Any ideas on what could be done here to get rid of this message?
This is a problem with Azure Cosmos DB which isn't a full implementation of Apache Cassandra but provides an CQL-like API.
The SchemaAgreementChecker.java class was added in Java driver 4.0 (JAVA-1638) and it seems like Azure Cosmos DB isn't fully compliant so try using Java driver 3.x and it should work. Cheers!

Error java.net.UnknownHostException while connecting Cassandra cluster

I am doing a PoC to connect Cassandra from my java8 application code.
I am using apache Cassandra with java8
To start with I looked and started with
https://github.com/lankydan/datastax-java-driver
Trying to connect my Cassandra cluster
when i download and try to connect the same to my C* cluster I am getting Caused by: java.net.UnknownHostException: 10.24.78.22,10.24.78.108,10.24.79.173
Updated **CassandraConfig**
.addContactPoints(host)
I updated **application.properties** file
cassandra.host=10.24.78.22,10.24.78.108,10.24.79.173
cassandra.cluster.name=My_Cluster
cassandra.port=9042
cassandra.keyspace=rrr_xxx
So what need to be fixed, and how to fix this issue?
the .addContactPoints function accepts an array of the strings, inet addresses, hosts, etc., while you're passing a one string with multiple addresses inside. You need somehow convert this string into array, or pass only one address.
if you already modifying the code, then it should be simply changed to
.addContactPoints(host.split(","))

Cassandra server-side timeout configuration for "drop table" command

Is there a timeout setting in the cassandra.yaml file used to cause server-side timeouts when issuing a drop table command?
I'm using the following versions of software:
Cassandra database version: 3.11.2
Cassandra datastax java driver version: 3.4.0
I tried changing cassandra.yaml settings for write_request_timeout_in_ms, truncate_request_timeout_in_ms, and request_timeout_in_ms all to 10 ms and then issued a drop table statement via the datastax java driver. From my application logs I can see the statement takes about 2 seconds when measured from the client (client and database are all just on my local development machine and doing nothing else but this test) and finishes without a timeout.
I then executed the exact same test but replaced the "drop table" text in the statement with "truncate table" with no other changes and saw the expected timeout "com.datastax.driver.core.exceptions.TruncateException: Error during truncate: Truncate timed out - received only 0 responses".
I tried searching the Cassandra github project but couldn't find a reference in the code to see how the server side timeouts are applied so I am hoping someone knows the answer to this question.

SymmetricDS and Azure SQL Server

I need help connecting Azure database using SymmetricDS 3.5.1. I can't seem to the configuration correct. I get an error saying "Cannot create PoolableConnectionFactory" with the message either "socket closed" (when I don't specify ssl parameter) or "login timeout" (when I specify the ssl parameter). I have specified a timeout amount in the connection string, however, it does not seem to work and defaults to 30 seconds. Is there any documentation on how to connect to an Azure database using SymmetricDS? Anyway, take a look and tell me what I need to change in my engine.properties file? I have the following:
db.url=jdbc:jtds:sqlserver://MyServer.database.windows.net:1433;database=MyDatabase;user=MyUser#MyServer;password=MyPassowrd;encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=300;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880;ssl=require
db.user=MyUser#MyServer
db.database=MyDatabase
db.password=MyPassword
db.driver=net.sourceforge.jtds.jdbc.Driver
It turns out you have to use the Microsoft JDBC driver. I didn't see any documentation on how to set it up so for the sake of others this is what I did after reading http://www.symmetricds.org/docs/how-to/connect-to-database
Download the Microsoft jdbc driver
Put the sqljdbc4.jar file in the lib folder of your symmetric folder
Change the *.properties file to be the following connection information...
db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
db.url=jdbc:sqlserver://{your_server_name}.database.windows.net:1433;database={database_name};user={user}#{your_server_name};password={password};encrypt=true;hostNameInCertificate=*.database.windows.net;loginTimeout=300;useCursors=true;bufferMaxMemory=10240;lobBuffer=5242880;

Resources