Getting Started with Crate on Windows

First time with Crate? Learn how to install it on Windows systems, run the Admin UI and execute your first query.

System requirements Windows 7/8/10 versions are supported.

To launch Crate on Windows, you will need a Java JDK (version 8u111+) installed.

Configure Windows

Set the JAVA_HOME environment variable:

  1. On the Start menu, right click Computer and select Properties.
  2. At the left panel, click Advanced system settings.
  3. Go to the Advanced tab and click the Environment Variables button….
  4. Under System variables, click New….
  5. In the Variable name field, type JAVA_HOME.
  6. In the Variable value field, specify a path to the installed Java JDK folder and then click OK.

Notice Click the image below to go through all the steps.

Specify the Crate ports through the Windows Firewall:

  1. On the Start menu, click Control Panel > System and Security > Windows Firewall > Advanced settings.
  2. In the left pane of the Windows Firewall with Advanced Security, click Inbound Rules, and then the right pane, click New Rule.
  3. In the Rule Type window, select Port and then click Next.
  4. In the Protocol and Ports window, select TCP, then specify Specific local ports: 4200, 4300, and then click Next.
  5. Leave the default settings in the Action and Profile windows.
  6. In the Name window, specify Name: Crate and click Finish.

Notice Click the image below to go through all the steps.

Install Crate

Download the Crate Tarball, expand it and move to a convenient location.

Start Crate by running .\bin\crate.

Notice: To create a cluster, run the command multiple times.

Connect to Cluster via Admin UI

Crate ships with an Admin UI that provides an overview of your cluster, nodes, tables and much more.

To connect to Crate cluster, insert the following url to your address bar:

http://127.0.0.1:4200/admin

(where 127.0.0.1 is a SERVER_IP, the publicly accessible IP address of any node in the Crate cluster, and 4200 is the Crate port).

Get started with sample data

In the Admin UI, go to the Get Started tab and proceed with the instructions. As a result you will get a tweets table with the latest posts imported from Twitter. It is accessible in the Tables tab.

Notice Click the image below to go through all the steps.

Now, lets make some queries.

Go to the Console tab and type:

SELECT text FROM tweets LIMIT 100;

Click Execute query.

If the query was written correctly, the operation will be successful, and the SELECT OK message will be displayed. The resulting table will be displayed in the field below.

Notice Click the image below to go through all the steps.

Lets try another example. Here you will get a total number of obtained tweets as well as the number of users that were verified.

In the Console tab, type:

 SELECT count(*) AS quantity,
user['verified']

FROM tweets
GROUP BY user['verified']
ORDER BY quantity DESC;

Click Execute query.

Notice Click the image below to go through all the steps.

This query counts the number of verified and non-verified twitter users and displays the quantity by each type. count(*) is an aggregation function that returns a count of all the rows that match the query. The GROUP BY clause groups each count result into the two possible values of user['verified'] (true and false).

Now you are ready to proceed with Crate. Good luck!

Next Steps