diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index aaccff9451e..a185fe9cdff 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -1,55 +1,133 @@ GEM remote: https://rubygems.org/ specs: - RedCloth (4.2.9) - classifier (1.3.3) - fast-stemmer (>= 1.0.0) - colorator (0.1) - commander (4.1.5) - highline (~> 1.6.11) - fast-stemmer (1.0.2) - ffi (1.9.3) - github-pages (10) - RedCloth (= 4.2.9) - jekyll (= 1.3.0) - kramdown (= 1.2.0) - liquid (= 2.5.4) - maruku (= 0.6.1) - rdiscount (= 2.1.7) - redcarpet (= 2.3.0) - highline (1.6.20) - jekyll (1.3.0) - classifier (~> 1.3) - colorator (~> 0.1) - commander (~> 4.1.3) - liquid (~> 2.5.2) - listen (~> 1.3) - maruku (~> 0.6.0) - pygments.rb (~> 0.5.0) - redcarpet (~> 2.3.0) - safe_yaml (~> 1.0.4) - kramdown (1.2.0) - liquid (2.5.4) - listen (1.3.1) + activesupport (4.2.7) + i18n (~> 0.7) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + addressable (2.4.0) + coffee-script (2.4.1) + coffee-script-source + execjs + coffee-script-source (1.10.0) + colorator (1.1.0) + ethon (0.9.1) + ffi (>= 1.3.0) + execjs (2.7.0) + faraday (0.9.2) + multipart-post (>= 1.2, < 3) + ffi (1.9.14) + forwardable-extended (2.6.0) + gemoji (2.1.0) + github-pages (98) + activesupport (= 4.2.7) + github-pages-health-check (= 1.2.0) + jekyll (= 3.2.1) + jekyll-coffeescript (= 1.0.1) + jekyll-feed (= 0.5.1) + jekyll-gist (= 1.4.0) + jekyll-github-metadata (= 2.1.1) + jekyll-mentions (= 1.2.0) + jekyll-paginate (= 1.1.0) + jekyll-redirect-from (= 0.11.0) + jekyll-sass-converter (= 1.3.0) + jekyll-seo-tag (= 2.0.0) + jekyll-sitemap (= 0.10.0) + jekyll-swiss (= 0.4.0) + jemoji (= 0.7.0) + kramdown (= 1.11.1) + liquid (= 3.0.6) + listen (= 3.0.6) + mercenary (~> 0.3) + minima (= 1.2.0) + rouge (= 1.11.1) + terminal-table (~> 1.4) + github-pages-health-check (1.2.0) + addressable (~> 2.3) + net-dns (~> 0.8) + octokit (~> 4.0) + public_suffix (~> 1.4) + typhoeus (~> 0.7) + html-pipeline (2.4.2) + activesupport (>= 2) + nokogiri (>= 1.4) + i18n (0.7.0) + jekyll (3.2.1) + colorator (~> 1.0) + jekyll-sass-converter (~> 1.0) + jekyll-watch (~> 1.1) + kramdown (~> 1.3) + liquid (~> 3.0) + mercenary (~> 0.3.3) + pathutil (~> 0.9) + rouge (~> 1.7) + safe_yaml (~> 1.0) + jekyll-coffeescript (1.0.1) + coffee-script (~> 2.2) + jekyll-feed (0.5.1) + jekyll-gist (1.4.0) + octokit (~> 4.2) + jekyll-github-metadata (2.1.1) + jekyll (~> 3.1) + octokit (~> 4.0) + jekyll-mentions (1.2.0) + activesupport (~> 4.0) + html-pipeline (~> 2.3) + jekyll (~> 3.0) + jekyll-paginate (1.1.0) + jekyll-redirect-from (0.11.0) + jekyll (>= 2.0) + jekyll-sass-converter (1.3.0) + sass (~> 3.2) + jekyll-seo-tag (2.0.0) + jekyll (~> 3.1) + jekyll-sitemap (0.10.0) + jekyll-swiss (0.4.0) + jekyll-watch (1.5.0) + listen (~> 3.0, < 3.1) + jemoji (0.7.0) + activesupport (~> 4.0) + gemoji (~> 2.0) + html-pipeline (~> 2.2) + jekyll (>= 3.0) + json (1.8.3) + kramdown (1.11.1) + liquid (3.0.6) + listen (3.0.6) rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) - rb-kqueue (>= 0.2) - maruku (0.6.1) - syntax (>= 1.0.0) - posix-spawn (0.3.6) - pygments.rb (0.5.4) - posix-spawn (~> 0.3.6) - yajl-ruby (~> 1.1.0) - rb-fsevent (0.9.3) - rb-inotify (0.9.2) + rb-inotify (>= 0.9.7) + mercenary (0.3.6) + mini_portile2 (2.1.0) + minima (1.2.0) + minitest (5.9.1) + multipart-post (2.0.0) + net-dns (0.8.0) + nokogiri (1.6.8.1) + mini_portile2 (~> 2.1.0) + octokit (4.3.0) + sawyer (~> 0.7.0, >= 0.5.3) + pathutil (0.14.0) + forwardable-extended (~> 2.6) + public_suffix (1.5.3) + rb-fsevent (0.9.7) + rb-inotify (0.9.7) ffi (>= 0.5.0) - rb-kqueue (0.2.0) - ffi (>= 0.5.0) - rdiscount (2.1.7) - redcarpet (2.3.0) + rouge (1.11.1) safe_yaml (1.0.4) - syntax (1.0.0) - yajl-ruby (1.1.0) + sass (3.4.22) + sawyer (0.7.0) + addressable (>= 2.3.5, < 2.5) + faraday (~> 0.8, < 0.10) + terminal-table (1.7.3) + unicode-display_width (~> 1.1.1) + thread_safe (0.3.5) + typhoeus (0.8.0) + ethon (>= 0.8.0) + tzinfo (1.2.2) + thread_safe (~> 0.1) + unicode-display_width (1.1.1) PLATFORMS ruby @@ -58,4 +136,4 @@ DEPENDENCIES github-pages BUNDLED WITH - 1.10.4 + 1.11.2 diff --git a/docs/_config.yml b/docs/_config.yml index 63b12300aff..3d8bdaa741f 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -3,10 +3,11 @@ permalink: /:categories/:year/:month/:day/:title exclude: [".rvmrc", ".rbenv-version", "README.md", "Rakefile", "changelog.md", "vendor", "node_modules", "scss"] -pygments: true -markdown: redcarpet -redcarpet: - extensions: ["tables"] +highlighter: true +markdown: kramdown +kramdown: + input: GFM + syntax_highlighter: rouge encoding: utf-8 # Themes are encouraged to use these universal variables @@ -69,7 +70,7 @@ JB : # http://s3.amazonaws.com/yoursite/themes/watermelon # /assets # - ASSET_PATH : false + ASSET_PATH : /assets/themes/zeppelin # These paths are to the main pages Jekyll-Bootstrap ships with. # Some JB helpers refer to these paths; change them here if needed. diff --git a/docs/atom.xml b/docs/atom.xml index 7ec29339dd6..9517721179b 100644 --- a/docs/atom.xml +++ b/docs/atom.xml @@ -1,5 +1,5 @@ --- -layout: nil +layout: null title : --- diff --git a/docs/development/howtocontribute.md b/docs/development/howtocontribute.md index cd0ca3f6f0a..a0a25f437e8 100644 --- a/docs/development/howtocontribute.md +++ b/docs/development/howtocontribute.md @@ -51,13 +51,13 @@ First of all, you need Zeppelin source code. The official location of Zeppelin i Get the source code on your development machine using git. -``` +```bash git clone git://git.apache.org/zeppelin.git zeppelin ``` You may also want to develop against a specific branch. For example, for branch-0.5.6 -``` +```bash git clone -b branch-0.5.6 git://git.apache.org/zeppelin.git zeppelin ``` @@ -66,19 +66,19 @@ If you want to not only build Zeppelin but also make any changes, then you need ### Build -``` +```bash mvn install ``` To skip test -``` +```bash mvn install -DskipTests ``` To build with specific spark / hadoop version -``` +```bash mvn install -Dspark.version=x.x.x -Dhadoop.version=x.x.x ``` @@ -86,7 +86,7 @@ For the further ### Run Zeppelin server in development mode -``` +```bash cd zeppelin-server HADOOP_HOME=YOUR_HADOOP_HOME JAVA_HOME=YOUR_JAVA_HOME mvn exec:java -Dexec.mainClass="org.apache.zeppelin.server.ZeppelinServer" -Dexec.args="" ``` @@ -95,7 +95,7 @@ HADOOP_HOME=YOUR_HADOOP_HOME JAVA_HOME=YOUR_JAVA_HOME mvn exec:java -Dexec.mainC or use daemon script -``` +```bash bin/zeppelin-daemon start ``` @@ -107,8 +107,7 @@ Some portions of the Zeppelin code are generated by [Thrift](http://thrift.apach To regenerate the code, install **thrift-0.9.2** and change directory into Zeppelin source directory. and then run following command - -``` +```bash thrift -out zeppelin-interpreter/src/main/java/ --gen java zeppelin-interpreter/src/main/thrift/RemoteInterpreterService.thrift ``` diff --git a/docs/development/howtocontributewebsite.md b/docs/development/howtocontributewebsite.md index 0c2bafc5b64..d0dc7507105 100644 --- a/docs/development/howtocontributewebsite.md +++ b/docs/development/howtocontributewebsite.md @@ -39,13 +39,18 @@ Documentation website is hosted in 'master' branch under `/docs/` dir. First of all, you need the website source code. The official location of mirror for Zeppelin is [http://git.apache.org/zeppelin.git](http://git.apache.org/zeppelin.git). Get the source code on your development machine using git. -``` +```bash git clone git://git.apache.org/zeppelin.git cd docs ``` + Apache Zeppelin follows [Fork & Pull](https://github.com/sevntu-checkstyle/sevntu.checkstyle/wiki/Development-workflow-with-Git:-Fork,-Branching,-Commits,-and-Pull-Request) as a source control workflow. If you want to not only build Zeppelin but also make any changes, then you need to fork [Zeppelin github mirror repository](https://github.com/apache/zeppelin) and make a pull request. +### Kramdown + +Documentation based on jekyll 3.x and kramdown (tweaked markdown for github pages and so on). You have to get used to editing `.md` files with [kramdown](http://kramdown.gettalong.org/quickref.html) + ### Build You'll need to install some prerequisites to build the code. Please check [Build documentation](https://github.com/apache/zeppelin/blob/master/docs/README.md#build-documentation) section in [docs/README.md](https://github.com/apache/zeppelin/blob/master/docs/README.md). @@ -59,7 +64,6 @@ Then you'll be able to access it on [http://localhost:4000](http://localhost:400 When you are ready, just make a pull-request. - ## Alternative way You can directly edit `.md` files in `/docs/` directory at the web interface of github and make pull-request immediately. diff --git a/docs/development/writingzeppelinapplication.md b/docs/development/writingzeppelinapplication.md index e99bbcbe52d..c5ddb28a495 100644 --- a/docs/development/writingzeppelinapplication.md +++ b/docs/development/writingzeppelinapplication.md @@ -27,13 +27,11 @@ limitations under the License. Apache Zeppelin Application is a package that runs on Interpreter process and displays it's output inside of the notebook. While application runs on Interpreter process, it's able to access resources provided by Interpreter through ResourcePool. Output is always rendered by AngularDisplaySystem. Therefore application provides all the possiblities of making interactive graphical application that uses data and processing power of any Interpreter. - ## Make your own Application Writing Application means extending `org.apache.zeppelin.helium.Application`. You can use your favorite IDE and language while Java class files are packaged into jar. `Application` class looks like ```java - /** * Constructor. Invoked when application is loaded */ @@ -52,10 +50,8 @@ public abstract void run(ResourceSet args); public abstract void unload(); ``` - You can check example applications under [./zeppelin-examples](https://github.com/apache/incubator-zeppelin/tree/master/zeppelin-examples) directory. - ## Development mode In the development mode, you can run your Application in your IDE as a normal java application and see the result inside of Zeppelin notebook. @@ -63,7 +59,6 @@ In the development mode, you can run your Application in your IDE as a normal ja `org.apache.zeppelin.interpreter.dev.ZeppelinApplicationDevServer` can run Zeppelin Application in development mode. ```java - // entry point for development mode public static void main(String[] args) throws Exception { @@ -82,10 +77,8 @@ public static void main(String[] args) throws Exception { } ``` - In the Zeppelin notebook, run `%dev run` will connect to application running in development mode. - ## Package file Package file is a json file that provides information about the application. @@ -103,7 +96,6 @@ Json file contains the following information ], icon : "" } - ``` #### name @@ -174,7 +166,6 @@ resources: [ ] ``` - #### icon Icon to be used on the application button. String in this field will be rendered as a HTML tag. diff --git a/docs/development/writingzeppelininterpreter.md b/docs/development/writingzeppelininterpreter.md index c5fb23ccad0..28f23a3542f 100644 --- a/docs/development/writingzeppelininterpreter.md +++ b/docs/development/writingzeppelininterpreter.md @@ -112,13 +112,14 @@ If you want to add a new set of syntax highlighting, 1. Add the `mode-*.js` file to [zeppelin-web/bower.json](https://github.com/apache/zeppelin/blob/master/zeppelin-web/bower.json) (when built, [zeppelin-web/src/index.html](https://github.com/apache/zeppelin/blob/master/zeppelin-web/src/index.html) will be changed automatically). 2. Add `language` field to `editor` object. Note that if you don't specify language field, your interpreter will use plain text mode for syntax highlighting. Let's say you want to set your language to `java`, then add: - ``` - "editor": { - "language": "java" - } - ``` +``` +"editor": { + "language": "java" +} +``` ### Edit on double click + If your interpreter uses mark-up language such as markdown or HTML, set `editOnDblClick` to `true` so that text editor opens on pargraph double click and closes on paragraph run. Otherwise set it to `false`. ``` @@ -126,6 +127,7 @@ If your interpreter uses mark-up language such as markdown or HTML, set `editOnD "editOnDblClick": false } ``` + ## Install your interpreter binary Once you have built your interpreter, you can place it under the interpreter directory with all its dependencies. @@ -138,23 +140,23 @@ Once you have built your interpreter, you can place it under the interpreter dir To configure your interpreter you need to follow these steps: -1. Add your interpreter class name to the zeppelin.interpreters property in `conf/zeppelin-site.xml`. +##### 1. Add your interpreter class name to the zeppelin.interpreters property in `conf/zeppelin-site.xml`. Property value is comma separated [INTERPRETER\_CLASS\_NAME]. For example, - - ``` - + +```xml + zeppelin.interpreters org.apache.zeppelin.spark.SparkInterpreter,org.apache.zeppelin.spark.PySparkInterpreter,org.apache.zeppelin.spark.SparkSqlInterpreter,org.apache.zeppelin.spark.DepInterpreter,org.apache.zeppelin.markdown.Markdown,org.apache.zeppelin.shell.ShellInterpreter,org.apache.zeppelin.hive.HiveInterpreter,com.me.MyNewInterpreter - - ``` + +``` -2. Add your interpreter to the [default configuration](https://github.com/apache/zeppelin/blob/master/zeppelin-zengine/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java#L397) which is used when there is no `zeppelin-site.xml`. +##### 2. Add your interpreter to the [default configuration](https://github.com/apache/zeppelin/blob/master/zeppelin-zengine/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java#L397) which is used when there is no `zeppelin-site.xml`. -3. Start Zeppelin by running `./bin/zeppelin-daemon.sh start`. +##### 3. Start Zeppelin by running `./bin/zeppelin-daemon.sh start`. -4. In the interpreter page, click the `+Create` button and configure your interpreter properties. +##### 4. In the interpreter page, click the `+Create` button and configure your interpreter properties. Now you are done and ready to use your interpreter. > **Note :** Interpreters released with zeppelin have a [default configuration](https://github.com/apache/zeppelin/blob/master/zeppelin-zengine/src/main/java/org/apache/zeppelin/conf/ZeppelinConfiguration.java#L397) which is used when there is no `conf/zeppelin-site.xml`. diff --git a/docs/displaysystem/back-end-angular.md b/docs/displaysystem/back-end-angular.md index 432036c5681..bf1a3fb4f5d 100644 --- a/docs/displaysystem/back-end-angular.md +++ b/docs/displaysystem/back-end-angular.md @@ -30,6 +30,7 @@ It compiles templates and displays them inside of Apache Zeppelin. Zeppelin prov Therefore, you can not only update scope variables from your interpreter but also watch them in the interpreter, which is JVM process. ## Basic Usage + ### Print AngularJS view To use angular display system, you should start with `%angular`. @@ -38,7 +39,6 @@ To use angular display system, you should start with `%angular`. Since `name` is not defined, `Hello {{name}}` will display `Hello`. > **Please Note:** Display system is backend independent. -
### Bind / Unbind Variables Through **ZeppelinContext**, you can bind / unbind variables to **AngularJS view**. Currently, it only works in **Spark Interpreter ( scala )**. @@ -55,15 +55,12 @@ z.angularUnbind(String name) // unbind angular scope variable 'name' in all notebooks related to current interpreter. z.angularUnbindGlobal(String name) - ``` Using the above example, let's bind `world` variable to `name`. Then you can see **AngularJs view** is immediately updated. - -
### Watch / Unwatch Variables Through **ZeppelinContext**, you can watch / unwatch variables in **AngularJs view**. Currently, it only works in **Spark Interpreter ( scala )**. @@ -80,8 +77,6 @@ z.angularWatchGlobal(String name, (before, after) => { ... }) // unregister watcher for angular variable 'name' (global) z.angularUnwatchGlobal(String name) - - ``` Let's make a button. When it is clicked, the value of `run` will be increased 1 by 1. @@ -99,6 +94,7 @@ In this section, we will introduce a simpler and more intuitive way of using **A Here are some usages. ### Import + ```scala // In notebook scope import org.apache.zeppelin.display.angular.notebookscope._ @@ -110,11 +106,14 @@ import AngularElem._ ``` ### Display Element + ```scala // automatically convert to string and print with %angular display system directive in front.
.display ``` + ### Event Handler + ```scala // on click
.onClick(() => { @@ -133,6 +132,7 @@ import AngularElem._ ``` ### Bind Model + ```scala // bind model
.model("myModel").display @@ -142,6 +142,7 @@ import AngularElem._ ``` ### Interact with Model + ```scala // read model AngularModel("myModel")() @@ -150,7 +151,6 @@ AngularModel("myModel")() AngularModel("myModel", "newValue") ``` -
### Example: Basic Usage Using the above basic usages, you can apply them like below examples. @@ -163,6 +163,7 @@ Using the above basic usages, you can apply them like below examples. ``` #### OnClick Event + ```scala
Click me diff --git a/docs/displaysystem/front-end-angular.md b/docs/displaysystem/front-end-angular.md index 0e64aae7cb6..84795f80032 100644 --- a/docs/displaysystem/front-end-angular.md +++ b/docs/displaysystem/front-end-angular.md @@ -24,9 +24,8 @@ limitations under the License.
## Basic Usage -In addition to the [back-end API](./back-end-angular.html) to handle Angular objects binding, Apache Zeppelin also exposes a simple AngularJS **z** object on the front-end side to expose the same capabilities. -This **z** object is accessible in the Angular isolated scope for each paragraph. - +In addition to the [back-end API](./back-end-angular.html) to handle Angular objects binding, Apache Zeppelin also exposes a simple AngularJS **`z`** object on the front-end side to expose the same capabilities. +This **`z`** object is accessible in the Angular isolated scope for each paragraph. ### Bind / Unbind Variables @@ -34,7 +33,6 @@ Through the **`z`**, you can bind / unbind variables to **AngularJS view**. Bind a value to an angular object and a **mandatory** target paragraph: ```html - %angular
@@ -44,23 +42,18 @@ Bind a value to an angular object and a **mandatory** target paragraph:
- ``` -
- Unbind/remove a value from angular object and a **mandatory** target paragraph: ```html - %angular
- ``` @@ -73,19 +66,15 @@ z.angularBind(angularObjectName, angularObjectValue, paragraphId); // Unbind z.angularUnbind(angularObjectName, angularObjectValue, paragraphId); - ``` All the parameters are mandatory. - -
### Run Paragraph You can also trigger paragraph execution by calling **`z.runParagraph()`** function passing the appropriate paragraphId: ```html - %angular
@@ -95,12 +84,10 @@ You can also trigger paragraph execution by calling **`z.runParagraph()`** funct
- ``` -
## Overriding dynamic form with Angular Object The front-end Angular Interaction API has been designed to offer richer form capabilities and variable binding. With the existing **Dynamic Form** system you can already create input text, select and checkbox forms but the choice is rather limited and the look & feel cannot be changed. @@ -109,11 +96,8 @@ The idea is to create a custom form using plain HTML/AngularJS code and bind act Consequently if you use the **Dynamic Form** syntax in a paragraph and there is a bound Angular object having the same name as the `${formName}`, the Angular object will have higher priority and the **Dynamic Form** will not be displayed. Example: - - -
## Feature matrix comparison How does the front-end AngularJS API compares to the [back-end API](./back-end-angular.html) ? Below is a comparison matrix for both APIs: diff --git a/docs/index.md b/docs/index.md index 0f257500eec..827d6ccd8c9 100644 --- a/docs/index.md +++ b/docs/index.md @@ -38,6 +38,7 @@ limitations under the License.

+ ## Multiple Language Backend [Apache Zeppelin interpreter](./manual/interpreters.html) concept allows any language/data-processing-backend to be plugged into Zeppelin. Currently Apache Zeppelin supports many interpreters such as Apache Spark, Python, JDBC, Markdown and Shell. @@ -60,6 +61,7 @@ Apache Zeppelin with Spark integration provides For the further information about Apache Spark in Apache Zeppelin, please see [Spark interpreter for Apache Zeppelin](./interpreter/spark.html).
+ ## Data visualization Some basic charts are already included in Apache Zeppelin. Visualizations are not limited to Spark SQL query, any output from any language backend can be recognized and visualized. @@ -86,6 +88,7 @@ Apache Zeppelin aggregates values and displays them in pivot chart with simple d Learn more about [display systems](#display-system) in Apache Zeppelin.
+ ## Dynamic forms Apache Zeppelin can dynamically create some input forms in your notebook. @@ -97,6 +100,7 @@ Apache Zeppelin can dynamically create some input forms in your notebook. Learn more about [Dynamic Forms](./manual/dynamicform.html).
+ ## Collaborate by sharing your Notebook & Paragraph Your notebook URL can be shared among collaborators. Then Apache Zeppelin will broadcast any changes in realtime, just like the collaboration in Google docs. @@ -111,6 +115,7 @@ You can easily embed it as an iframe inside of your website in this way. If you want to learn more about this feature, please visit [this page](./manual/publish.html).
+ ## 100% Opensource @@ -121,7 +126,7 @@ Join to our [Mailing list](https://zeppelin.apache.org/community.html) and repor ## What is the next ? -####Quick Start +#### Quick Start * Getting Started * [Quick Start](./install/install.html) for basic instructions on installing Apache Zeppelin @@ -135,7 +140,7 @@ Join to our [Mailing list](https://zeppelin.apache.org/community.html) and repor * More * [Upgrade Apache Zeppelin Version](./install/upgrade.html): a manual procedure of upgrading Apache Zeppelin version -####Interpreter +#### Interpreter * [Interpreters in Apache Zeppelin](./manual/interpreters.html): what is interpreter group? how can you set interpreters in Apache Zeppelin? * Usage @@ -143,14 +148,14 @@ Join to our [Mailing list](https://zeppelin.apache.org/community.html) and repor * [Interpreter Dependency Management](./manual/dependencymanagement.html) when you include external libraries to interpreter * Available Interpreters: currently, about 20 interpreters are available in Apache Zeppelin. -####Display System +#### Display System * Basic Display System: [Text](./displaysystem/basicdisplaysystem.html#text), [HTML](./displaysystem/basicdisplaysystem.html#html), [Table](./displaysystem/basicdisplaysystem.html#table) is available * Angular API: a description about avilable backend and frontend AngularJS API with examples * [Angular (backend API)](./displaysystem/back-end-angular.html) * [Angular (frontend API)](./displaysystem/front-end-angular.html) -####More +#### More * Notebook Storage: a guide about saving notebooks to external storage * [Git Storage](./storage/storage.html#notebook-storage-in-local-git-repository) diff --git a/docs/install/cdh.md b/docs/install/cdh.md index f661417a3f6..35f23b529b3 100644 --- a/docs/install/cdh.md +++ b/docs/install/cdh.md @@ -29,14 +29,13 @@ limitations under the License. You can import the Docker image by pulling it from Cloudera Docker Hub. -``` +```bash docker pull cloudera/quickstart:latest ``` - ### 2. Run docker -``` +```bash docker run -it \ -p 80:80 \ -p 4040:4040 \ @@ -71,11 +70,10 @@ docker run -it \ To verify the application is running well, check the web UI for HDFS on `http://:50070/` and YARN on `http://:8088/cluster`. - ### 4. Configure Spark interpreter in Zeppelin Set following configurations to `conf/zeppelin-env.sh`. -``` +```bash export MASTER=yarn-client export HADOOP_CONF_DIR=[your_hadoop_conf_path] export SPARK_HOME=[your_spark_home_path] diff --git a/docs/install/install.md b/docs/install/install.md index 43416dcd775..38f94ec1634 100644 --- a/docs/install/install.md +++ b/docs/install/install.md @@ -79,13 +79,13 @@ If you want to build from source, you must first install the following dependenc If you haven't installed Git and Maven yet, check the [Before Build](https://github.com/apache/zeppelin/blob/master/README.md#before-build) section and follow the step by step instructions from there. -####1. Clone the Apache Zeppelin repository +#### 1. Clone the Apache Zeppelin repository ``` git clone https://github.com/apache/zeppelin.git ``` -####2. Build source with options +#### 2. Build source with options Each interpreter requires different build options. For more information about build options, please see the [Build](https://github.com/apache/zeppelin#build) section. ``` @@ -115,6 +115,7 @@ mvn clean package -Pspark-1.5 -Pmapr50 -DskipTests For further information about building from source, please see [README.md](https://github.com/apache/zeppelin/blob/master/README.md) in the Zeppelin repository. ## Starting Apache Zeppelin from the Command Line + #### Starting Apache Zeppelin On all platforms except for Windows: diff --git a/docs/install/spark_cluster_mode.md b/docs/install/spark_cluster_mode.md index d4c864a91c4..581843ee598 100644 --- a/docs/install/spark_cluster_mode.md +++ b/docs/install/spark_cluster_mode.md @@ -37,14 +37,14 @@ You can simply set up Spark standalone environment with below steps. ### 1. Build Docker file You can find docker script files under `scripts/docker/spark-cluster-managers`. -``` +```bash cd $ZEPPELIN_HOME/scripts/docker/spark-cluster-managers/spark_standalone docker build -t "spark_standalone" . ``` ### 2. Run docker -``` +```bash docker run -it \ -p 8080:8080 \ -p 7077:7077 \ @@ -67,7 +67,7 @@ After running single paragraph with Spark interpreter in Zeppelin, browse `https You can also simply verify that Spark is running well in Docker with below command. -``` +```bash ps -ef | grep spark ``` @@ -80,14 +80,14 @@ You can simply set up [Spark on YARN](http://spark.apache.org/docs/latest/runnin ### 1. Build Docker file You can find docker script files under `scripts/docker/spark-cluster-managers`. -``` +```bash cd $ZEPPELIN_HOME/scripts/docker/spark-cluster-managers/spark_yarn docker build -t "spark_yarn" . ``` ### 2. Run docker -``` +```bash docker run -it \ -p 5000:5000 \ -p 9000:9000 \ @@ -115,7 +115,7 @@ docker run -it \ You can simply verify the processes of Spark and YARN are running well in Docker with below command. -``` +```bash ps -ef ``` @@ -124,7 +124,7 @@ You can also check each application web UI for HDFS on `http://:50070/ ### 4. Configure Spark interpreter in Zeppelin Set following configurations to `conf/zeppelin-env.sh`. -``` +```bash export MASTER=yarn-client export HADOOP_CONF_DIR=[your_hadoop_conf_path] export SPARK_HOME=[your_spark_home_path] @@ -149,7 +149,7 @@ You can simply set up [Spark on Mesos](http://spark.apache.org/docs/latest/runni ### 1. Build Docker file -``` +```bash cd $ZEPPELIN_HOME/scripts/docker/spark-cluster-managers/spark_mesos docker build -t "spark_mesos" . ``` @@ -157,7 +157,7 @@ docker build -t "spark_mesos" . ### 2. Run docker -``` +```bash docker run --net=host -it \ -p 8080:8080 \ -p 7077:7077 \ @@ -176,7 +176,7 @@ spark_mesos bash; You can simply verify the processes of Spark and Mesos are running well in Docker with below command. -``` +```bash ps -ef ``` @@ -185,7 +185,7 @@ You can also check each application web UI for Mesos on `http://:5050/ ### 4. Configure Spark interpreter in Zeppelin -``` +```bash export MASTER=mesos://127.0.1.1:5050 export MESOS_NATIVE_JAVA_LIBRARY=[PATH OF libmesos.so] export SPARK_HOME=[PATH OF SPARK HOME] diff --git a/docs/install/virtual_machine.md b/docs/install/virtual_machine.md index 6456bc5de8e..58680c51d01 100644 --- a/docs/install/virtual_machine.md +++ b/docs/install/virtual_machine.md @@ -134,6 +134,7 @@ config.vm.network "private_network", ip: "192.168.51.52" This approach usually is typically required if running other virtual machines that discover each other directly by IP address, such as Spark Masters and Slaves as well as Cassandra Nodes, Elasticsearch Nodes, and other Spark data sources. You may wish to launch nodes in virtual machines with IP addresses in a subnet that works for your local network, such as: 192.168.51.53, 192.168.51.54, 192.168.51.53, etc.. ## Extras + ### Python Extras With Zeppelin running, **Numpy**, **SciPy**, **Pandas** and **Matplotlib** will be available. Create a pyspark notebook, and try the below code. diff --git a/docs/interpreter/alluxio.md b/docs/interpreter/alluxio.md index 4c41fdcf959..54bf7cbf454 100644 --- a/docs/interpreter/alluxio.md +++ b/docs/interpreter/alluxio.md @@ -245,6 +245,4 @@ Following steps are performed: * the file previously copied to afs is copied to local machine * using sh interpreter it's checked the existence of the new file copied from Alluxio and its content is showed -
- ![Alluxio Interpreter Example](../assets/themes/zeppelin/img/docs-img/alluxio-example.png) -
+![Alluxio Interpreter Example](../assets/themes/zeppelin/img/docs-img/alluxio-example.png) diff --git a/docs/interpreter/cassandra.md b/docs/interpreter/cassandra.md index 5d8929bd588..bf7015932da 100644 --- a/docs/interpreter/cassandra.md +++ b/docs/interpreter/cassandra.md @@ -39,12 +39,10 @@ limitations under the License. ## Enabling Cassandra Interpreter In a notebook, to enable the **Cassandra** interpreter, click on the **Gear** icon and select **Cassandra** + +![Interpreter Binding](../assets/themes/zeppelin/img/docs-img/cassandra-InterpreterBinding.png) -
- ![Interpreter Binding](../assets/themes/zeppelin/img/docs-img/cassandra-InterpreterBinding.png) - - ![Interpreter Selection](../assets/themes/zeppelin/img/docs-img/cassandra-InterpreterSelection.png) -
+![Interpreter Selection](../assets/themes/zeppelin/img/docs-img/cassandra-InterpreterSelection.png) ## Using the Cassandra Interpreter @@ -52,9 +50,7 @@ In a paragraph, use **_%cassandra_** to select the **Cassandra** interpreter and To access the interactive help, type **HELP;** -
- ![Interactive Help](../assets/themes/zeppelin/img/docs-img/cassandra-InteractiveHelp.png) -
+![Interactive Help](../assets/themes/zeppelin/img/docs-img/cassandra-InteractiveHelp.png) ## Interpreter Commands @@ -100,7 +96,6 @@ The **Cassandra** interpreter accepts the following commands This interpreter is compatible with any CQL statement supported by Cassandra. Ex: ```sql - INSERT INTO users(login,name) VALUES('jdoe','John DOE'); SELECT * FROM users WHERE login='jdoe'; ``` @@ -120,7 +115,6 @@ Each statement should be separated by a semi-colon ( **;** ) except the special Multi-line statements as well as multiple statements on the same line are also supported as long as they are separated by a semi-colon. Ex: ```sql - USE spark_demo; SELECT * FROM albums_by_country LIMIT 1; SELECT * FROM countries LIMIT 1; @@ -133,7 +127,6 @@ WHERE login='jlennon'; Batch statements are supported and can span multiple lines, as well as DDL(CREATE/ALTER/DROP) statements: ```sql - BEGIN BATCH INSERT INTO users(login,name) VALUES('jdoe','John DOE'); INSERT INTO users_preferences(login,account_type) VALUES('jdoe','BASIC'); @@ -148,7 +141,6 @@ CREATE TABLE IF NOT EXISTS test( CQL statements are case-insensitive (except for column names and values). This means that the following statements are equivalent and valid: ```sql - INSERT INTO users(login,name) VALUES('jdoe','John DOE'); Insert into users(login,name) vAlues('hsue','Helen SUE'); ``` @@ -205,7 +197,6 @@ The complete list of all CQL statements and versions can be found below: It is possible to add comments between statements. Single line comments start with the **hash sign** (#) or **double slashes** (//). Multi-line comments are enclosed between /** and **/. Ex: ```sql - #Single line comment style 1 INSERT INTO users(login,name) VALUES('jdoe','John DOE'); @@ -311,9 +302,7 @@ To make schema discovery easier and more interactive, the following commands are The schema objects (cluster, keyspace, table, type, function and aggregate) are displayed in a tabular format. There is a drop-down menu on the top left corner to expand objects details. On the top right menu is shown the Icon legend. -
- ![Describe Schema](../assets/themes/zeppelin/img/docs-img/cassandra-DescribeSchema.png) -
+![Describe Schema](../assets/themes/zeppelin/img/docs-img/cassandra-DescribeSchema.png) ## Runtime Parameters @@ -402,7 +391,6 @@ Some parameters only accept restricted values: Some examples: ```sql - CREATE TABLE IF NOT EXISTS spark_demo.ts( key int PRIMARY KEY, value text diff --git a/docs/interpreter/elasticsearch.md b/docs/interpreter/elasticsearch.md index 7f3fb276552..00fa351703b 100644 --- a/docs/interpreter/elasticsearch.md +++ b/docs/interpreter/elasticsearch.md @@ -55,9 +55,7 @@ limitations under the License. -
- ![Interpreter configuration](../assets/themes/zeppelin/img/docs-img/elasticsearch-config.png) -
+![Interpreter configuration](../assets/themes/zeppelin/img/docs-img/elasticsearch-config.png) > **Note #1 :** You can add more properties to configure the Elasticsearch client. diff --git a/docs/interpreter/flink.md b/docs/interpreter/flink.md index 3d065465dbd..f29f32ee8c1 100644 --- a/docs/interpreter/flink.md +++ b/docs/interpreter/flink.md @@ -55,22 +55,23 @@ For more information about Flink configuration, you can find it [here](https://c ## How to test it's working In example, by using the [Zeppelin notebook](https://www.zeppelinhub.com/viewer/notebooks/aHR0cHM6Ly9yYXcuZ2l0aHVidXNlcmNvbnRlbnQuY29tL05GTGFicy96ZXBwZWxpbi1ub3RlYm9va3MvbWFzdGVyL25vdGVib29rcy8yQVFFREs1UEMvbm90ZS5qc29u) is from Till Rohrmann's presentation [Interactive data analysis with Apache Flink](http://www.slideshare.net/tillrohrmann/data-analysis-49806564) for Apache Flink Meetup. -``` +```bash %sh rm 10.txt.utf-8 wget http://www.gutenberg.org/ebooks/10.txt.utf-8 ``` -{% highlight scala %} + +```scala %flink case class WordCount(word: String, frequency: Int) val bible:DataSet[String] = env.readTextFile("10.txt.utf-8") val partialCounts: DataSet[WordCount] = bible.flatMap{ line => """\b\w+\b""".r.findAllIn(line).map(word => WordCount(word, 1)) -// line.split(" ").map(word => WordCount(word, 1)) + //line.split(" ").map(word => WordCount(word, 1)) } val wordCounts = partialCounts.groupBy("word").reduce{ (left, right) => WordCount(left.word, left.frequency + right.frequency) } val result10 = wordCounts.first(10).collect() -{% endhighlight %} +``` diff --git a/docs/interpreter/geode.md b/docs/interpreter/geode.md index f833f9d8911..e9d3ff0bcb7 100644 --- a/docs/interpreter/geode.md +++ b/docs/interpreter/geode.md @@ -39,7 +39,7 @@ limitations under the License. This interpreter supports the [Geode](http://geode.incubator.apache.org/) [Object Query Language (OQL)](http://geode-docs.cfapps.io/docs/developing/querying_basics/oql_compared_to_sql.html). With the OQL-based querying language: -[zeppelin-view](https://www.youtube.com/watch?v=zvzzA9GXu3Q) +[zeppelin-view](https://www.youtube.com/watch?v=zvzzA9GXu3Q) * You can query on any arbitrary object * You can navigate object collections @@ -198,7 +198,7 @@ http://phd1.localdomain:8484/gemfire-api/v1/ > To enable Geode REST API with JSON support add the following properties to geode.server.properties.file and restart: -``` +```properties http-service-port=8484 start-dev-rest-api=true ``` diff --git a/docs/interpreter/hdfs.md b/docs/interpreter/hdfs.md index d7b7bf885d8..11e9c1683c6 100644 --- a/docs/interpreter/hdfs.md +++ b/docs/interpreter/hdfs.md @@ -50,13 +50,12 @@ limitations under the License. -
This interpreter connects to HDFS using the HTTP WebHDFS interface. It supports the basic shell file commands applied to HDFS, it currently only supports browsing. -* You can use ls [PATH] and ls -l [PATH] to list a directory. If the path is missing, then the current directory is listed. ls supports a -h flag for human readable file sizes. -* You can use cd [PATH] to change your current directory by giving a relative or an absolute path. -* You can invoke pwd to see your current directory. +* You can use `ls [PATH]` and `ls -l [PATH]` to list a directory. If the path is missing, then the current directory is listed. `ls` supports a `-h` flag for human readable file sizes. +* You can use `cd [PATH]` to change your current directory by giving a relative or an absolute path. +* You can invoke `pwd` to see your current directory. > **Tip :** Use ( Ctrl + . ) for autocompletion. @@ -64,7 +63,6 @@ It supports the basic shell file commands applied to HDFS, it currently only sup In a notebook, to enable the **HDFS** interpreter, click the **Gear** icon and select **HDFS**. - ## WebHDFS REST API You can confirm that you're able to access the WebHDFS API by running a curl command against the WebHDFS end point provided to the interpreter. @@ -73,4 +71,3 @@ Here is an example: ```bash $> curl "http://localhost:50070/webhdfs/v1/?op=LISTSTATUS" ``` - diff --git a/docs/interpreter/ignite.md b/docs/interpreter/ignite.md index a085dc1aef2..1b21cf44d7d 100644 --- a/docs/interpreter/ignite.md +++ b/docs/interpreter/ignite.md @@ -42,7 +42,7 @@ In order to use Ignite interpreters, you may install Apache Ignite in some simpl > **Tip. If you want to run Ignite examples on the cli not IDE, you can export executable Jar file from IDE. Then run it by using below command.** -``` +```bash $ nohup java -jar ``` @@ -96,7 +96,7 @@ In order to execute SQL query, use ` %ignite.ignitesql ` prefix.
Supposing you are running `org.apache.ignite.examples.streaming.wordcount.StreamWords`, then you can use "words" cache( Of course you have to specify this cache name to the Ignite interpreter setting section `ignite.jdbc.url` of Zeppelin ). For example, you can select top 10 words in the words cache using the following query -``` +```sql %ignite.ignitesql select _val, count(_val) as cnt from String group by _val order by cnt desc limit 10 ``` @@ -105,7 +105,7 @@ select _val, count(_val) as cnt from String group by _val order by cnt desc limi As long as your Ignite version and Zeppelin Ignite version is same, you can also use scala code. Please check the Zeppelin Ignite version before you download your own Ignite. -``` +```scala %ignite import org.apache.ignite._ import org.apache.ignite.cache.affinity._ diff --git a/docs/interpreter/jdbc.md b/docs/interpreter/jdbc.md index 25230947da6..8bb582c0bb2 100644 --- a/docs/interpreter/jdbc.md +++ b/docs/interpreter/jdbc.md @@ -209,7 +209,7 @@ Here are some examples you can refer to. Including the below connectors, you can -##### Properties +#### Properties @@ -233,7 +233,7 @@ Here are some examples you can refer to. Including the below connectors, you can
Name
-##### Dependencies +#### Dependencies @@ -249,7 +249,7 @@ Here are some examples you can refer to. Including the below connectors, you can -##### Properties +#### Properties
Artifact
@@ -273,7 +273,7 @@ Here are some examples you can refer to. Including the below connectors, you can
Name
-##### Dependencies +#### Dependencies @@ -392,7 +392,7 @@ Before Adding one of the below dependencies, check the Phoenix version first. -##### Properties +#### Properties
Artifact
@@ -408,7 +408,7 @@ Before Adding one of the below dependencies, check the Phoenix version first.
Name
-##### Dependencies +#### Dependencies diff --git a/docs/interpreter/lens.md b/docs/interpreter/lens.md index b929220339a..bf4ac1f37d0 100644 --- a/docs/interpreter/lens.md +++ b/docs/interpreter/lens.md @@ -35,7 +35,7 @@ In order to use Lens interpreters, you may install Apache Lens in some simple st 2. Before running Lens, you have to set HIVE_HOME and HADOOP_HOME. If you want to get more information about this, please refer to [here](http://lens.apache.org/lenshome/install-and-run.html#Installation). Lens also provides Pseudo Distributed mode. [Lens pseudo-distributed setup](http://lens.apache.org/lenshome/pseudo-distributed-setup.html) is done by using [docker](https://www.docker.com/). Hive server and hadoop daemons are run as separate processes in lens pseudo-distributed setup. 3. Now, you can start lens server (or stop). -``` +```bash ./bin/lens-ctl start (or stop) ``` @@ -104,71 +104,50 @@ You can analyze your data by using [OLAP Cube](http://lens.apache.org/user/olap- You may experience OLAP Cube like this [Video tutorial](https://cwiki.apache.org/confluence/display/LENS/2015/07/13/20+Minute+video+demo+of+Apache+Lens+through+examples). As you can see in this video, they are using Lens Client Shell(./bin/lens-cli.sh). All of these functions also can be used on Zeppelin by using Lens interpreter. -
  • Create and Use(Switch) Databases. +* Create and Use(Switch) Databases. ``` create database newDb -``` - -``` use newDb ``` -
  • Create Storage. +* Create Storage. ``` create storage your/path/to/lens/client/examples/resources/db-storage.xml ``` -
  • Create Dimensions, Show fields and join-chains of them. +* Create Dimensions, Show fields and join-chains of them. ``` create dimension your/path/to/lens/client/examples/resources/customer.xml -``` - -``` dimension show fields customer -``` - -``` dimension show joinchains customer ``` -
  • Create Caches, Show fields and join-chains of them. +* Create Caches, Show fields and join-chains of them. ``` create cube your/path/to/lens/client/examples/resources/sales-cube.xml -``` - -``` cube show fields sales -``` - -``` cube show joinchains sales ``` -
  • Create Dimtables and Fact. +* Create Dimtables and Fact. ``` create dimtable your/path/to/lens/client/examples/resources/customer_table.xml -``` - -``` create fact your/path/to/lens/client/examples/resources/sales-raw-fact.xml ``` -
  • Add partitions to Dimtable and Fact. +* Add partitions to Dimtable and Fact. ``` dimtable add single-partition --dimtable_name customer_table --storage_name local --path your/path/to/lens/client/examples/resources/customer-local-part.xml -``` - -``` fact add partitions --fact_name sales_raw_fact --storage_name local --path your/path/to/lens/client/examples/resources/sales-raw-local-parts.xml ``` -
  • Now, you can run queries on cubes. +* Now, you can run queries on cubes. ``` query execute cube select customer_city_name, product_details.description, product_details.category, product_details.color, store_sales from sales where time_range_in(delivery_time, '2015-04-11-00', '2015-04-13-00') diff --git a/docs/interpreter/livy.md b/docs/interpreter/livy.md index d725304c059..f0abc1afc42 100644 --- a/docs/interpreter/livy.md +++ b/docs/interpreter/livy.md @@ -150,7 +150,7 @@ Basically, you can use **spark** -``` +```scala %livy.spark sc.version ``` @@ -158,7 +158,7 @@ sc.version **pyspark** -``` +```python %livy.pyspark print "1" ``` @@ -181,7 +181,7 @@ When Zeppelin server is running with authentication enabled, then this interpret ## Apply Zeppelin Dynamic Forms You can leverage [Zeppelin Dynamic Form](../manual/dynamicform.html). You can use both the `text input` and `select form` parameterization features. -``` +```python %livy.pyspark print "${group_by=product_id,product_id|product_name|customer_id|store_id}" ``` diff --git a/docs/interpreter/markdown.md b/docs/interpreter/markdown.md index e5d33d321ad..43d0af11a38 100644 --- a/docs/interpreter/markdown.md +++ b/docs/interpreter/markdown.md @@ -27,7 +27,7 @@ limitations under the License. [Markdown](http://daringfireball.net/projects/markdown/) is a plain text formatting syntax designed so that it can be converted to HTML. Apache Zeppelin uses [markdown4j](https://github.com/jdcasey/markdown4j) and [pegdown](https://github.com/sirthias/pegdown) as markdown parsers. -In Zeppelin notebook, you can use ` %md ` in the beginning of a paragraph to invoke the Markdown interpreter and generate static html from Markdown plain text. +In Zeppelin notebook, you can use `%md` in the beginning of a paragraph to invoke the Markdown interpreter and generate static html from Markdown plain text. In Zeppelin, Markdown interpreter is enabled by default and uses the [markdown4j](https://github.com/jdcasey/markdown4j) parser. diff --git a/docs/interpreter/postgresql.md b/docs/interpreter/postgresql.md index 20ef43b6c31..7d18f63291c 100644 --- a/docs/interpreter/postgresql.md +++ b/docs/interpreter/postgresql.md @@ -66,7 +66,7 @@ Postgresql Interpreter will be deprecated and merged into JDBC Interpreter. You ## Overview -[zeppelin-view](https://www.youtube.com/watch?v=wqXXQhJ5Uk8) +[zeppelin-view](https://www.youtube.com/watch?v=wqXXQhJ5Uk8) This interpreter seamlessly supports the following SQL data processing engines: diff --git a/docs/interpreter/scalding.md b/docs/interpreter/scalding.md index 22027f22dee..00ab1b90a84 100644 --- a/docs/interpreter/scalding.md +++ b/docs/interpreter/scalding.md @@ -28,21 +28,17 @@ limitations under the License. ## Building the Scalding Interpreter You have to first build the Scalding interpreter by enable the **scalding** profile as follows: -``` +```bash mvn clean package -Pscalding -DskipTests ``` ## Enabling the Scalding Interpreter In a notebook, to enable the **Scalding** interpreter, click on the **Gear** icon,select **Scalding**, and hit **Save**. -
    - ![Interpreter Binding](../assets/themes/zeppelin/img/docs-img/scalding-InterpreterBinding.png) ![Interpreter Selection](../assets/themes/zeppelin/img/docs-img/scalding-InterpreterSelection.png) -
    - ## Configuring the Interpreter Scalding interpreter runs in two modes: @@ -88,7 +84,7 @@ option and set max.open.instances argument. In example, by using the [Alice in Wonderland](https://gist.github.com/johnynek/a47699caa62f4f38a3e2) tutorial, we will count words (of course!), and plot a graph of the top 10 words in the book. -``` +```scala %scalding import scala.io.Source @@ -113,14 +109,13 @@ val top10 = wordCount .sortBy { case (word, count) => -count } .take(10) top10.dump - -``` ``` + +```scala %scalding val table = "words\t count\n" + top10.toIterator.map{case (k, (word, count)) => s"$word\t$count"}.mkString("\n") print("%table " + table) - ``` If you click on the icon for the pie chart, you should be able to see a chart like this: @@ -131,7 +126,7 @@ If you click on the icon for the pie chart, you should be able to see a chart li **Test mode** -``` +```scala %scalding mode ``` @@ -144,7 +139,7 @@ res4: com.twitter.scalding.Mode = Hdfs(true,Configuration: core-default.xml, cor **Test HDFS read** -``` +```scala val testfile = TypedPipe.from(TextLine("/user/x/testfile")) testfile.dump ``` @@ -153,11 +148,10 @@ This command should print the contents of the hdfs file /user/x/testfile. **Test map-reduce job** -``` +```scala val testfile = TypedPipe.from(TextLine("/user/x/testfile")) val a = testfile.groupAll.size.values a.toList - ``` This command should create a map reduce job. diff --git a/docs/interpreter/spark.md b/docs/interpreter/spark.md index 035a01e19c1..252ca4a500f 100644 --- a/docs/interpreter/spark.md +++ b/docs/interpreter/spark.md @@ -287,21 +287,21 @@ So you can put some objects from Scala and read it from Python, vice versa.
    -{% highlight scala %} +```scala // Put object from scala %spark val myObject = ... z.put("objName", myObject) -{% endhighlight %} +```
    -{% highlight python %} +```python # Get object from python %spark.pyspark myObject = z.get("objName") -{% endhighlight %} +```
    @@ -313,7 +313,7 @@ In Scala and Python environments, you can create forms programmatically.
    -{% highlight scala %} +```scala %spark /* Create text input form */ z.input("formName") @@ -328,12 +328,12 @@ z.select("formName", Seq(("option1", "option1DisplayName"), /* Create select form with default value*/ z.select("formName", "option1", Seq(("option1", "option1DisplayName"), ("option2", "option2DisplayName"))) -{% endhighlight %} +```
    -{% highlight python %} +```python %spark.pyspark # Create text input form z.input("formName") @@ -348,7 +348,7 @@ z.select("formName", [("option1", "option1DisplayName"), # Create select form with default value z.select("formName", [("option1", "option1DisplayName"), ("option2", "option2DisplayName")], "option1") -{% endhighlight %} +```
    diff --git a/docs/manual/dynamicform.md b/docs/manual/dynamicform.md index e0adb4c0e79..7e5506760de 100644 --- a/docs/manual/dynamicform.md +++ b/docs/manual/dynamicform.md @@ -38,12 +38,10 @@ for example - Also you can provide default value, using `${formName=defaultValue}`. - ### Select form To create select form, use `${formName=defaultValue,option1|option2...}` @@ -73,52 +71,54 @@ Some language backend uses programmatic way to create form. For example [Zeppeli Here're some examples. ### Text input form +
    -
    +
    -{% highlight scala %} +```scala %spark println("Hello "+z.input("name")) -{% endhighlight %} +``` -
    -
    +
    +
    -{% highlight python %} +```python %pyspark print("Hello "+z.input("name")) -{% endhighlight %} +``` -
    +
    ### Text input form with default value +
    -
    +
    -{% highlight scala %} +```scala %spark println("Hello "+z.input("name", "sun")) -{% endhighlight %} +``` -
    -
    +
    +
    -{% highlight python %} +```python %pyspark print("Hello "+z.input("name", "sun")) -{% endhighlight %} +``` -
    +
    ### Select form
    -
    +
    -{% highlight scala %} +```scala %spark println("Hello "+z.select("day", Seq(("1","mon"), ("2","tue"), @@ -127,12 +127,12 @@ println("Hello "+z.select("day", Seq(("1","mon"), ("5","fri"), ("6","sat"), ("7","sun")))) -{% endhighlight %} +``` -
    -
    +
    +
    -{% highlight python %} +```python %pyspark print("Hello "+z.select("day", [("1","mon"), ("2","tue"), @@ -141,31 +141,31 @@ print("Hello "+z.select("day", [("1","mon"), ("5","fri"), ("6","sat"), ("7","sun")])) -{% endhighlight %} +``` -
    +
    #### Checkbox form
    -
    +
    -{% highlight scala %} +```scala %spark val options = Seq(("apple","Apple"), ("banana","Banana"), ("orange","Orange")) println("Hello "+z.checkbox("fruit", options).mkString(" and ")) -{% endhighlight %} +``` -
    -
    +
    +
    -{% highlight python %} +```python %pyspark options = [("apple","Apple"), ("banana","Banana"), ("orange","Orange")] print("Hello "+ " and ".join(z.checkbox("fruit", options, ["apple"]))) -{% endhighlight %} +``` -
    +
    diff --git a/docs/manual/interpreterinstallation.md b/docs/manual/interpreterinstallation.md index 4999f613714..8becea47274 100644 --- a/docs/manual/interpreterinstallation.md +++ b/docs/manual/interpreterinstallation.md @@ -29,25 +29,25 @@ Apache Zeppelin provides **Interpreter Installation** mechanism for whom downloa Apache Zeppelin provides several interpreters as [community managed interpreters](#available-community-managed-interpreters). If you downloaded `netinst` binary package, you need to install by using below commands. -#### Install all community managed interpreters +### Install all community managed interpreters -``` +```sh ./bin/install-interpreter.sh --all ``` -#### Install specific interpreters +### Install specific interpreters -``` +```sh ./bin/install-interpreter.sh --name md,shell,jdbc,python ``` You can get full list of community managed interpreters by running -``` +```sh ./bin/install-interpreter.sh --list ``` -#### Install interpreter built with Scala 2.10 +### Install interpreter built with Scala 2.10 From version 0.6.1, Zeppelin support both Scala 2.10 and 2.11 for several interpreters as below:
  • Artifact
    @@ -80,19 +80,18 @@ From version 0.6.1, Zeppelin support both Scala 2.10 and 2.11 for several interp If you install one of these interpreters only with `--name` option, installer will download interpreter built with Scala 2.11 by default. If you want to specify Scala version, you will need to add `--artifact` option. Here is the example of installing flink interpreter built with Scala 2.10. -``` +```sh ./bin/install-interpreter.sh --name flink --artifact org.apache.zeppelin:zeppelin-flink_2.10:0.6.1 ``` -#### Install Spark interpreter built with Scala 2.10 +### Install Spark interpreter built with Scala 2.10 Spark distribution package has been built with Scala 2.10 until 1.6.2. If you have `SPARK_HOME` set pointing to Spark version earlier than 2.0.0, you need to download Spark interpreter packaged with Scala 2.10. To do so, use follow command: -``` +```sh rm -rf ./interpreter/spark ./bin/install-interpreter.sh --name spark --artifact org.apache.zeppelin:zeppelin-spark_2.10:0.6.1 ``` -
    Once you have installed interpreters, you need to restart Zeppelin. And then [create interpreter setting](../manual/interpreters.html#what-is-zeppelin-interpreter) and [bind it with your notebook](../manual/interpreters.html#what-is-zeppelin-interpreter-setting). @@ -100,9 +99,9 @@ Once you have installed interpreters, you need to restart Zeppelin. And then [cr You can also install 3rd party interpreters located in the maven repository by using below commands. -#### Install 3rd party interpreters +### Install 3rd party interpreters -``` +```sh ./bin/install-interpreter.sh --name interpreter1 --artifact groupId1:artifact1:version1 ``` @@ -112,9 +111,9 @@ Once you have installed interpreters, you'll need to add interpreter class name And then restart Zeppelin, [create interpreter setting](../manual/interpreters.html#what-is-zeppelin-interpreter) and [bind it with your notebook](../manual/interpreters.html#what-is-zeppelin-interpreter-setting). -#### Install multiple 3rd party interpreters at once +### Install multiple 3rd party interpreters at once -``` +```sh ./bin/install-interpreter.sh --name interpreter1,interpreter2 --artifact groupId1:artifact1:version1,groupId2:artifact2:version2 ``` diff --git a/docs/manual/interpreters.md b/docs/manual/interpreters.md index 4844f95b3ed..9314d14e17f 100644 --- a/docs/manual/interpreters.md +++ b/docs/manual/interpreters.md @@ -72,11 +72,10 @@ In 'shared' mode, every notebook bound to the Interpreter Setting will share the Zeppelin users can start interpreter thread embedded in their service. This will provide flexibility to user to start interpreter on remote host. To start interpreter along with your service you have to create an instance of ``RemoteInterpreterServer`` and start it as follows: -``` -RemoteInterpreterServer interpreter=new RemoteInterpreterServer(3678); +```java +RemoteInterpreterServer interpreter = new RemoteInterpreterServer(3678); // Here, 3678 is the port on which interpreter will listen. -interpreter.start() - +interpreter.start() ``` The above code will start interpreter thread inside your process. Once the interpreter is started you can configure zeppelin to connect to RemoteInterpreter by checking **Connect to existing process** checkbox and then provide **Host** and **Port** on which interpreter process is listening as shown in the image below: @@ -101,7 +100,8 @@ print "This code should be entered into the paragraph by the user!" ``` The output should be: -``` + +```text This code should be executed before the paragraph code! This code should be entered into the paragraph by the user! This code should be executed after the paragraph code! diff --git a/docs/manual/notebookashomepage.md b/docs/manual/notebookashomepage.md index 729f3247c69..2c7dfc6cb55 100644 --- a/docs/manual/notebookashomepage.md +++ b/docs/manual/notebookashomepage.md @@ -64,7 +64,6 @@ Restart your Zeppelin server ``` That's it! Open your browser and navigate to Apache Zeppelin and see your customized homepage. -
    ## Show notes list in your custom homepage If you want to display the list of notes on your custom Apache Zeppelin homepage all you need to do is use our %angular support. diff --git a/docs/manual/publish.md b/docs/manual/publish.md index 00b070ab659..ffee09bc006 100644 --- a/docs/manual/publish.md +++ b/docs/manual/publish.md @@ -45,5 +45,6 @@ For example, Finally, you can show off your beautiful visualization results in your website.
    +
    > **Note**: To embed the paragraph in a website, Apache Zeppelin needs to be reachable by that website. And please use this feature with caution and in a trusted environment only, as Zeppelin entire Webapp could be accessible by whoever visits your website. diff --git a/docs/quickstart/explorezeppelinui.md b/docs/quickstart/explorezeppelinui.md index 22b2b1c19d2..2dd34f5a310 100644 --- a/docs/quickstart/explorezeppelinui.md +++ b/docs/quickstart/explorezeppelinui.md @@ -43,7 +43,6 @@ if you provide the URL. By default, the name of the imported note is the same as the original note but you can override it by providing a new name. -
    ## Menus ### Notebook @@ -89,8 +88,6 @@ This menu displays all the Zeppelin configuration that are set in the config fil - -
    ## Note Layout Each Zeppelin note is composed of 1 .. N paragraphs. The note can be viewed as a paragraph container. diff --git a/docs/quickstart/install_with_flink_and_spark_cluster.md b/docs/quickstart/install_with_flink_and_spark_cluster.md index 89767c3cc88..7fdd11f3368 100644 --- a/docs/quickstart/install_with_flink_and_spark_cluster.md +++ b/docs/quickstart/install_with_flink_and_spark_cluster.md @@ -45,20 +45,20 @@ Assuming the minimal install, there are several programs that we will need to in For git, openssh-server, and OpenJDK 7 we will be using the apt package manager. -##### git +#### git From the command prompt: ``` sudo apt-get install git ``` -##### openssh-server +#### openssh-server ``` sudo apt-get install openssh-server ``` -##### OpenJDK 7 +#### OpenJDK 7 ``` sudo apt-get install openjdk-7-jdk openjdk-7-jre-lib @@ -71,7 +71,7 @@ sudo apt-get update sudo apt-get install openjdk-7-jdk openjdk-7-jre-lib ``` -##### Maven 3.1+ +#### Maven 3.1+ Zeppelin requires maven version 3.x. The version available in the repositories at the time of writing is 2.x, so maven must be installed manually. Purge any existing versions of maven. @@ -154,7 +154,7 @@ Open a web-browser on a machine connected to the same network as the host (or in See the [Zeppelin tutorial](../tutorial/tutorial.md) for basic Zeppelin usage. It is also advised that you take a moment to check out the tutorial notebook that is included with each Zeppelin install, and to familiarize yourself with basic notebook functionality. -##### Flink Test +#### Flink Test Create a new notebook named "Flink Test" and copy and paste the following code. @@ -196,7 +196,7 @@ counts.collect().foreach(println(_)) // execute the script and print each eleme Run the code to make sure the built-in Zeppelin Flink interpreter is working properly. -##### Spark Test +#### Spark Test Create a new notebook named "Spark Test" and copy and paste the following code. ```scala @@ -243,9 +243,9 @@ bin/zeppelin-daemon.sh stop ### Installing Clusters -##### Flink Cluster +#### Flink Cluster -###### Download Binaries +##### Download Binaries Building from source is recommended where possible, for simplicity in this tutorial we will download Flink and Spark Binaries. @@ -264,7 +264,7 @@ Start the Flink Cluster. flink-1.0.3/bin/start-cluster.sh ``` -###### Building From source +##### Building From source If you wish to build Flink from source, the following will be instructive. Note that if you have downloaded and used the binary version this should be skipped. The changing nature of build tools and versions across platforms makes this section somewhat precarious. For example, Java8 and Maven 3.0.3 are recommended for building Flink, which are not recommended for Zeppelin at the time of writing. If the user wishes to attempt to build from source, this section will provide some reference. If errors are encountered, please contact the Apache Flink community. @@ -286,7 +286,7 @@ Start the Flink Cluster in stand-alone mode build-target/bin/start-cluster.sh ``` -###### Ensure the cluster is up +##### Ensure the cluster is up In a browser, navigate to http://`yourip`:8082 to see the Flink Web-UI. Click on 'Task Managers' in the left navigation bar. Ensure there is at least one Task Manager present. @@ -368,7 +368,7 @@ spark/sbin/start-master.sh --webui-port 8082 Open a browser and navigate to http://`yourip`:8082 to ensure the Spark master is running. -
    ![alt text](../assets/themes/zeppelin/img/screenshots/spark-master-webui1.png "It should look like this...")
    +![alt text](../assets/themes/zeppelin/img/screenshots/spark-master-webui1.png "It should look like this...") Toward the top of the page there will be a *URL*: spark://`yourhost`:7077. Note this URL, the Spark Master URI, it will be needed in subsequent steps. diff --git a/docs/quickstart/tutorial.md b/docs/quickstart/tutorial.md index 4947f3ce8a0..5a43af87ac7 100644 --- a/docs/quickstart/tutorial.md +++ b/docs/quickstart/tutorial.md @@ -75,7 +75,6 @@ Now we want to see age distribution with certain marital status and add combo bo %sql select age, count(1) from bank where marital="${marital=single,single|divorced|married}" group by age order by age ``` -
    ## Tutorial with Streaming Data ### Data Refine diff --git a/docs/rest-api/rest-configuration.md b/docs/rest-api/rest-configuration.md index 525ddaf9989..de8327c0a1b 100644 --- a/docs/rest-api/rest-configuration.md +++ b/docs/rest-api/rest-configuration.md @@ -39,12 +39,12 @@ nd a need for an additional REST API, please [file an issue or send us mail](../ - - + @@ -98,12 +98,12 @@ nd a need for an additional REST API, please [file an issue or send us mail](../ - - + diff --git a/docs/rest-api/rest-credential.md b/docs/rest-api/rest-credential.md index b8140da17f4..16b988b7552 100644 --- a/docs/rest-api/rest-credential.md +++ b/docs/rest-api/rest-credential.md @@ -30,19 +30,19 @@ Note that Apache Zeppelin REST APIs receive or return JSON objects, it is recomm If you work with Apache Zeppelin and find a need for an additional REST API, please [file an issue or send us an email](http://zeppelin.apache.org/community.html). -
    ## Credential REST API List ### List Credential information +
    DescriptionThis ```GET``` method return all key/value pair of configurations on the server.
    +
    This GET method return all key/value pair of configurations on the server.
    Note: For security reason, some pairs would not be shown.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/configurations/all```http://[zeppelin-server]:[zeppelin-port]/api/configurations/all
    Success code
    DescriptionThis ```GET``` method return all prefix matched key/value pair of configurations on the server.
    +
    This GET method return all prefix matched key/value pair of configurations on the server.
    Note: For security reason, some pairs would not be shown.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/configurations/prefix/[prefix]```http://[zeppelin-server]:[zeppelin-port]/api/configurations/prefix/[prefix]
    Success code
    - + - + @@ -76,17 +76,17 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```GET``` method returns all key/value pairs of the credential information on the server.This GET method returns all key/value pairs of the credential information on the server.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/credential```http://[zeppelin-server]:[zeppelin-port]/api/credential
    Success code
    -
    ### Create an Credential Information + - + - + @@ -120,19 +120,17 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```PUT``` method creates the credential information with new properties.This PUT method creates the credential information with new properties.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/credential/```http://[zeppelin-server]:[zeppelin-port]/api/credential/
    Success code
    - -
    ### Delete all Credential Information - + - + @@ -150,19 +148,17 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```DELETE``` method deletes the credential information.This DELETE method deletes the credential information.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/credential```http://[zeppelin-server]:[zeppelin-port]/api/credential
    Success code
    - -
    ### Delete an Credential entity - + - + @@ -179,7 +175,3 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```DELETE``` method deletes a given credential entity.This DELETE method deletes a given credential entity.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/credential/[entity]```http://[zeppelin-server]:[zeppelin-port]/api/credential/[entity]
    Success code
    - - -
    - diff --git a/docs/rest-api/rest-interpreter.md b/docs/rest-api/rest-interpreter.md index 4f85e693f52..820ef18b635 100644 --- a/docs/rest-api/rest-interpreter.md +++ b/docs/rest-api/rest-interpreter.md @@ -40,11 +40,11 @@ The role of registered interpreters, settings and interpreters group are describ Description - This ```GET``` method returns all the registered interpreters available on the server. + This GET method returns all the registered interpreters available on the server. URL - ```http://[zeppelin-server]:[zeppelin-port]/api/interpreter``` + http://[zeppelin-server]:[zeppelin-port]/api/interpreter Success code @@ -104,18 +104,17 @@ The role of registered interpreters, settings and interpreters group are describ -
    ### List of registered interpreter settings - + - + @@ -179,18 +178,17 @@ The role of registered interpreters, settings and interpreters group are describ
    DescriptionThis ```GET``` method returns all the interpreters settings registered on the server.This GET method returns all the interpreters settings registered on the server.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting
    Success code
    -
    ### Create a new interpreter setting - + - + @@ -266,17 +264,17 @@ The role of registered interpreters, settings and interpreters group are describ
    DescriptionThis ```POST``` method adds a new interpreter setting using a registered interpreter to the server.This POST method adds a new interpreter setting using a registered interpreter to the server.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting
    Success code
    -
    ### Update an interpreter setting + - + - + @@ -349,18 +347,17 @@ The role of registered interpreters, settings and interpreters group are describ
    DescriptionThis ```PUT``` method updates an interpreter setting with new properties.This PUT method updates an interpreter setting with new properties.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting/[interpreter ID]```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting/[interpreter ID]
    Success code
    -
    ### Delete an interpreter setting - + - + @@ -378,19 +375,17 @@ The role of registered interpreters, settings and interpreters group are describ
    DescriptionThis ```DELETE``` method deletes an given interpreter setting.This DELETE method deletes an given interpreter setting.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting/[interpreter ID]```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting/[interpreter ID]
    Success code
    - -
    ### Restart an interpreter - + - + @@ -418,18 +413,17 @@ The role of registered interpreters, settings and interpreters group are describ
    DescriptionThis ```PUT``` method restarts the given interpreter id.This PUT method restarts the given interpreter id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting/restart/[interpreter ID]```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/setting/restart/[interpreter ID]
    Success code
    -
    ### Add a new repository for dependency resolving - + - + @@ -459,18 +453,17 @@ The role of registered interpreters, settings and interpreters group are describ
    DescriptionThis ```POST``` method adds new repository.This POST method adds new repository.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/repository```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/repository
    Success code
    -
    ### Delete a repository for dependency resolving - + - + @@ -481,4 +474,3 @@ The role of registered interpreters, settings and interpreters group are describ
    DescriptionThis ```DELETE``` method delete repository with given id.This DELETE method delete repository with given id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/repository/[repository ID]```http://[zeppelin-server]:[zeppelin-port]/api/interpreter/repository/[repository ID]
    Success code 500
    - diff --git a/docs/rest-api/rest-notebook.md b/docs/rest-api/rest-notebook.md index 1e49d1ed912..55bba64c67a 100644 --- a/docs/rest-api/rest-notebook.md +++ b/docs/rest-api/rest-notebook.md @@ -24,29 +24,30 @@ limitations under the License.
    ## Overview + Apache Zeppelin provides several REST APIs for interaction and remote activation of zeppelin functionality. All REST APIs are available starting with the following endpoint `http://[zeppelin-server]:[zeppelin-port]/api`. Note that Apache Zeppelin REST APIs receive or return JSON objects, it is recommended for you to install some JSON viewers such as [JSONView](https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc). If you work with Apache Zeppelin and find a need for an additional REST API, please [file an issue or send us an email](http://zeppelin.apache.org/community.html). - ## Notebook REST API List Notebooks REST API supports the following operations: List, Create, Get, Delete, Clone, Run, Export, Import as detailed in the following tables. ### List of the notes + - - + @@ -76,19 +77,19 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```GET``` method lists the available notes on your server. - Notebook JSON contains the ```name``` and ```id``` of all notes. + This GET method lists the available notes on your server. + Notebook JSON contains the name and id of all notes.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook```http://[zeppelin-server]:[zeppelin-port]/api/notebook
    Success code
    -
    ### Create a new note + - - + @@ -130,19 +131,19 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```POST``` method creates a new note using the given name or default name if none given. + This POST method creates a new note using the given name or default name if none given. The body field of the returned JSON contains the new note id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook```http://[zeppelin-server]:[zeppelin-port]/api/notebook
    Success code
    -
    ### Get an existing note information + - - + @@ -227,18 +228,18 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```GET``` method retrieves an existing note's information using the given id. + This GET method retrieves an existing note's information using the given id. The body field of the returned JSON contain information about paragraphs in the note.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]
    Success code
    -
    ### Delete a note + - - + @@ -254,20 +255,20 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```DELETE``` method deletes a note by the given note id. + This DELETE method deletes a note by the given note id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]
    Success code
    -
    ### Clone a note + - - + @@ -292,21 +293,21 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```POST``` method clones a note by the given id and create a new note using the given name + This POST method clones a note by the given id and create a new note using the given name or default name if none given. The body field of the returned JSON contains the new note id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]
    Success code
    -
    ### Run all paragraphs + - + @@ -324,33 +325,33 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    Description - This ```POST``` method runs all paragraphs in the given note id.
    + This POST method runs all paragraphs in the given note id.
    If you can not find Note id 404 returns. If there is a problem with the interpreter returns a 412 error.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]
    Success code sample JSON error response
    -           {
    -             "status": "NOT_FOUND",
    -             "message": "note not found."
    -           }
    -         

    +{ + "status": "NOT_FOUND", + "message": "note not found." +} +
    -           {
    -             "status": "PRECONDITION_FAILED",
    -             "message": "paragraph_1469771130099_-278315611 Not selected or Invalid Interpreter bind"
    -           }
    +{
    +  "status": "PRECONDITION_FAILED",
    +  "message": "paragraph_1469771130099_-278315611 Not selected or Invalid Interpreter bind"
    +}
              
    -
    ### Stop all paragraphs + - - + @@ -366,19 +367,19 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```DELETE``` method stops all paragraphs in the given note id. + This DELETE method stops all paragraphs in the given note id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]
    Success code
    -
    ### Get the status of all paragraphs + - - + @@ -412,19 +413,19 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```GET``` method gets the status of all paragraphs by the given note id. + This GET method gets the status of all paragraphs by the given note id. The body field of the returned JSON contains of the array that compose of the paragraph id, paragraph status, paragraph finish date, paragraph started date.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]
    Success code
    -
    ### Get the status of a single paragraph + - - + @@ -449,18 +450,18 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```GET``` method gets the status of a single paragraph by the given note and paragraph id. + This GET method gets the status of a single paragraph by the given note and paragraph id. The body field of the returned JSON contains of the array that compose of the paragraph id, paragraph status, paragraph finish date, paragraph started date.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]/[paragraphId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]/[paragraphId]
    Success code
    -
    ### Run a paragraph asynchronously + - - + @@ -487,18 +488,18 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```POST``` method runs the paragraph asynchronously by given note and paragraph id. This API always return SUCCESS even if the execution of the paragraph fails later because the API is asynchronous + This POST method runs the paragraph asynchronously by given note and paragraph id. This API always return SUCCESS even if the execution of the paragraph fails later because the API is asynchronous
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]/[paragraphId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]/[paragraphId]
    Success code
    -
    ### Run a paragraph synchronously + - - + @@ -537,18 +538,18 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    Description This ```POST``` method runs the paragraph synchronously by given note and paragraph id. This API can return SUCCESS or ERROR depending on the outcome of the paragraph execution + This POST method runs the paragraph synchronously by given note and paragraph id. This API can return SUCCESS or ERROR depending on the outcome of the paragraph execution
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/run/[noteId]/[paragraphId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/run/[noteId]/[paragraphId]
    Success code
    -
    ### Stop a paragraph + - - + @@ -564,18 +565,18 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```DELETE``` method stops the paragraph by given note and paragraph id. + This DELETE method stops the paragraph by given note and paragraph id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]/[paragraphId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/job/[noteId]/[paragraphId]
    Success code
    -
    ### Add Cron Job + - - + @@ -595,19 +596,18 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```POST``` method adds cron job by the given note id. + This POST method adds cron job by the given note id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/cron/[noteId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/cron/[noteId]
    Success code
    -
    - ### Remove Cron Job + - - + @@ -623,20 +623,19 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```DELETE``` method removes cron job by the given note id. + This DELETE method removes cron job by the given note id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/cron/[noteId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/cron/[noteId]
    Success code
    -
    - ### Get Cron Job + - - + @@ -652,18 +651,17 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```GET``` method gets cron job expression of given note id. + This GET method gets cron job expression of given note id. The body field of the returned JSON contains the cron expression.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/cron/[noteId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/cron/[noteId]
    Success code
    -
    ### Full text search through the paragraphs in all notes + - + - + @@ -680,7 +678,7 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple "status": "OK", "body": [ { - "id": "/paragraph/", + "id": "[noteId]/paragraph/[paragraphId]", "name":"Note Name", "snippet":"", "text":"" @@ -690,19 +688,20 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    Description```GET``` request will return list of matching paragraphs - GET request will return list of matching paragraphs
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/search?q=[query]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/search?q=[query]
    Success code
    -
    + ### Create a new paragraph + - - + @@ -740,19 +739,19 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```POST``` method create a new paragraph using JSON payload. + This POST method create a new paragraph using JSON payload. The body field of the returned JSON contain the new paragraph id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]/paragraph```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]/paragraph
    Success code
    -
    ### Get a paragraph information + - - + @@ -808,18 +807,18 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```GET``` method retrieves an existing paragraph's information using the given id. + This GET method retrieves an existing paragraph's information using the given id. The body field of the returned JSON contain information about paragraph.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]/paragraph/[paragraphId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]/paragraph/[paragraphId]
    Success code
    -
    ### Move a paragraph to the specific index + - - + @@ -835,19 +834,18 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```POST``` method moves a paragraph to the specific index (order) from the note. + This POST method moves a paragraph to the specific index (order) from the note.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]/paragraph/[paragraphId]/move/[newIndex]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]/paragraph/[paragraphId]/move/[newIndex]
    Success code
    - -
    ### Delete a paragraph + - - + @@ -863,18 +861,18 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
    DescriptionThis ```DELETE``` method deletes a paragraph by the given note and paragraph id. + This DELETE method deletes a paragraph by the given note and paragraph id.
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]/paragraph/[paragraphId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/[noteId]/paragraph/[paragraphId]
    Success code
    -
    ### Export a note + - - + @@ -884,7 +882,8 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple - + +
    DescriptionThis ```GET``` method exports a note by the given id and gernerates a JSON + This GET method exports a note by the given id and gernerates a JSON
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/export/[noteId]```http://[zeppelin-server]:[zeppelin-port]/api/notebook/export/[noteId]
    Success code Fail code 500
    sample JSON response
    sample JSON response
    {
       "paragraphs": [
         {
    @@ -913,18 +912,18 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
         
    -
    ### Import a note + - - + @@ -934,7 +933,8 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple - + + -
    DescriptionThis ```POST``` method imports a note from the note JSON input + This POST method imports a note from the note JSON input
    URL```http://[zeppelin-server]:[zeppelin-port]/api/notebook/import```http://[zeppelin-server]:[zeppelin-port]/api/notebook/import
    Success code Fail code 500
    sample JSON input
    sample JSON input
     {
       "paragraphs": [
    @@ -970,5 +970,4 @@ If you work with Apache Zeppelin and find a need for an additional REST API, ple
       "body": "2AZPHY918"
     }
    diff --git a/docs/rss.xml b/docs/rss.xml index 8c2a9dd9a8c..dddf9100d27 100644 --- a/docs/rss.xml +++ b/docs/rss.xml @@ -1,5 +1,5 @@ --- -layout: nil +layout: null title : --- diff --git a/docs/security/authentication.md b/docs/security/authentication.md index 60352277883..ffeecee1b49 100644 --- a/docs/security/authentication.md +++ b/docs/security/authentication.md @@ -35,91 +35,94 @@ Here are instructions how to accomplish the setup NGINX as a front-end authentic This instruction based on Ubuntu 14.04 LTS but may work with other OS with few configuration changes. -1. Install NGINX server on your server instance +### 1. Install NGINX server on your server instance + +You can install NGINX server with same box where zeppelin installed or separate box where it is dedicated to serve as proxy server. - You can install NGINX server with same box where zeppelin installed or separate box where it is dedicated to serve as proxy server. +```bash +$ apt-get install nginx +``` - ``` - $ apt-get install nginx - ``` - > **NOTE :** On pre 1.3.13 version of NGINX, Proxy for Websocket may not fully works. Please use latest version of NGINX. See: [NGINX documentation](https://www.nginx.com/blog/websocket-nginx/). +> **NOTE:** On pre 1.3.13 version of NGINX, Proxy for Websocket may not fully works. Please use latest version of NGINX. See: [NGINX documentation](https://www.nginx.com/blog/websocket-nginx/). -1. Setup init script in NGINX +### 2. Setup init script in NGINX - In most cases, NGINX configuration located under `/etc/nginx/sites-available`. Create your own configuration or add your existing configuration at `/etc/nginx/sites-available`. +In most cases, NGINX configuration located under `/etc/nginx/sites-available`. Create your own configuration or add your existing configuration at `/etc/nginx/sites-available`. - ``` - $ cd /etc/nginx/sites-available - $ touch my-zeppelin-auth-setting - ``` +```bash +$ cd /etc/nginx/sites-available +$ touch my-zeppelin-auth-setting +``` - Now add this script into `my-zeppelin-auth-setting` file. You can comment out `optional` lines If you want serve Zeppelin under regular HTTP 80 Port. +Now add this script into `my-zeppelin-auth-setting` file. You can comment out `optional` lines If you want serve Zeppelin under regular HTTP 80 Port. - ``` - upstream zeppelin { - server [YOUR-ZEPPELIN-SERVER-IP]:[YOUR-ZEPPELIN-SERVER-PORT]; # For security, It is highly recommended to make this address/port as non-public accessible +```nginx +upstream zeppelin { + # For security, It is highly recommended to make this endpoint non-public. + server [YOUR-ZEPPELIN-SERVER-IP]:[YOUR-ZEPPELIN-SERVER-PORT]; +} + +server { + listen [YOUR-ZEPPELIN-WEB-SERVER-PORT]; + listen 443 ssl; # optional, to serve HTTPS connection + server_name [YOUR-ZEPPELIN-SERVER-HOST]; # for example: zeppelin.mycompany.com + + ssl_certificate [PATH-TO-YOUR-CERT-FILE]; # optional, for HTTPS + ssl_certificate_key [PATH-TO-YOUR-CERT-KEY-FILE]; # optional, for HTTPS + + if ($ssl_protocol = "") { + rewrite ^ https://$host$request_uri? permanent; # optional, for forcing HTTPS } - # Zeppelin Website - server { - listen [YOUR-ZEPPELIN-WEB-SERVER-PORT]; - listen 443 ssl; # optional, to serve HTTPS connection - server_name [YOUR-ZEPPELIN-SERVER-HOST]; # for example: zeppelin.mycompany.com - - ssl_certificate [PATH-TO-YOUR-CERT-FILE]; # optional, to serve HTTPS connection - ssl_certificate_key [PATH-TO-YOUR-CERT-KEY-FILE]; # optional, to serve HTTPS connection - - if ($ssl_protocol = "") { - rewrite ^ https://$host$request_uri? permanent; # optional, to force use of HTTPS - } - - location / { # For regular websever support - proxy_pass http://zeppelin; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header Host $http_host; - proxy_set_header X-NginX-Proxy true; - proxy_redirect off; - auth_basic "Restricted"; - auth_basic_user_file /etc/nginx/.htpasswd; - } - - location /ws { # For websocket support - proxy_pass http://zeppelin; - proxy_http_version 1.1; - proxy_set_header Upgrade websocket; - proxy_set_header Connection upgrade; - proxy_read_timeout 86400; - } + location / { # For regular websever support + proxy_pass http://zeppelin; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $http_host; + proxy_set_header X-NginX-Proxy true; + proxy_redirect off; + auth_basic "Restricted"; + auth_basic_user_file /etc/nginx/.htpasswd; } - ``` - Then make a symbolic link to this file from `/etc/nginx/sites-enabled/` to enable configuration above when NGINX reloads. + location /ws { # For websocket support + proxy_pass http://zeppelin; + proxy_http_version 1.1; + proxy_set_header Upgrade websocket; + proxy_set_header Connection upgrade; + proxy_read_timeout 86400; + } +} +``` + +Then make a symbolic link to this file from `/etc/nginx/sites-enabled/` to enable configuration above when NGINX reloads. + +```bash +$ ln -s /etc/nginx/sites-enabled/my-zeppelin-auth-setting /etc/nginx/sites-available/my-zeppelin-auth-setting +``` - ``` - $ ln -s /etc/nginx/sites-enabled/my-zeppelin-auth-setting /etc/nginx/sites-available/my-zeppelin-auth-setting - ``` +### 3. Setup user credential into `.htpasswd` file and restart server -1. Setup user credential into `.htpasswd` file and restart server +Now you need to setup `.htpasswd` file to serve list of authenticated user credentials for NGINX server. - Now you need to setup `.htpasswd` file to serve list of authenticated user credentials for NGINX server. +```bash +$ cd /etc/nginx +$ htpasswd -c htpasswd [YOUR-ID] +$ NEW passwd: [YOUR-PASSWORD] +$ RE-type new passwd: [YOUR-PASSWORD-AGAIN] +``` - ``` - $ cd /etc/nginx - $ htpasswd -c htpasswd [YOUR-ID] - $ NEW passwd: [YOUR-PASSWORD] - $ RE-type new passwd: [YOUR-PASSWORD-AGAIN] - ``` - Or you can use your own apache `.htpasswd` files in other location for setting up property: `auth_basic_user_file` +Or you can use your own apache `.htpasswd` files in other location for setting up property: `auth_basic_user_file` - Restart NGINX server. +Restart NGINX server. + +```bash +$ service nginx restart +``` - ``` - $ service nginx restart - ``` - Then check HTTP Basic Authentication works in browser. If you can see regular basic auth popup and then able to login with credential you entered into `.htpasswd` you are good to go. +Then check HTTP Basic Authentication works in browser. If you can see regular basic auth popup and then able to login with credential you entered into `.htpasswd` you are good to go. -1. More security consideration +### More security consideration * Using HTTPS connection with Basic Authentication is highly recommended since basic auth without encryption may expose your important credential information over the network. * Using [Shiro Security feature built-into Zeppelin](./shiroauthentication.html) is recommended if you prefer all-in-one solution for authentication but NGINX may provides ad-hoc solution for re-use authentication served by your system's NGINX server or in case of you need to separate authentication from zeppelin server. diff --git a/docs/storage/storage.md b/docs/storage/storage.md index 76012fff4b4..b3e2b3e0b43 100644 --- a/docs/storage/storage.md +++ b/docs/storage/storage.md @@ -36,13 +36,11 @@ There are few notebook storage systems available for a use out of the box: Multiple storage systems can be used at the same time by providing a comma-separated list of the class-names in the configuration. By default, only first two of them will be automatically kept in sync by Zeppelin. -
    - ## Notebook Storage in local Git repository To enable versioning for all your local notebooks though a standard Git repository - uncomment the next property in `zeppelin-site.xml` in order to use GitNotebookRepo class: -``` +```xml zeppelin.notebook.storage org.apache.zeppelin.notebook.repo.GitNotebookRepo @@ -50,8 +48,6 @@ To enable versioning for all your local notebooks though a standard Git reposito ``` -
    - ## Notebook Storage in S3 Notebooks may be stored in S3, and optionally encrypted. The [``DefaultAWSCredentialsProviderChain``](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/DefaultAWSCredentialsProviderChain.html) credentials provider is used for credentials and checks the following: @@ -61,7 +57,6 @@ Notebooks may be stored in S3, and optionally encrypted. The [``DefaultAWSCrede - Credential profiles file at the default location (````~/.aws/credentials````) used by the AWS CLI - Instance profile credentials delivered through the Amazon EC2 metadata service -
    The following folder structure will be created in S3: ``` @@ -70,14 +65,14 @@ s3://bucket_name/username/notebook-id/ Configure by setting environment variables in the file **zeppelin-env.sh**: -``` +```bash export ZEPPELIN_NOTEBOOK_S3_BUCKET = bucket_name export ZEPPELIN_NOTEBOOK_S3_USER = username ``` Or using the file **zeppelin-site.xml** uncomment and complete the S3 settings: -``` +```xml zeppelin.notebook.s3.bucket bucket_name @@ -92,7 +87,7 @@ Or using the file **zeppelin-site.xml** uncomment and complete the S3 settings: Uncomment the next property for use S3NotebookRepo class: -``` +```xml zeppelin.notebook.storage org.apache.zeppelin.notebook.repo.S3NotebookRepo @@ -102,7 +97,7 @@ Uncomment the next property for use S3NotebookRepo class: Comment out the next property to disable local notebook storage (the default): -``` +```xml zeppelin.notebook.storage org.apache.zeppelin.notebook.repo.VFSNotebookRepo @@ -116,13 +111,13 @@ Comment out the next property to disable local notebook storage (the default): To use an [AWS KMS](https://aws.amazon.com/kms/) encryption key to encrypt notebooks, set the following environment variable in the file **zeppelin-env.sh**: -``` +```bash export ZEPPELIN_NOTEBOOK_S3_KMS_KEY_ID = kms-key-id ``` Or using the following setting in **zeppelin-site.xml**: -``` +```xml zeppelin.notebook.s3.kmsKeyID AWS-KMS-Key-UUID @@ -134,28 +129,27 @@ Or using the following setting in **zeppelin-site.xml**: You may use a custom [``EncryptionMaterialsProvider``](https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/model/EncryptionMaterialsProvider.html) class as long as it is available in the classpath and able to initialize itself from system properties or another mechanism. To use this, set the following environment variable in the file **zeppelin-env.sh**: - -``` +```bash export ZEPPELIN_NOTEBOOK_S3_EMP = class-name ``` Or using the following setting in **zeppelin-site.xml**: -``` +```xml zeppelin.notebook.s3.encryptionMaterialsProvider provider implementation class name Custom encryption materials provider used to encrypt notebook data in S3 + ``` -
    ## Notebook Storage in Azure Using `AzureNotebookRepo` you can connect your Zeppelin with your Azure account for notebook storage. First of all, input your `AccountName`, `AccountKey`, and `Share Name` in the file **zeppelin-site.xml** by commenting out and completing the next properties: -``` +```xml zeppelin.notebook.azure.connectionString DefaultEndpointsProtocol=https;AccountName=;AccountKey= @@ -171,7 +165,7 @@ First of all, input your `AccountName`, `AccountKey`, and `Share Name` in the fi Secondly, you can initialize `AzureNotebookRepo` class in the file **zeppelin-site.xml** by commenting the next property: -``` +```xml zeppelin.notebook.storage org.apache.zeppelin.notebook.repo.VFSNotebookRepo @@ -181,7 +175,7 @@ Secondly, you can initialize `AzureNotebookRepo` class in the file **zeppelin-si and commenting out: -``` +```xml zeppelin.notebook.storage org.apache.zeppelin.notebook.repo.AzureNotebookRepo @@ -191,7 +185,7 @@ and commenting out: In case you want to use simultaneously your local storage with Azure storage use the following property instead: - ``` +```xml zeppelin.notebook.storage org.apache.zeppelin.notebook.repo.VFSNotebookRepo, apache.zeppelin.notebook.repo.AzureNotebookRepo @@ -201,7 +195,7 @@ In case you want to use simultaneously your local storage with Azure storage use Optionally, you can specify Azure folder structure name in the file **zeppelin-site.xml** by commenting out the next property: - ``` +```xml zeppelin.notebook.azure.user user @@ -209,12 +203,11 @@ Optionally, you can specify Azure folder structure name in the file **zeppelin-s ``` -
    -## Storage in ZeppelinHub +## Storage in ZeppelinHub ZeppelinHub storage layer allows out of the box connection of Zeppelin instance with your ZeppelinHub account. First of all, you need to either comment out the following property in **zeppelin-site.xml**: -``` +```xml