This project is my digital scratchpad for all things as I learn and develop content for Apache Ignite. Follow along as I learn how to set up and manage a distributed data grid with Apache Ignite 3, execute SQL queries, and leverage advanced features like data partitioning and replication.
To use this repository, you need:
- Docker and Docker Compose installed on your host system
- A suitable code editor (VS Code recommended)
- 12GB+ of available RAM for running the containers
- A GridGain ControlCenter account (optional, for monitoring)
- Clone this repository to your local machine
- Start the cluster with the following command:
docker compose up -d && docker compose logs -f
- Start an interactive CLI container to connect to the cluster:
docker run --rm -it --network=ignite3_default -e LANG=C.UTF-8 -e LC_ALL=C.UTF-8 -v ./chinook_db/:/opt/ignite/downloads/ apacheignite/ignite:3.0.0 cli
Within the CLI, connect to the cluster:
connect http://node1:10300
Initialize the cluster with:
cluster init --name=ignite3 --metastorage-group=node1,node2,node3
Populate the cluster with the Chinook dataset:
sql --file=/opt/ignite/downloads/chinook-ignite3.sql
Enter SQL mode in the CLI:
sql
List all tables in the database:
select * from system.tables;
View zone configuration:
select * from system.zones;
Verify that invoice totals match the sum of invoice lines:
SELECT
Invoice.InvoiceId,
SUM(InvoiceLine.UnitPrice * InvoiceLine.Quantity) AS CalculatedTotal,
Invoice.Total AS Total
FROM
InvoiceLine
INNER JOIN Invoice ON InvoiceLine.InvoiceId = Invoice.InvoiceId
GROUP BY
Invoice.InvoiceId,
Invoice.Total
LIMIT 10;
Find the top twenty longest tracks:
SELECT
trackid,
name,
MAX(milliseconds / (1000 * 60)) as duration
FROM
track
WHERE
genreId < 17
GROUP BY
trackid,
name
ORDER BY
duration DESC
LIMIT 20;
Optionally, you can attach GridGain Control Center (NEBULA) for visual monitoring of your cluster:
- Configure portal credentials (export
CC_USERNAME
andCC_PASSWORD
) - Run the cluster with
--profile cloud-connector
- Open the GridGain Nebula portal
- Verify that all nodes are running and view cluster metrics
- Use the Queries tab to monitor SQL execution
- Exit the SQL CLI and CLI container:
sql-cli> exit;
[node1]> exit
- Shut down the cluster:
docker compose --profile cloud-connector down
- Apache Ignite Documentation
- Chinook Database GitHub Repository
- SQL System Views Reference
- GridGain Control Center Documentation
This project is distributed under the same license as the Chinook database: License