How can we help you today?

Go ahead and ask us anything.

See the KanBo newest version.

Installing and configuring Elastic Search on Windows

Last modified:


Installing and configuring Elastic Search for KanBo on Windows

Prerequisites:

For this installation You will need a machine with Windows Server 2016 or higher or Windows 10 64bit installed. If you want to use a virtual machine on Azure here you can read how to create one.

Installation:

Installing Elastic Search and the Elastic Kibana component

1. Access Your Windows VM

2. Make sure you have the newest updates so you can use Edge, Chrome or FireFox – other browser are not supported.

3. OPTIONAL STEP – download and install 7zip, as the Kibana zip file has a large number of files that take a long time unpacking with the default Windows application.

4. Download 2 components in the most recent Release:

Elastic Search

Kibana

5. Move the .zip files to a folder of your choice elastic to be installed and extract them.

6. Open command prompt (CMD)

In command prompt, navigate to the folder where you extracted Elastic Search and head to the /bin folder

Image 12862

7. Run elasticsearch.bat

Important information to note, Elasticsearch configures the self-signed SSL certificate itself during the installation so it can use the HTTPS protocol.

8. During the installation something like this should appear. Copy the generated password and the enrollment token to a notepad for later when we will connect the Elastic Search to Kibana.

Image 12863

9. Do not close this command prompt for now, as it is running the Elastic Search service. We will install Elastic Search as a Service after we connect Elastic Search with KanBo.

Checking if Elastic Search is running

1. Check if You can access elastic by opening the following URL in the browser on your VM https://localhost:9200. There will be an error about an invalid certificate, but You do not have to worry about that for now as we will fix it later.

Connecting Elastic Search with Kibana

Kibana is the visual front-end for the Elastic Search. For now, we will need Kibana to set up the search and configure a user that will be used to connect KanBo to Elastic Search.

1. Open a new Command Prompt window (a second one) and go to the /bin folder of Kibana

Image 12865

2. Run kibana.bat

3. After this message appears

Image 12866

Go to the url specified in the command prompt using your browser on your VM

4. Paste the enrollment token from your notepad inside the text field and click on “Configure Elastic”

Image 12867

Creating a User for KanBo

By now, you should have two command prompt windows open, one that is running Kibana and one that is running Elastic Search. Please do not close those command prompt windows during the user configuration - we will need them later.

1. Locate and open the web.config of your KanBo

2. Make sure You have this line in Your KanBo web.config: <elastic key=”55a42c0f7fc8e9444ba6e22370d8339c”/>, the key here is the encryption key and is a random String of min. 30 characters. This key will not be used anywhere in the configuration and is used to encrypt the communication between KanBo and elastic as additional layer of security.

3. Save your web.config

4. Open Kibana in your browser by entering the URL from “Connecting Elastic Search with Kibana” step 3 and login with the username “elastic” and use the password of the Elastic build-in superuser from “Installing Elastic Search and the Elastic Kibana component”, step 8. 

5.

Image 12870


When this window appears, click on “Explore on my own”

6. In the search bar at the top of the site, search for “Roles” and select it by “Go to”

Image 12871


After that, click on “Create role”

Image 12872

7. In role name, type “admin-KanBoSearch”.

Image 12873

Image 12874

Then configure these options the same way they are configured in the screenshot.
Cluster privileges: manage , manage_security
Run As privileges: *
Indices: kanbosearch.*
Privileges: all

8. After creating a role, search for “Users” in the top bar and select “Go to”

Image 12875

And create a user in this fashion:

Image 12876

It is good practice to have the same username as the role name. The password is not generated and is set by You. For the “roles” section, select the role created in the step before: “admin-KanBoSearch”

From here, save the username and password somewhere for later.

Running Elastic Search as a service

After configuring the user we can safely stop the both services: Kibana and then Elastic Search that are running in our 2 open command line windows by using the combination of ctrl+c inside the command prompt windows. Please be aware, that Kibana has to be stopped before Elastic Search to avoid any issues.

Image 12877

And then typing in Y and confirming with enter

Image 12878

Which should result in the command prompt windows looking like this.

After You stopped both batch jobs:

1. In command prompt, go to Elastic Search /bin folder and run elasticsearch-service.bat install

Image 12879

You have now an Elastic Search Service

Image 12880

2. To make sure Elastic Search service runs every time the machine starts, go to services

Image 12881

Find the Elastic Search service, right click it and go to “Properties”

Image 12882

And select the automatic startup type.

Image 12883

3. Apply the setting and start Your Elastic Search Service

Image 12884

Changing the Windows Service name

It is a good practice to change the service name of the Windows Service to something with more clarity. To change the name of our Elastic Search Windows Service:

1. Right-click the Elastic Search service and go to Properties

Image 13042

2. Copy the Display name

Image 13041

3. Open a cmd window and type sc config "COPIED SERVICE NAME" displayname= "KanBo Elastic Search" and run the command. Example: sc config "elasticsearch-service-x64" displayname= "KanBo Elastic Search"

Image 13043

4. Now change the description of the service by running sc description "COPIED SERVICE NAME" "DESCRIPTION". Example: sc description "elasticsearch-service-x64" "Elasticsearch used in KanBo"

Image 13044

5. Go back to Services and click on the refresh button

Image 13045

6. Now Your service name and description is updated!

Image 13046





Connecting KanBo with Elastic Search

1. Go to KanBo Setup (https://yourkanbo.com/setup), show advanced setup and click on Elastic.

Image 12885


If the ”Elastic” option does not appear, restart the KanBo App and try again.

2. The input for the boxes in the “connection” section should be:
Url: https://YOURMACHINEIP:9200.
Replace YOURMACHINEIP with the ip address of Your Elastic Search VM reachable from the KanBo Application. The 9200 port is the port that Elastic search runs on. If You are running KanBo on the same machine, replace YOURMACHINEIP with “localhost”.
User: The Username from “Creating a user for KanBo”, step 8
Password: The password from “Creating a user for KanBo”, step 8
Tenant name: kanbosearch

Image 12886

3. After that, click on register, and Your KanBo will be connected to the Elastic Search service.

4. Index all Your data by choosing “All”, in the “Data import” section, ticking the “clean” box and clicking on “Execute”

Wait until Elastic indexed everything.

Image 12887

5. IMPORTANT: Restart Your KanBo application using IIS after the crawl (step 4) completes (stop / Start KanBo App Pool)

6. Your KanBo now uses Elastic Search now!

7. Optional steps to test the KanBo Search: Go to KanBo, Create a Board and a card inside and click on the Zoom Glass symbol in the right upper corner and search for the name of the card. If you have Boards and cards you can search for them as well to test whether the search is working properly.

Troubleshooting

Verification required in Kibana

You are configuring Kibana and this popup appears

Image 12888

That means You opened the address without the ?code=123456 part. To verify You can:

1. Type in the code from the URL present in the 3rd step of the Kibana connection process

Failed registering elastic connection: Elastic ping failed.

This error appears whenever any of the input in the “connection” section are incorrect, (not just the URL), or if KanBo cannot connect to the specified IP. Please, make sure that:

1. The url starts with https://, the machine ip is correct and is followed by “:9200” at the end.

2. The Username and Password are correct

3. The tenant name doesn’t include the “.*” part that was present inside the Indices of a role we have created in Kibana

4. In case the Elastic Search service is not hosted on the same machine as KanBo, make sure that this URL is accessible from the KanBo machine.

Open ports inside of the Machine

It is possible that the 9200 port is blocked by the firewall inside of the VM (and if You have a VM hosted on Azure, the port might also have not been enabled inside of the VM’s Networking setting, please refer to the article about preparing the VM on Azure). To open ports on a Windows VM:

1. Go to Windows Defender Firewall > Advanced settings

Image 12890

2. Click on “Inbound Rules” and “New Rule”

Image 12891

3. Select “Port” > Next > Choose “TCP” and in “Specific local ports” type “9200”

Image 12892

4. Allow the connection

Image 12893

5.

Image 12894

6. Type in the name of the rule and click on “Finish”

Image 12895

Check if the user is configured properly in Kibana

1. If stopped, start Kibana and log in

2. Go to roles and click on the role You created

Image 12896

3. Make sure that the Cluster privileges, Run As privileges, Indices and Privileges are configured accordingly to the previous steps. Also make sure that indices end with “.*”

4. Go to Users and click on the user You created

5. Make sure that the correct role is assigned to this user

6. If You are unsure about the password, You can reset it by clicking “change password”

Image 12897

Image 12898

Connecting to Elastic Search hosted on a Hyper-V Virtual Machine

If You decided to host Your Elastic Search virtual machine on Hyper-V, Your host machine needs to reroute traffic to the machine’s port to a VM’s port. To do that:

1. Open Routing and Remote Access

2. Double click on “Ethernet”

Image 12899

3. Head to “Services and Ports” and click on “Add”

Image 12900

4. Add a description (for example “ElasticSearch”), keep “On this interface” and “TCP” protocol selected. In incoming port, type in the port You want to use to connect to Elastic Search hosted on Your VM. In private address type in the IP address of Your VM, and in outgoing port type in 9200 (the port that Elastic Search is using) and click on OK.

Image 12901

5. After that is done, click on “Apply” and now You should be able to connect to Elastic Search hosted on Your Hyper-V virtual machine.

Image 12902




Is this article helpful for you?