2018-12-13 14:47:20 -05:00
---
layout: doc_page
title: "Loading extensions"
---
2018-11-13 12:38:37 -05:00
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
2016-05-19 17:01:06 -04:00
# Loading extensions
2015-05-05 17:07:32 -04:00
2016-05-19 17:01:06 -04:00
## Loading core extensions
2015-05-05 17:07:32 -04:00
2016-05-19 17:01:06 -04:00
Druid bundles all [core extensions ](../development/extensions.html#core-extensions ) out of the box.
See the [list of extensions ](../development/extensions.html#core-extensions ) for your options. You
can load bundled extensions by adding their names to your common.runtime.properties
`druid.extensions.loadList` property. For example, to load the *postgresql-metadata-storage* and
*druid-hdfs-storage* extensions, use the configuration:
2015-05-05 17:07:32 -04:00
2016-05-19 17:01:06 -04:00
```
druid.extensions.loadList=["postgresql-metadata-storage", "druid-hdfs-storage"]
```
2015-05-05 17:07:32 -04:00
2016-05-19 17:01:06 -04:00
These extensions are located in the `extensions` directory of the distribution.
2015-05-05 17:07:32 -04:00
2016-05-19 17:01:06 -04:00
< div class = "note info" >
Druid bundles two sets of configurations: one for the < a href = "../tutorials/quickstart.html" > quickstart< / a > and
one for a < a href = "../tutorials/cluster.html" > clustered configuration< / a > . Make sure you are updating the correct
common.runtime.properties for your setup.
< / div >
2015-05-05 17:07:32 -04:00
2016-05-19 17:01:06 -04:00
< div class = "note caution" >
2018-11-30 15:52:46 -05:00
Because of licensing, the mysql-metadata-storage extension does not include the required MySQL JDBC driver. For instructions
on how to install this library, see the < a href = "../development/extensions-core/mysql.html" > MySQL extension page< / a > .
2016-05-19 17:01:06 -04:00
< / div >
2016-02-26 01:30:01 -05:00
2016-05-19 17:01:06 -04:00
## Loading community and third-party extensions (contrib extensions)
2015-05-05 17:07:32 -04:00
2016-05-19 17:01:06 -04:00
You can also load community and third-party extensions not already bundled with Druid. To do this, first download the extension and
then install it into your `extensions` directory. You can download extensions from their distributors directly, or
if they are available from Maven, the included [pull-deps ](../operations/pull-deps.html ) can download them for you. To use *pull-deps* ,
specify the full Maven coordinate of the extension in the form `groupId:artifactId:version` . For example,
for the (hypothetical) extension *com.example:druid-example-extension:1.0.0* , run:
2015-05-05 17:07:32 -04:00
2016-05-19 17:01:06 -04:00
```
java \
2016-07-01 15:55:57 -04:00
-cp "lib/*" \
-Ddruid.extensions.directory="extensions" \
-Ddruid.extensions.hadoopDependenciesDir="hadoop-dependencies" \
2018-08-30 12:56:26 -04:00
org.apache.druid.cli.Main tools pull-deps \
2016-05-19 17:01:06 -04:00
--no-default-hadoop \
-c "com.example:druid-example-extension:1.0.0"
```
2015-05-05 17:07:32 -04:00
2016-05-19 17:01:06 -04:00
You only have to install the extension once. Then, add `"druid-example-extension"` to
2016-07-01 15:55:57 -04:00
`druid.extensions.loadList` in common.runtime.properties to instruct Druid to load the extension.
< div class = "note info" >
2018-09-04 15:54:41 -04:00
Please make sure all the Extensions related configuration properties listed < a href = "../configuration/index.html#extensions" > here< / a > are set correctly.
2016-07-01 15:55:57 -04:00
< / div >
2016-02-26 01:30:01 -05:00
2016-05-19 17:01:06 -04:00
< div class = "note info" >
2018-08-30 12:56:26 -04:00
The Maven groupId for almost every < a href = "../development/extensions.html#community-extensions" > community extension< / a > is org.apache.druid.extensions.contrib. The artifactId is the name
2016-05-19 17:01:06 -04:00
of the extension, and the version is the latest Druid stable version.
< / div >
2016-02-26 01:30:01 -05:00
2015-07-07 23:51:44 -04:00
2016-05-19 17:01:06 -04:00
## Loading extensions from classpath
2015-07-07 23:51:44 -04:00
2016-05-19 17:01:06 -04:00
If you add your extension jar to the classpath at runtime, Druid will also load it into the system. This mechanism is relatively easy to reason about,
but it also means that you have to ensure that all dependency jars on the classpath are compatible. That is, Druid makes no provisions while using
this method to maintain class loader isolation so you must make sure that the jars on your classpath are mutually compatible.