Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
8c9dcc2
Druid automated quickstart
Nov 15, 2022
342e5d7
remove conf/druid/single-server/quickstart/_common/historical/jvm.config
Nov 15, 2022
6a4a48e
Minor changes in python script
Nov 15, 2022
36b86b6
Add lower bound memory for some services
Nov 15, 2022
dbfb465
Additional runtime properties for services
Nov 15, 2022
7324252
Update supervise script to accept command arguments, corresponding ch…
Nov 18, 2022
72494e9
File end newline
Nov 18, 2022
e350587
Limit the ability to start multiple instances of a service, documenta…
Nov 18, 2022
68a1e66
simplify script arguments
Nov 18, 2022
e570606
restore changes in medium profile
Nov 18, 2022
b413d15
run-druid refactor
Nov 21, 2022
9b8cdc6
compute and pass middle manager runtime properties to run-druid
Nov 22, 2022
75d169f
Remove extra quotes from mm task javaopts array
Nov 22, 2022
a891319
Update logic to compute minimum memory
Nov 22, 2022
5692753
simplify run-druid
Nov 22, 2022
d111012
remove debug options from run-druid
Nov 22, 2022
a9b24e2
resolve the config_path provided
Nov 22, 2022
71bfca1
comment out service specific runtime properties which are computed in…
Nov 22, 2022
032bae0
simplify run-druid
Nov 22, 2022
f55c749
clean up docs, naming changes
Nov 23, 2022
2a0dd34
Throw ValueError exception on illegal state
Nov 23, 2022
c35cc1e
update docs
Nov 23, 2022
891eaaa
rename args, compute_only -> compute, run_zk -> zk
Nov 23, 2022
a06e86b
update help documentation
Nov 23, 2022
dc8f2b2
update help documentation
Nov 23, 2022
589586f
move task memory computation into separate method
Nov 23, 2022
b78b116
Add validation checks
Nov 23, 2022
a288704
remove print
Nov 23, 2022
81134a6
Add validations
Nov 24, 2022
b8f01cc
remove start-druid bash script, rename start-druid-main
Nov 24, 2022
6e6305f
Include tasks in lower bound memory calculation
Nov 24, 2022
a14af0f
Fix test
Nov 24, 2022
96956e5
Merge remote-tracking branch 'upstream/master' into feature-druid-aut…
Nov 24, 2022
3a13e39
256m instead of 256g
findingrish Nov 28, 2022
af0d445
caffeine cache uses 5% of heap
Nov 29, 2022
6397eef
ensure min task count is 2, task count is monotonic
Nov 29, 2022
a3d442b
update configs and documentation for runtime props in conf/druid/sing…
Nov 29, 2022
b332729
Update docs
Nov 29, 2022
b8d34c4
Specify memory argument for each profile in single-server.md
Nov 29, 2022
cafdc83
Update middleManager runtime.properties
Nov 29, 2022
9a5053e
Merge remote-tracking branch 'upstream/master' into feature-druid-aut…
Nov 29, 2022
0da21ab
Move quickstart configs to conf/druid/base, add bash launch script, s…
Nov 30, 2022
b03d873
Update supervise script
Nov 30, 2022
aabc53c
rename base config directory to auto
Nov 30, 2022
2d19c54
rename python script, changes to pass repeated args to supervise
Nov 30, 2022
657b513
remove exmaples/conf/druid/base dir
Nov 30, 2022
a4c34e7
add docs
Nov 30, 2022
0fd9b09
restore changes in conf dir
Nov 30, 2022
c0da3cd
update start-druid-auto
Nov 30, 2022
7b21323
remove hashref for commands in supervise script
Dec 1, 2022
7535ec8
start-druid-main java_opts array is comma separated
Dec 1, 2022
144042f
update entry point script name in python script
Dec 1, 2022
f5b225f
Update help docs
Dec 1, 2022
42be20a
documentation changes
Dec 1, 2022
eed55be
docs changes
Dec 1, 2022
9063884
update docs
Dec 1, 2022
fe5c773
add support for running indexer
Dec 1, 2022
62912bb
update supported services list
Dec 1, 2022
9b08b04
update help
Dec 1, 2022
622a7ff
Update python.md
Dec 1, 2022
6da787c
remove dir
Dec 1, 2022
0677d0c
update .spelling
Dec 1, 2022
4380235
Remove dependency on psutil and pathlib
Dec 1, 2022
77febf8
update docs
Dec 1, 2022
1c8bd24
Update get_physical_memory method
Dec 1, 2022
9e495b3
Update help docs
Dec 1, 2022
e04af93
update docs
Dec 1, 2022
ca9d5ea
update method to get physical memory on python
Dec 2, 2022
01fb4b2
udpate spelling
Dec 2, 2022
d0c3b21
update .spelling
Dec 2, 2022
c516320
minor change
Dec 2, 2022
9aeb551
Minor change
Dec 2, 2022
1036a7b
merge from master
Dec 6, 2022
71977d6
memory comptuation for indexer
Dec 6, 2022
6062c33
merge from master
Dec 7, 2022
d5d81f4
update start-druid
Dec 8, 2022
5942eff
Update python.md
Dec 8, 2022
a4d14f7
Update single-server.md
Dec 8, 2022
0742c77
merge from master
Dec 8, 2022
41ad0bd
Update python.md
Dec 8, 2022
08507b4
run python3 --version to check if python is installed
Dec 8, 2022
48ffe3f
merge from master
Dec 9, 2022
14b8679
Update supervise script
Dec 9, 2022
2837dd3
start-druid: echo message if python not found
Dec 9, 2022
511583e
update anchor text
Dec 9, 2022
d569693
minor change
Dec 9, 2022
d0e7374
Update condition in supervise script
Dec 9, 2022
e3d3657
JVM not jvm in docs
Dec 9, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions docs/operations/python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
id: python
title: "Python Installation"
---

<!--
~ 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.
-->

Apache Druid startup script requires Python2 or Python3 interpreter.
Since Python2 is deprecated, this document has instructions to install Python3 interpreter.

## Python3 interpreter installation instructions

### Linux

#### Debian or Ubuntu
- `sudo apt update`
- `sudo apt install -y python3-pip`
#### RHEL
- `sudo yum install -y epel-release`
- `sudo yum install -y python3-pip`

### MacOS

#### Install with Homebrew
Refer [Installing Python 3 on Mac OS X](https://docs.python-guide.org/starting/install3/osx/)

#### Install the official Python release
* Browse to the [Python Downloads Page](https://www.python.org/downloads/) and download the latest version (3.x.x)

Verify if Python3 is installed by issuing `python3 --version` command.


34 changes: 24 additions & 10 deletions docs/operations/single-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ title: "Single server deployment"
-->


Druid includes a set of reference configurations and launch scripts for single-machine deployments:

- `nano-quickstart`
- `micro-quickstart`
- `small`
- `medium`
- `large`
- `xlarge`
Druid includes a set of reference configurations and launch scripts for single-machine deployments.
These configuration bundles are located in `conf/druid/single-server/`.

The `auto` configuration sizes runtime parameters based on available processors and memory. Other configurations include hard-coded runtime parameters for various server sizes. Most users should stick with `auto`. Refer below [Druid auto start](#druid-auto-start)
- `auto` (run script: `bin/start-druid`)
- `nano-quickstart` (run script: `bin/start-nano-quickstart`)
- `micro-quickstart` (run script: `bin/start-micro-quickstart`)
- `small` (run script: `bin/start-single-server-small`)
- `medium` (run script: `bin/start-single-server-medium`)
- `large` (run script: `bin/start-single-server-large`)
- `xlarge` (run script: `bin/start-single-server-xlarge`)

The `micro-quickstart` is sized for small machines like laptops and is intended for quick evaluation use-cases.

Expand All @@ -44,6 +47,18 @@ The example configurations run the Druid Coordinator and Overlord together in a

While example configurations are provided for very large single machines, at higher scales we recommend running Druid in a [clustered deployment](../tutorials/cluster.md), for fault-tolerance and reduced resource contention.

## Druid auto start

Druid includes a launch script, `bin/start-druid` that automatically sets various memory-related parameters based on available processors and memory. It accepts optional arguments such as list of services, total memory and a config directory to override default JVM arguments and service-specific runtime properties.

`start-druid` is a generic launch script capable of starting any set of Druid services on a server.
It accepts optional arguments such as list of services, total memory and a config directory to override default JVM arguments and service-specific runtime properties.
Druid services will use all processors and up to 80% memory on the system.
For details about possible arguments, run `bin/start-druid --help`.

The corresponding launch scripts (e.g. `start-micro-quickstart`) are now deprecated.


## Single server reference configurations

### Nano-Quickstart: 1 CPU, 4GiB RAM
Expand Down Expand Up @@ -74,5 +89,4 @@ While example configurations are provided for very large single machines, at hig
### X-Large: 64 CPU, 512GiB RAM (~i3.16xlarge)

- Launch command: `bin/start-xlarge`
- Configuration directory: `conf/druid/single-server/xlarge`

- Configuration directory: `conf/druid/single-server/xlarge`
5 changes: 4 additions & 1 deletion docs/tutorials/cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,10 @@ The [basic cluster tuning guide](../operations/basic-cluster-tuning.md) has info

## Select OS

We recommend running your favorite Linux distribution. You will also need [Java 8 or 11](../operations/java.md).
We recommend running your favorite Linux distribution. You will also need

* [Java 8 or 11](../operations/java.md).
* [Python2 or Python3](../operations/python.md)

> If needed, you can specify where to find Java using the environment variables
> `DRUID_JAVA_HOME` or `JAVA_HOME`. For more details run the `bin/verify-java` script.
Expand Down
43 changes: 22 additions & 21 deletions docs/tutorials/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ title: "Quickstart (local)"
~ under the License.
-->


This quickstart gets you started with Apache Druid using the [`micro-quickstart`](../operations/single-server.md#micro-quickstart-4-cpu-16gib-ram) configuration, and introduces you to Druid ingestion and query features.
This quickstart gets you started with Apache Druid and introduces you to Druid ingestion and query features. For this tutorial, we recommend a machine with at least 6 GB of RAM.

In this quickstart, you'll do the following:
- install Druid
Expand All @@ -37,15 +36,16 @@ Druid supports a variety of ingestion options. Once you're done with this tutori

You can follow these steps on a relatively modest machine, such as a workstation or virtual server with 16 GiB of RAM.

Druid comes equipped with several [startup configuration profiles](../operations/single-server.md) for a
range of machine sizes. These range from `nano` (1 CPU, 4GiB RAM) to `x-large` (64 CPU, 512GiB RAM). For more
information, see [Single server deployment](../operations/single-server.md). For information on deploying Druid services
across clustered machines, see [Clustered deployment](./cluster.md).
Druid comes equipped with launch scripts that can be used to start all processes on a single server. Here, we will use [`auto`](../operations/single-server.md#druid-auto-start), which automatically sets various runtime properties based on available processors and memory.

In addition, Druid includes several [bundled non-automatic profiles](../operations/single-server.md) for a range of machine sizes. These range from nano (1 CPU, 4GiB RAM) to x-large (64 CPU, 512GiB RAM).
We won't use those here, but for more information, see [Single server deployment](../operations/single-server.md). For additional information on deploying Druid services across clustered machines, see [Clustered deployment](./cluster.md).

The software requirements for the installation machine are:

* Linux, Mac OS X, or other Unix-like OS. (Windows is not supported.)
* Java 8u92+ or Java 11.
* [Python2 or Python3](../operations/python.md)

> Druid relies on the environment variables `JAVA_HOME` or `DRUID_JAVA_HOME` to find Java on the machine. You can set
`DRUID_JAVA_HOME` if there is more than one instance of Java. To verify Java requirements for your environment, run the
Expand All @@ -72,38 +72,39 @@ The distribution directory contains `LICENSE` and `NOTICE` files and subdirector

## Start up Druid services

Start up Druid services using the `micro-quickstart` single-machine configuration.
Start up Druid services using the `auto` single-machine configuration.
This configuration includes default settings that are appropriate for this tutorial, such as loading the `druid-multi-stage-query` extension by default so that you can use the MSQ task engine.

You can view that setting and others in the configuration files in the `conf/druid/single-server/micro-quickstart/`.
You can view that setting and others in the configuration files in the `conf/druid/auto`.

From the apache-druid-{{DRUIDVERSION}} package root, run the following command:

```bash
./bin/start-micro-quickstart
./bin/start-druid
```

This brings up instances of ZooKeeper and the Druid services:

```bash
$ ./bin/start-micro-quickstart
[Thu Sep 8 18:30:00 2022] Starting Apache Druid.
[Thu Sep 8 18:30:00 2022] Open http://localhost:8888/ in your browser to access the web console.
[Thu Sep 8 18:30:00 2022] Or, if you have enabled TLS, use https on port 9088.
[Thu Sep 8 18:30:00 2022] Running command[zk], logging to[/apache-druid-{{DRUIDVERSION}}/var/sv/zk.log]: bin/run-zk conf
[Thu Sep 8 18:30:00 2022] Running command[coordinator-overlord], logging to[/apache-druid-{{DRUIDVERSION}}/var/sv/coordinator-overlord.log]: bin/run-druid coordinator-overlord conf/druid/single-server/micro-quickstart
[Thu Sep 8 18:30:00 2022] Running command[broker], logging to[/apache-druid-{{DRUIDVERSION}}/var/sv/broker.log]: bin/run-druid broker conf/druid/single-server/micro-quickstart
[Thu Sep 8 18:30:00 2022] Running command[router], logging to[/apache-druid-{{DRUIDVERSION}}/var/sv/router.log]: bin/run-druid router conf/druid/single-server/micro-quickstart
[Thu Sep 8 18:30:00 2022] Running command[historical], logging to[/apache-druid-{{DRUIDVERSION}}/var/sv/historical.log]: bin/run-druid historical conf/druid/single-server/micro-quickstart
[Thu Sep 8 18:30:00 2022] Running command[middleManager], logging to[/apache-druid-{{DRUIDVERSION}}/var/sv/middleManager.log]: bin/run-druid middleManager conf/druid/single-server/micro-quickstart
$ ./bin/start-druid
[Tue Nov 29 16:31:06 2022] Starting Apache Druid.
[Tue Nov 29 16:31:06 2022] Open http://localhost:8888/ in your browser to access the web console.
[Tue Nov 29 16:31:06 2022] Or, if you have enabled TLS, use https on port 9088.
[Tue Nov 29 16:31:06 2022] Starting services with log directory [/apache-druid-{{DRUIDVERSION}}/log].
[Tue Nov 29 16:31:06 2022] Running command[zk]: bin/run-zk conf
[Tue Nov 29 16:31:06 2022] Running command[broker]: bin/run-druid broker /apache-druid-{{DRUIDVERSION}}/conf/druid/single-server/quickstart '-Xms1187m -Xmx1187m -XX:MaxDirectMemorySize=791m'
[Tue Nov 29 16:31:06 2022] Running command[router]: bin/run-druid router /apache-druid-{{DRUIDVERSION}}/conf/druid/single-server/quickstart '-Xms128m -Xmx128m'
[Tue Nov 29 16:31:06 2022] Running command[coordinator-overlord]: bin/run-druid coordinator-overlord /apache-druid-{{DRUIDVERSION}}/conf/druid/single-server/quickstart '-Xms1290m -Xmx1290m'
[Tue Nov 29 16:31:06 2022] Running command[historical]: bin/run-druid historical /apache-druid-{{DRUIDVERSION}}/conf/druid/single-server/quickstart '-Xms1376m -Xmx1376m -XX:MaxDirectMemorySize=2064m'
[Tue Nov 29 16:31:06 2022] Running command[middleManager]: bin/run-druid middleManager /apache-druid-{{DRUIDVERSION}}/conf/druid/single-server/quickstart '-Xms64m -Xmx64m' '-Ddruid.worker.capacity=2 -Ddruid.indexer.runner.javaOptsArray=["-server","-Duser.timezone=UTC","-Dfile.encoding=UTF-8","-XX:+ExitOnOutOfMemoryError","-Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager","-Xms256m","-Xmx256m","-XX:MaxDirectMemorySize=256m"]'
```

All persistent state, such as the cluster metadata store and segments for the services, are kept in the `var` directory under
the Druid root directory, apache-druid-{{DRUIDVERSION}}. Each service writes to a log file under `var/sv`.

At any time, you can revert Druid to its original, post-installation state by deleting the entire `var` directory. You may want to do this, for example, between Druid tutorials or after experimentation, to start with a fresh instance.

To stop Druid at any time, use CTRL+C in the terminal. This exits the `bin/start-micro-quickstart` script and terminates all Druid processes.
To stop Druid at any time, use CTRL+C in the terminal. This exits the `bin/start-druid` script and terminates all Druid processes.

## Open the web console

Expand Down Expand Up @@ -222,4 +223,4 @@ See the following topics for more information:
* [Tutorial: Load stream data from Apache Kafka](./tutorial-kafka.md) to load streaming data from a Kafka topic.
* [Extensions](../development/extensions.md) for details on Druid extensions.

Remember that after stopping Druid services, you can start clean next time by deleting the `var` directory from the Druid root directory and running the `bin/start-micro-quickstart` script again. You may want to do this before using other data ingestion tutorials, since they use the same Wikipedia datasource.
Remember that after stopping Druid services, you can start clean next time by deleting the `var` directory from the Druid root directory and running the `bin/start-druid` script again. You may want to do this before using other data ingestion tutorials, since they use the same Wikipedia datasource.
8 changes: 4 additions & 4 deletions docs/tutorials/tutorial-batch-hadoop.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ This tutorial shows you how to load data files into Apache Druid using a remote

For this tutorial, we'll assume that you've already completed the previous
[batch ingestion tutorial](tutorial-batch.md) using Druid's native batch ingestion system and are using the
`micro-quickstart` single-machine configuration as described in the [quickstart](index.md).
`auto` single-machine configuration as described in the [quickstart](../operations/single-server.md#druid-auto-start).

## Install Docker

Expand Down Expand Up @@ -156,7 +156,7 @@ cp /tmp/shared/hadoop_xml/*.xml {PATH_TO_DRUID}/conf/druid/single-server/micro-q

### Update Druid segment and log storage

In your favorite text editor, open `conf/druid/single-server/micro-quickstart/_common/common.runtime.properties`, and make the following edits:
In your favorite text editor, open `conf/druid/auto/_common/common.runtime.properties`, and make the following edits:

#### Disable local deep storage and enable HDFS deep storage

Expand Down Expand Up @@ -196,7 +196,7 @@ druid.indexer.logs.directory=/druid/indexing-logs

Once the Hadoop .xml files have been copied to the Druid cluster and the segment/log storage configuration has been updated to use HDFS, the Druid cluster needs to be restarted for the new configurations to take effect.

If the cluster is still running, CTRL-C to terminate the `bin/start-micro-quickstart` script, and re-run it to bring the Druid services back up.
If the cluster is still running, CTRL-C to terminate the `bin/start-druid` script, and re-run it to bring the Druid services back up.

## Load batch data

Expand All @@ -221,7 +221,7 @@ This tutorial is only meant to be used together with the [query tutorial](../tut

If you wish to go through any of the other tutorials, you will need to:
* Shut down the cluster and reset the cluster state by removing the contents of the `var` directory under the druid package.
* Revert the deep storage and task storage config back to local types in `conf/druid/single-server/micro-quickstart/_common/common.runtime.properties`
* Revert the deep storage and task storage config back to local types in `conf/druid/auto/_common/common.runtime.properties`
* Restart the cluster

This is necessary because the other ingestion tutorials will write to the same "wikipedia" datasource, and later tutorials expect the cluster to use local deep storage.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tutorial-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The tutorial guides you through the steps to load sample nested clickstream data

## Prerequisites

Before you follow the steps in this tutorial, download Druid as described in the [quickstart](index.md) using the [micro-quickstart](../operations/single-server.md#micro-quickstart-4-cpu-16gib-ram) single-machine configuration and have it running on your local machine. You don't need to have loaded any data.
Before you follow the steps in this tutorial, download Druid as described in the [quickstart](index.md) using the [auto](../operations/single-server.md#druid-auto-start) single-machine configuration and have it running on your local machine. You don't need to have loaded any data.

## Download and start Kafka

Expand Down
46 changes: 42 additions & 4 deletions examples/bin/run-druid
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# specific language governing permissions and limitations
# under the License.

if [ "$#" -gt 2 ] || [ "$#" -eq 0 ]
if [ "$#" -gt 4 ] || [ "$#" -eq 0 ]
then
>&2 echo "usage: $0 <service> [conf-dir]"
exit 1
Expand Down Expand Up @@ -47,7 +47,45 @@ if [ ! -d "$LOG_DIR" ]; then mkdir -p $LOG_DIR; fi

echo "Running [$1], logging to [$LOG_DIR/$1.log] if no changes made to log4j2.xml"

if [ "$WHATAMI" = 'coordinator-overlord' ]
then
SERVER_NAME=coordinator
else
SERVER_NAME="$WHATAMI"
fi


if [ ! -f "$CONFDIR"/$WHATAMI/main.config ];
then
MAIN_CLASS="org.apache.druid.cli.Main server $SERVER_NAME"
else
MAIN_CLASS=`cat "$CONFDIR"/$WHATAMI/main.config | xargs`
fi

cd "$WHEREAMI/.."
exec "$WHEREAMI"/run-java -Ddruid.node.type=$1 "-Ddruid.log.path=$LOG_DIR" `cat "$CONFDIR"/"$WHATAMI"/jvm.config | xargs` \
-cp "$CONFDIR"/"$WHATAMI":"$CONFDIR"/_common:"$CONFDIR"/_common/hadoop-xml:"$CONFDIR"/../_common:"$CONFDIR"/../_common/hadoop-xml:"$WHEREAMI/../lib/*" \
`cat "$CONFDIR"/$WHATAMI/main.config | xargs`

CLASS_PATH="$CONFDIR"/"$WHATAMI":"$CONFDIR"/_common:"$CONFDIR"/_common/hadoop-xml:"$CONFDIR"/../_common:"$CONFDIR"/../_common/hadoop-xml:"$WHEREAMI/../lib/*"

Comment thread
kfaraz marked this conversation as resolved.
if [ "$#" -eq 3 ] || [ "$#" -eq 4 ]
then
# args: <service> <conf_path> <jvm_args> or <service> <conf_path> <jvm_args> <mm_task_count mm_task_java_props>
JVMARGS=`cat "$CONFDIR/_common/common.jvm.config" | xargs`
JVMARGS+=' '
JVMARGS+=$3

if [ "$#" -eq 3 ]
then
# args: <service> <conf_path> <jvm_args>
exec "$WHEREAMI"/run-java -Ddruid.node.type=$1 "-Ddruid.log.path=$LOG_DIR" $JVMARGS \
-cp $CLASS_PATH $MAIN_CLASS
else
# args: <service> <conf_path> <jvm_args> <mm_task_count mm_task_java_props>
exec "$WHEREAMI"/run-java -Ddruid.node.type=$1 $4 "-Ddruid.log.path=$LOG_DIR" $JVMARGS \
-cp $CLASS_PATH $MAIN_CLASS
fi
else
# args: <service> <conf_path>
exec "$WHEREAMI"/run-java -Ddruid.node.type=$1 "-Ddruid.log.path=$LOG_DIR" \
`cat "$CONFDIR"/"$WHATAMI"/jvm.config | xargs` \
-cp $CLASS_PATH $MAIN_CLASS
fi
35 changes: 35 additions & 0 deletions examples/bin/start-druid
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash -eu

# 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.

PWD="$(pwd)"
WHEREAMI="$(dirname "$0")"
WHEREAMI="$(cd "$WHEREAMI" && pwd)"

if [ -x "$(command -v python3)" ]
then
exec python3 "$WHEREAMI/start-druid-main.py" "$@"
elif [ -x "$(command -v python2)" ]
then
exec python2 "$WHEREAMI/start-druid-main.py" "$@"
elif [ -x "$(command -v python)" ]
then
exec python "$WHEREAMI/start-druid-main.py" "$@"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should do a elif [ -x "$(command -v python)" ] and if that fails (in the else) it should print out a nice warning that python could not be found and is needed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be done as a followup also

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

else
echo "python interepreter not found"
fi
Loading