Skip to content

Commit

Permalink
Merge pull request apache#1475 from himanshug/derby_in_examples
Browse files Browse the repository at this point in the history
for example/tutorial, use derby instead of mysql
  • Loading branch information
fjy committed Jul 14, 2015
2 parents da8e861 + 473bc10 commit 798c332
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 32 deletions.
5 changes: 4 additions & 1 deletion docs/content/tutorials/tutorial-a-first-look-at-druid.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,10 @@ You should see a bunch of files:

## External Dependencies

Druid requires 3 external dependencies. A "deep storage" that acts as a backup data repository, a "metadata storage" such as MySQL to hold configuration and metadata information, and [Apache Zookeeper](http://zookeeper.apache.org/) for coordination among different pieces of the cluster. For this tutorial, we only need the zookeeper dependency.
Druid requires 3 external dependencies.
* A "deep storage" that acts as a backup data repository.
* A "metadata storage" such as MySQL to hold configuration and metadata information. Druid uses [Apache Derby](http://db.apache.org/derby/) by default.
* [Apache Zookeeper](http://zookeeper.apache.org/) for coordination among different pieces of the cluster. For this tutorial, we only need the zookeeper dependency.

#### Set up Zookeeper

Expand Down
31 changes: 6 additions & 25 deletions docs/content/tutorials/tutorial-the-druid-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,12 @@ cd druid-0.7.1
```

## External Dependencies
Druid requires 3 external dependencies.
* A "deep storage" that acts as a backup data repository.
* A "metadata storage" such as MySQL to hold configuration and metadata information. Druid uses [Apache Derby](http://db.apache.org/derby/) by default.
* [Apache Zookeeper](http://zookeeper.apache.org/) for coordination among different pieces of the cluster. For this tutorial, we only need the zookeeper dependency.

Druid requires 3 external dependencies. A "deep storage" that acts as a backup data repository, a "metadata storage" such as MySQL to hold configuration and metadata information, and [Apache Zookeeper](http://zookeeper.apache.org/) for coordination among different pieces of the cluster.

For deep storage, we will use local disk in this tutorial, but for production, HDFS and S3 are popular options. For the metadata storage, we'll be using MySQL, but other options such as PostgreSQL are also supported.

#### Set up Metadata storage

1. If you don't already have it, download MySQL Community Server here: [http://dev.mysql.com/downloads/mysql/](http://dev.mysql.com/downloads/mysql/).
2. Install MySQL.
3. Create a druid user and database.

```bash
mysql -u root
```

```sql
GRANT ALL ON druid.* TO 'druid'@'localhost' IDENTIFIED BY 'diurd';
CREATE DATABASE druid DEFAULT CHARACTER SET utf8;
```
For deep storage, we will use the local disk in this tutorial, but for production, HDFS and S3 are popular options. For the metadata storage, Derby is used, but for production Mysql or PostgreSQL etc should be used.

#### Set up Zookeeper

Expand Down Expand Up @@ -109,17 +96,11 @@ In the directory, there should be a `common.runtime.properties` file with the fo

```
# Extensions
druid.extensions.coordinates=["io.druid.extensions:druid-examples","io.druid.extensions:druid-kafka-eight","io.druid.extensions:mysql-metadata-storage"]
druid.extensions.coordinates=["io.druid.extensions:druid-examples","io.druid.extensions:druid-kafka-eight"]
# Zookeeper
druid.zk.service.host=localhost
# Metadata Storage (mysql)
druid.metadata.storage.type=mysql
druid.metadata.storage.connector.connectURI=jdbc\:mysql\://localhost\:3306/druid
druid.metadata.storage.connector.user=druid
druid.metadata.storage.connector.password=diurd
# Deep storage (local filesystem for examples - don't use this in production)
druid.storage.type=local
druid.storage.storage.storageDirectory=/tmp/druid/localStorage
Expand Down
14 changes: 8 additions & 6 deletions examples/config/_common/common.runtime.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@
#

# Extensions (no deep storage model is listed - using local fs for deep storage - not recommended for production)
druid.extensions.coordinates=["io.druid.extensions:druid-examples","io.druid.extensions:druid-kafka-eight","io.druid.extensions:mysql-metadata-storage"]
# Also, for production to use mysql add, "io.druid.extensions:mysql-metadata-storage"
druid.extensions.coordinates=["io.druid.extensions:druid-examples","io.druid.extensions:druid-kafka-eight"]

# Zookeeper
druid.zk.service.host=localhost

# Metadata Storage (mysql)
druid.metadata.storage.type=mysql
druid.metadata.storage.connector.connectURI=jdbc\:mysql\://localhost\:3306/druid
druid.metadata.storage.connector.user=druid
druid.metadata.storage.connector.password=diurd
# Metadata Storage (use something like mysql in production by uncommenting properties below)
# by default druid will use derby
# druid.metadata.storage.type=mysql
# druid.metadata.storage.connector.connectURI=jdbc:mysql://localhost:3306/druid
# druid.metadata.storage.connector.user=druid
# druid.metadata.storage.connector.password=diurd

# Deep storage (local filesystem for examples - don't use this in production)
druid.storage.type=local
Expand Down

0 comments on commit 798c332

Please sign in to comment.