Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elassandra support not working #180

Open
neven95 opened this issue Oct 31, 2018 · 1 comment
Open

Elassandra support not working #180

neven95 opened this issue Oct 31, 2018 · 1 comment

Comments

@neven95
Copy link

neven95 commented Oct 31, 2018

My configuration looks like this


 var models = ExpressCassandra.createClient({
    clientOptions: {
        contactPoints: ['127.0.0.1'],
        protocolOptions: { port: 9042 },
        keyspace: 'strat_history_keyspace',
        queryOptions: { consistency: ExpressCassandra.consistencies.one },
        elasticsearch: {
            host: 'http://localhost:9200',
            apiVersion: '6.2.3',
            sniffOnStart: true,
        }
    },
    ormOptions: {
        manageESIndex: true,

        defaultReplicationStrategy: {
            class: 'SimpleStrategy',
            replication_factor: 1
        },
        migration: "drop",
    }
});

but when I tried search like this(HistoryDB==models)

HistoryDB.instance.Smoke.search({
    
       q: 'day:31',
        }, function(err, response) {
            if (err) throw err;
       
        });

I got an error : err while create or update: Error: To use elassandra features, set manageESIndex to true in ormOptions

@AlexisWilke
Copy link
Contributor

AlexisWilke commented Dec 4, 2018

The replication class has to be 'NetworkTopologyStrategy' (which in turn prevents the use of the 'replication_factor' parameter)

You probably should try to restart from scratch with your database to make sure it works as expected, although I'm here because I also get an error which I don't know how to resolve... see #184

The full declaration must include the data center name and replication factor:

    defaultReplicationStrategy: {
        class: 'NetworkTopologyStrategy',
        DC1: 1
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants