Code Monkey home page Code Monkey logo

elasticsearch-mssql's Introduction

elasticsearch-mssql

Setting up elasticsearch for an mssql database

It seemed like an impossible task. Use the open source elasticsearch engine to index and search a MS SQL Server database. It turns out that it is not that difficult, though as always there are tricks scattered across the internet that need to be combined to make it work.

The import is now done with an elasticsearch-jdbc importer, combined with a jdbc driver (from Microsoft). A previous method, called a 'river' has now (2015) been deprecated.

The general instructions for using the jdbc importer are here. But it doesn't quite work. It starts by installing elasticsearch. That actually goes quite smoothly. I would recommend also installing the Marvel plugin (free developer trial) and starting the Sense interface, to monitor the elasticsearch index and test queries.

At step 6 (set up database, make sure to allow TCP/IP connections), there are a number of nuances:

1. Enable TCP/IP in the SQL SERVER CONFIGURATION MANAGER ( (Start Menu > Microsoft SQL Server > Configuration Tools > SQL Server Configuration Manager > SQL Server Network Configuration)
2. Start the SQL SERVER BROWSER Service. To do this, open the CONFIGURATION MANAGER as an administrator (right click to open). Once in the Manager, right click the BROWSER SERVICE, click Properties and change the Start Mode to Enabled. (http://stackoverflow.com/a/21378235)
3. Explicitly set the TCP to 1433, as explained in these [two](http://stackoverflow.com/a/18850073) [answers](http://stackoverflow.com/a/24299346).

Step 7 is to start the elasticsearch engine. Easy enough. Then Step 8 has a script to import data into elasticsearch. In order to run the script, I found it most convenient to use the bash terminal from cygwin. Also, for windows, the variables in path names need to be in quotes. So I changed these lines:

-cp "${lib}/*" \
-Dlog4j.configurationFile=${bin}/log4j2.xml \

to

-cp "$lib/*" \
-Dlog4j.configurationFile="$bin"/log4j2.xml \

I copied and pasted (shift-Insert) the script into the bash terminal, and then got a message that the user login failed. I tried the local windows user+login, but that did not work. I then changed authentication on the server to 'Mixed Mode'. I gave permissions on the database to a user whose password I set, and then re-ran the script. In about a minute, I had more than twenty thousand indexed records.

elasticsearch-mssql's People

Contributors

aih avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.