### Start Apache Zeppelin with Upstart Source: https://github.com/apache/zeppelin/blob/master/docs/quickstart/install.md This example shows how to configure Apache Zeppelin to start as a service using Upstart on Ubuntu. It defines the service description and the conditions for starting and stopping. ```aconf description "zeppelin" start on (local-filesystems and net-device-up IFACE!=lo) stop on shutdown ``` -------------------------------- ### Run Cloudera QuickStart Docker Container Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/cdh.md Start the Cloudera QuickStart Docker container, exposing necessary ports for CDH services and Zeppelin. Ensure to set the hostname and privileged mode. ```bash docker run -it \ -p 80:80 \ -p 4040:4040 \ -p 8020:8020 \ -p 8022:8022 \ -p 8030:8030 \ -p 8032:8032 \ -p 8033:8033 \ -p 8040:8040 \ -p 8042:8042 \ -p 8088:8088 \ -p 8480:8480 \ -p 8485:8485 \ -p 8888:8888 \ -p 9083:9083 \ -p 10020:10020 \ -p 10033:10033 \ -p 18088:18088 \ -p 19888:19888 \ -p 25000:25000 \ -p 25010:25010 \ -p 25020:25020 \ -p 50010:50010 \ -p 50020:50020 \ -p 50070:50070 \ -p 50075:50075 \ -h quickstart.cloudera --privileged=true \ agitated_payne_backup /usr/bin/docker-quickstart; ``` -------------------------------- ### Start Zeppelin Server (Daemon Script) Source: https://github.com/apache/zeppelin/blob/master/docs/development/contribution/how_to_contribute_code.md Start the Zeppelin server using the provided daemon script. It's recommended to run './mvnw clean install -DskipTests' first. ```bash bin/zeppelin-daemon start ``` -------------------------------- ### Install NGINX Source: https://github.com/apache/zeppelin/blob/master/docs/setup/security/authentication_nginx.md Installs the NGINX web server. This is the first step in setting up NGINX for authentication. ```bash $ apt-get install nginx ``` -------------------------------- ### Start Zeppelin Daemon Source: https://github.com/apache/zeppelin/blob/master/docs/quickstart/install.md Use this command to start the Zeppelin daemon. It changes the directory to the Zeppelin installation path and then executes the startup script. ```bash chdir /usr/share/zeppelin exec bin/zeppelin-daemon.sh upstart ``` -------------------------------- ### Install Git Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/flink_and_spark_cluster.md Installs the git version control system using the apt package manager. ```bash sudo apt-get install git ``` -------------------------------- ### Start Flink Cluster (Binaries) Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/flink_and_spark_cluster.md Starts the Flink cluster using the downloaded binaries. ```bash flink-1.20.4/bin/start-cluster.sh ``` -------------------------------- ### Example: Activate TensorFlow Docker Image Source: https://github.com/apache/zeppelin/blob/master/python/src/main/resources/output_templates/docker_usage.html This example demonstrates activating a Python interpreter with the latest TensorFlow Docker image. ```python # Run python interpreter with latest tensorflow image %python.docker activate gcr.io/tensorflow/tensorflow:latest ``` -------------------------------- ### List Available Community Managed Interpreters Source: https://github.com/apache/zeppelin/blob/master/docs/usage/interpreter/installation.md Run this command to get a full list of community-managed interpreters that can be installed. ```bash ./bin/install-interpreter.sh --list ``` -------------------------------- ### Install R and Development Packages Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/r.md Install R and necessary development libraries for Centos or Ubuntu systems. ```bash yum install R R-devel libcurl-devel openssl-devel ``` ```bash apt-get install r-base ``` -------------------------------- ### ZeppelinClient Usage Example Source: https://github.com/apache/zeppelin/blob/master/docs/usage/zeppelin_sdk/client_api.md Demonstrates how to use the ZeppelinClient to get the Zeppelin version and execute paragraphs with and without parameters. ```APIDOC ## ZeppelinClient Usage Example This example shows how to initialize ZeppelinClient, retrieve its version, and execute paragraphs within a note, including passing parameters. ### Code Example ```java ClientConfig clientConfig = new ClientConfig("http://localhost:8080"); ZeppelinClient zClient = new ZeppelinClient(clientConfig); String zeppelinVersion = zClient.getVersion(); System.out.println("Zeppelin version: " + zeppelinVersion); // execute note 2A94M5J1Z paragraph by paragraph try { ParagraphResult paragraphResult = zClient.executeParagraph("2A94M5J1Z", "20150210-015259_1403135953"); System.out.println("Execute the 1st spark tutorial paragraph, paragraph result: " + paragraphResult); paragraphResult = zClient.executeParagraph("2A94M5J1Z", "20150210-015302_1492795503"); System.out.println("Execute the 2nd spark tutorial paragraph, paragraph result: " + paragraphResult); Map parameters = new HashMap<>(); parameters.put("maxAge", "40"); paragraphResult = zClient.executeParagraph("2A94M5J1Z", "20150212-145404_867439529", parameters); System.out.println("Execute the 3rd spark tutorial paragraph, paragraph result: " + paragraphResult); parameters = new HashMap<>(); parameters.put("marital", "married"); paragraphResult = zClient.executeParagraph("2A94M5J1Z", "20150213-230422_1600658137", parameters); System.out.println("Execute the 4th spark tutorial paragraph, paragraph result: " + paragraphResult); } finally { // you need to stop interpreter explicitly if you are running paragraph separately. zClient.stopInterpreter("2A94M5J1Z", "spark"); } ``` ``` -------------------------------- ### Install Visualization Libraries Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/r.md Install multiple R visualization packages and a GitHub-based package using 'devtools'. ```bash R -e "install.packages(c('devtools','mplot', 'googleVis'), repos = 'http://cran.us.r-project.org'); require(devtools); install_github('ramnathv/rCharts')" ``` -------------------------------- ### Install Bundler and Dependencies Source: https://github.com/apache/zeppelin/blob/master/docs/README.md Installs Bundler and all project dependencies declared in the Gemfile. Ensure Ruby version is at least 2.0.0. ```bash # ruby --version >= 2.0.0 # Install Bundler using gem gem install bundler cd $ZEPPELIN_HOME/docs # Install all dependencies declared in the Gemfile bundle install ``` -------------------------------- ### Start Zeppelin Daemon Source: https://github.com/apache/zeppelin/blob/master/docs/setup/basics/how_to_build.md After a successful build, use this command to start the Zeppelin server. ```bash ./bin/zeppelin-daemon.sh start ``` -------------------------------- ### Pull Cloudera QuickStart Docker Image Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/cdh.md Import the official Cloudera QuickStart Docker image from Docker Hub. This image provides a pre-configured CDH environment. ```bash docker pull cloudera/quickstart:latest ``` -------------------------------- ### Start Flink Cluster (From Source) Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/flink_and_spark_cluster.md Starts the Flink cluster in stand-alone mode after building from source. ```bash build-target/bin/start-cluster.sh ``` -------------------------------- ### Start Zeppelin Daemon Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/flink_and_spark_cluster.md Start the Apache Zeppelin server process. ```bash bin/zeppelin-daemon.sh start ``` -------------------------------- ### License Example Source: https://github.com/apache/zeppelin/blob/master/docs/development/helium/writing_visualization_basic.md Provides the license information for the visualization package. ```json "license": "Apache-2.0" ``` -------------------------------- ### Install OpenJDK 11 Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/flink_and_spark_cluster.md Installs the OpenJDK 11 Development Kit, a prerequisite for running Java-based applications like Flink and Spark. ```bash sudo apt-get install openjdk-11-jdk ``` -------------------------------- ### Install Multiple 3rd Party Interpreters Source: https://github.com/apache/zeppelin/blob/master/docs/usage/interpreter/installation.md Install multiple third-party interpreters simultaneously by providing comma-separated lists for both `--name` and `--artifact` arguments. Ensure the order of names and artifacts corresponds. ```bash ./bin/install-interpreter.sh --name interpreter1,interpreter2 --artifact groupId1:artifact1:version1,groupId2:artifact2:version2 ``` -------------------------------- ### Install Specific Community Managed Interpreters Source: https://github.com/apache/zeppelin/blob/master/docs/usage/interpreter/installation.md Install a comma-separated list of specific community-managed interpreters by their names. Ensure the interpreter names are correct. ```bash ./bin/install-interpreter.sh --name md,shell,jdbc,python ``` -------------------------------- ### Start Zeppelin service with systemd Source: https://github.com/apache/zeppelin/blob/master/docs/setup/basics/systemd.md Use this command to start the Zeppelin service using systemd. ```bash # systemctl start zeppelin ``` -------------------------------- ### Install All Community Managed Interpreters Source: https://github.com/apache/zeppelin/blob/master/docs/usage/interpreter/installation.md Use this command to install all interpreters managed by the community. This is typically done when using the Zeppelin `netinst` binary package. ```bash ./bin/install-interpreter.sh --all ``` -------------------------------- ### Install Zeppelin with z-manager Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/virtual_machine.md Installs Zeppelin using the z-manager script within the guest VM. This is an alternative to building from source. ```bash curl -fsSL https://raw.githubusercontent.com/NFLabs/z-manager/master/zeppelin-installer.sh | bash ``` -------------------------------- ### Get All Helium Package Configurations Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/helium.md This GET method retrieves the configuration settings for all installed Helium packages. ```http GET http://[zeppelin-server]:[zeppelin-port]/api/helium/config ``` -------------------------------- ### Parameter Configuration Examples Source: https://github.com/apache/zeppelin/blob/master/docs/development/helium/writing_visualization_transformation.md Demonstrates various parameter configurations, including different `valueType` and `widget` options. Use this to define user-configurable options for visualizations. ```js parameter: { // string type, input widget 'xAxisUnit': { valueType: 'string', defaultValue: '', description: 'unit of xAxis', }, // boolean type, checkbox widget 'inverted': { widget: 'checkbox', valueType: 'boolean', defaultValue: false, description: 'invert x and y axes', }, // string type, option widget with `optionValues` 'graphType': { widget: 'option', valueType: 'string', defaultValue: 'line', description: 'graph type', optionValues: [ 'line', 'smoothedLine', 'step', ], }, // HTML in `description` 'dateFormat': { valueType: 'string', defaultValue: '', description: 'format of date (doc) (e.g YYYY-MM-DD)', }, // JSON type, textarea widget 'yAxisGuides': { widget: 'textarea', valueType: 'JSON', defaultValue: '', description: 'guides of yAxis ', }, } ``` -------------------------------- ### Word Count Example with Table Visualization Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/java.md Demonstrates a word count example using a Java Map and displays the results as a table using `JavaInterpreterUtils.displayTableFromSimpleMap`. Each paragraph is executed as a separate, self-contained Java main class. ```java %java import java.util.HashMap; import java.util.Map; import org.apache.zeppelin.java.JavaInterpreterUtils; public class HelloWorld { public static void main(String[] args) { Map counts = new HashMap<>(); counts.put("hello",4L); counts.put("world",5L); System.out.println(JavaInterpreterUtils.displayTableFromSimpleMap("Word","Count", counts)); } } ``` -------------------------------- ### List all available notebook repositories Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/notebook_repository.md This GET method returns all the available notebook repositories. ```APIDOC ## GET /api/notebook-repositories ### Description This GET method returns all the available notebook repositories. ### Method GET ### Endpoint /api/notebook-repositories ### Response #### Success Response (200) - **body** (array) - List of notebook repositories ### Response Example ```json { "status": "OK", "message": "", "body": [ { "name": "GitNotebookRepo", "className": "org.apache.zeppelin.notebook.repo.GitNotebookRepo", "settings": [ { "type": "INPUT", "value": [], "selected": "ZEPPELIN_HOME/zeppelin/notebook/", "name": "Notebook Path" } ] } ] } ``` ``` -------------------------------- ### Get Conda Information Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/python.md Display information about the current Conda installation and configuration. ```python %python.conda info ``` -------------------------------- ### Example: Activate TensorFlow Docker Image Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/python.md Demonstrates activating a specific Docker image, in this case, the latest TensorFlow image, as a Python environment. ```python # activate latest tensorflow image as a python environment %python.docker activate gcr.io/tensorflow/tensorflow:latest ``` -------------------------------- ### Install a 3rd Party Interpreter Source: https://github.com/apache/zeppelin/blob/master/docs/usage/interpreter/installation.md Install a third-party interpreter by specifying its name and Maven artifact coordinates (groupId:artifactId:version). This downloads the artifact and its dependencies. ```bash ./bin/install-interpreter.sh --name interpreter1 --artifact groupId1:artifact1:version1 ``` -------------------------------- ### Create Keyspace: samples Source: https://github.com/apache/zeppelin/blob/master/cassandra/src/test/resources/scalate/DescribeKeyspaces.html CQL statement to create the 'samples' keyspace. It uses SimpleStrategy for replication with a factor of 1 and disables durable writes. ```sql CREATE KEYSPACE samples WITH replication = {'class' : 'org.apache.cassandra.locator.SimpleStrategy','replication_factor': '1' } AND durable_writes = false; ``` -------------------------------- ### Get Conda Information Source: https://github.com/apache/zeppelin/blob/master/python/src/main/resources/output_templates/conda_usage.html Use this command to retrieve general information about your Conda installation. ```python %python.conda info ``` -------------------------------- ### Create and Use ZSession Source: https://github.com/apache/zeppelin/blob/master/docs/usage/zeppelin_sdk/session_api.md Demonstrates creating a ZSession with custom configurations, starting it, executing code across different interpreters (Spark, PySpark, R, SQL), and handling results. Ensure to stop the session explicitly to release resources. ```java ZSession session = null; try { ClientConfig clientConfig = new ClientConfig("http://localhost:8080"); Map intpProperties = new HashMap<>(); intpProperties.put("spark.master", "local[*]"); session = ZSession.builder() .setClientConfig(clientConfig) .setInterpreter("spark") .setIntpProperties(intpProperties) .build(); session.start(); System.out.println("Spark Web UI: " + session.getWeburl()); // scala (single result) ExecuteResult result = session.execute("println(sc.version)"); System.out.println("Spark Version: " + result.getResults().get(0).getData()); // scala (multiple result) result = session.execute("println(sc.version)\n" + "val df = spark.createDataFrame(Seq((1,"a"), (2,"b")))\n" + "z.show(df)"); // The first result is text output System.out.println("Result 1: type: " + result.getResults().get(0).getType() + ", data: " + result.getResults().get(0).getData() ); // The second result is table output System.out.println("Result 2: type: " + result.getResults().get(1).getType() + ", data: " + result.getResults().get(1).getData() ); System.out.println("Spark Job Urls:\n" + StringUtils.join(result.getJobUrls(), "\n")); // error output result = session.execute("1/0"); System.out.println("Result status: " + result.getStatus() + ", data: " + result.getResults().get(0).getData()); // pyspark result = session.execute("pyspark", "df = spark.createDataFrame([(1,'a'),(2,'b')])\n" + "df.registerTempTable('df')\n" + "df.show()") System.out.println("PySpark dataframe: " + result.getResults().get(0).getData()); // matplotlib result = session.execute("ipyspark", "%matplotlib inline\n" + "import matplotlib.pyplot as plt\n" + "plt.plot([1,2,3,4])\n" + "plt.ylabel('some numbers')\n" + "plt.show()") System.out.println("Matplotlib result, type: " + result.getResults().get(0).getType() + ", data: " + result.getResults().get(0).getData()); // sparkr result = session.execute("r", "df <- as.DataFrame(faithful)\nhead(df)") System.out.println("Sparkr dataframe: " + result.getResults().get(0).getData()); // spark sql result = session.execute("sql", "select * from df") System.out.println("SparkSql dataframe: " + result.getResults().get(0).getData()); // spark invalid sql result = session.execute("sql", "select * from unknown_table") System.out.println("Result status: " + result.getStatus() + ", data: " + result.getResults().get(0).getData()); } catch (Exception e) { e.printStackTrace(); } finally { if (session != null) { try { session.stop(); } catch (Exception e) { e.printStackTrace(); } } } ``` -------------------------------- ### Get Hadoop Client Version Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/yarn_install.md Retrieves the specific version of the Hadoop client installed on the system, which is used to set the 'hdp.version' property in Zeppelin's configuration. ```bash hdp-select status hadoop-client | sed 's/hadoop-client - \(.*\)/\1/' ``` -------------------------------- ### Simple 'Hello World' Visualization Source: https://github.com/apache/zeppelin/blob/master/docs/development/helium/writing_visualization_basic.md Extends the Visualization class to display 'Hello world'. Requires importing Visualization and PassthroughTransformation. The render method updates the target element, and getTransformation returns the transformation to be used. ```javascript import Visualization from 'zeppelin-vis' import PassthroughTransformation from 'zeppelin-tabledata/passthrough' export default class helloworld extends Visualization { constructor(targetEl, config) { super(targetEl, config) this.passthrough = new PassthroughTransformation(config); } render(tableData) { this.targetEl.html('Hello world!') } getTransformation() { return this.passthrough } } ``` -------------------------------- ### Elasticsearch Search with Query String Syntax Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/elasticsearch.md Perform a search using the simplified query string syntax. This example filters for GET requests with status 200 in the 'logs' index. ```bash %elasticsearch search /logs request.method:GET AND status:200 ``` -------------------------------- ### Elasticsearch Search with JSON Query (Query String) Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/elasticsearch.md Execute a search with a JSON query that includes a `query_string` for filtering. This example searches for GET requests with status 200 in the 'logs' index. ```bash %elasticsearch search /logs { "query": { "query_string": { "query": "request.method:GET AND status:200" } } } ``` -------------------------------- ### Run Jekyll Documentation Site Locally Source: https://github.com/apache/zeppelin/blob/master/docs/README.md Starts a Jekyll development server to preview the documentation site locally. The server watches for file changes and reloads automatically. ```bash bundle exec jekyll serve --watch ``` -------------------------------- ### Run Zeppelin Docker with Flink Local Mode Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/flink.md This command starts a Zeppelin Docker container, mounting a local Flink installation and exposing necessary ports for Flink's web UI and Zeppelin. ```bash docker run -u $(id -u) -p 8080:8080 -p 8081:8081 --rm -v /mnt/disk1/flink-1.12.2:/opt/flink -e FLINK_HOME=/opt/flink --name zeppelin apache/zeppelin:0.10.0 ``` -------------------------------- ### Run Zeppelin Docker Container with Spark Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/spark.md This command starts a Zeppelin Docker container, mounting a local Spark installation and exposing necessary ports. Ensure Spark is downloaded and its path is correctly specified. ```bash docker run -u $(id -u) -p 8080:8080 -p 4040:4040 --rm -v /mnt/disk1/spark-3.1.2:/opt/spark -e SPARK_HOME=/opt/spark --name zeppelin apache/zeppelin:0.10.0 ``` -------------------------------- ### Install Ansible Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/virtual_machine.md Installs Ansible using pip. Ensure you have pip installed first. Check that the installed version is 1.9.2 or higher. ```bash sudo easy_install pip sudo pip install ansible ansible --version ``` -------------------------------- ### Install Python Libraries for Anaconda Users Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/flink.md Installs necessary Python libraries for users with Anaconda installed. ```bash pip install grpcio pip install protobuf ``` -------------------------------- ### Install Conda Package Source: https://github.com/apache/zeppelin/blob/master/python/src/main/resources/output_templates/conda_usage.html Installs a specified package into the current active Conda environment. Replace [PACKAGE NAME] with the package you wish to install. ```python %python.conda install [PACKAGE NAME] ``` -------------------------------- ### Build Module with Spark and Scala Profiles Source: https://github.com/apache/zeppelin/blob/master/AGENTS.md Example of building a module (e.g., spark) with specific version profiles for Spark and Scala using the Maven wrapper. ```bash ./mvnw clean package -pl spark -Pspark-3.5 -Pspark-scala-2.12 -DskipTests ``` -------------------------------- ### Start Zeppelin Daemon Source: https://github.com/apache/zeppelin/blob/master/docs/setup/security/shiro_authentication.md Start or restart the Zeppelin daemon to apply Shiro configuration changes. Access Zeppelin at http://localhost:8080 after starting. ```bash bin/zeppelin-daemon.sh start #(or restart) ``` -------------------------------- ### Install MongoDB Community Shell on macOS Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/mongodb.md Use Homebrew to install the MongoDB community shell on macOS. Ensure MongoDB shell is installed on the same machine as Zeppelin. ```bash brew tap mongodb/brew brew install mongodb/brew/mongodb-community-shell ``` -------------------------------- ### List all available notebook repositories Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/notebook_repository.md This GET method returns all the available notebook repositories. The response includes the repository name, class name, and settings. ```json { "status": "OK", "message": "", "body": [ { "name": "GitNotebookRepo", "className": "org.apache.zeppelin.notebook.repo.GitNotebookRepo", "settings": [ { "type": "INPUT", "value": [], "selected": "ZEPPELIN_HOME/zeppelin/notebook/", "name": "Notebook Path" } ] } ] } ``` -------------------------------- ### Get Zeppelin version Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/zeppelin_server.md This GET method returns Zeppelin version. ```APIDOC ## GET /api/version ### Description This method returns the Zeppelin version. ### Method GET ### Endpoint /api/version ### Response #### Success Response (200) - **status** (string) - OK - **message** (string) - Zeppelin version - **body** (array) - Array of version details - **version** (string) - The Zeppelin version - **git-commit-id** (string) - The git commit ID - **git-timestamp** (string) - The git commit timestamp #### Response Example ```json { "status": "OK", "message": "Zeppelin version", "body": [ { "version": "0.8.0", "git-commit-id": "abc0123", "git-timestamp": "2017-01-02 03:04:05" } ] } ``` ``` -------------------------------- ### Build a Small Custom CA with OpenSSL Source: https://github.com/apache/zeppelin/blob/master/zeppelin-server/src/test/resources/example-pem-files/README.md Generate a root CA key and certificate, then create a domain key and certificate signed by the root CA. This is useful for local development and testing. ```bash openssl genrsa -out rootCA.key 4096 ``` ```bash openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.crt -subj '/CN=localhost' ``` ```bash openssl genrsa -out zeppelin.com.key 4096 ``` ```bash openssl req -new -sha256 -key zeppelin.com.key -subj "/C=US/ST=CA/O=MyOrg, Inc./CN=zeppelin.com" -out zeppelin.com.csr ``` ```bash openssl x509 -req -in zeppelin.com.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -days 500 -sha256 -out zeppelin.com.crt ``` -------------------------------- ### List Installed Packages Source: https://github.com/apache/zeppelin/blob/master/python/src/main/resources/output_templates/conda_usage.html Shows all packages installed in the current active Conda environment. ```python %python.conda list ``` -------------------------------- ### Create .htpasswd File Source: https://github.com/apache/zeppelin/blob/master/docs/setup/security/authentication_nginx.md Creates or updates the `.htpasswd` file with user credentials for HTTP Basic Authentication. Replace `[YOUR-ID]` with the desired username. ```bash $ cd /etc/nginx $ htpasswd -c htpasswd [YOUR-ID] NEW passwd: [YOUR-PASSWORD] RE-type new passwd: [YOUR-PASSWORD-AGAIN] ``` -------------------------------- ### Install Package in Conda Environment Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/python.md Install a specified package into the current Conda environment. ```python %python.conda install [PACKAGE NAME] ``` -------------------------------- ### Install R Packages with ggplot2 Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/r.md Install the 'ggplot2' package from a specified CRAN repository. ```bash R -e "install.packages('ggplot2', repos = 'http://cran.us.r-project.org')" ``` -------------------------------- ### HK2 Dependency Injection Setup Source: https://github.com/apache/zeppelin/blob/master/AGENTS.md Illustrates how HK2 Dependency Injection is configured in ZeppelinServer.startZeppelin() using AbstractBinder to bind services like InterpreterFactory and NotebookRepo. ```java new AbstractBinder() { protected void configure() { bind(storage).to(ConfigStorage.class); bindAsContract(PluginManager.class).in(Singleton.class); bindAsContract(InterpreterFactory.class).in(Singleton.class); bindAsContract(NotebookRepoSync.class).to(NotebookRepo.class).in(Singleton.class); bindAsContract(Notebook.class).in(Singleton.class); // ... InterpreterSettingManager, SearchService, etc. } } ``` -------------------------------- ### Install R Packages with knitr Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/r.md Install the 'knitr' package from a specified CRAN repository. ```bash R -e "install.packages('knitr', repos = 'http://cran.us.r-project.org')" ``` -------------------------------- ### Run Zeppelin Server (Command Line) Source: https://github.com/apache/zeppelin/blob/master/docs/development/contribution/how_to_contribute_code.md Start the Zeppelin server in development mode directly from the command line. Ensure you have configured 'zeppelin-site.xml' and set JAVA_HOME/HADOOP_HOME. ```bash cd zeppelin-server HADOOP_HOME=YOUR_HADOOP_HOME JAVA_HOME=YOUR_JAVA_HOME \ ./mvnw exec:java -Dexec.mainClass="org.apache.zeppelin.server.ZeppelinServer" -Dexec.args="" ``` -------------------------------- ### Build with Common Maven Profiles Source: https://github.com/apache/zeppelin/blob/master/AGENTS.md Demonstrates how to use common Maven profiles for building with specific Spark or Flink versions, generating a full distribution, or running license checks. ```bash # Common profiles # -Pspark-3.5 -Pspark-scala-2.12 Spark version # -Pflink-1.20 Flink version # -Pbuild-distr Full distribution # -Prat Apache RAT license check # -Pweb-classic Additionally builds the classic UI web module when specified ``` -------------------------------- ### Install R Packages with devtools Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/r.md Install the 'devtools' package from a specified CRAN repository. ```bash R -e "install.packages('devtools', repos = 'http://cran.us.r-project.org')" ``` -------------------------------- ### Enable NGINX Configuration Source: https://github.com/apache/zeppelin/blob/master/docs/setup/security/authentication_nginx.md Creates a symbolic link to enable the newly created NGINX configuration file. ```bash $ ln -s /etc/nginx/sites-enabled/my-zeppelin-auth-setting /etc/nginx/sites-available/my-zeppelin-auth-setting ``` -------------------------------- ### Enable OSS Notebook Repository Source: https://github.com/apache/zeppelin/blob/master/docs/setup/storage/notebook_storage.md Enable the OSSNotebookRepo class for notebook persistence in Aliyun OSS. ```xml zeppelin.notebook.storage org.apache.zeppelin.notebook.repo.OSSNotebookRepo notebook persistence layer implementation ``` -------------------------------- ### Configure PAM Realm for Authentication Source: https://github.com/apache/zeppelin/blob/master/docs/setup/security/shiro_authentication.md Enable PAM authentication by specifying the Shiro realm and the PAM service name, which corresponds to a file under /etc/pam.d/. ```ini pamRealm=org.apache.zeppelin.realm.PamRealm pamRealm.service=sshd ``` -------------------------------- ### Start Zeppelin VM Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/virtual_machine.md Initiates the Vagrant virtual machine. Navigate to the Zeppelin development script directory before running this command. ```bash vagrant up ``` -------------------------------- ### Install IPython Prerequisites Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/python.md Install necessary packages for the IPython interpreter in non-anaconda and anaconda environments. ```bash pip install jupyter pip install grpcio pip install protobuf ``` ```bash pip install grpcio pip install protobuf ``` -------------------------------- ### List all key/value pair of configurations Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/configuration.md This GET method returns all key/value pairs of configurations on the server. For security reasons, some pairs may not be shown. ```APIDOC ## GET /api/configurations/all ### Description This GET method returns all key/value pairs of configurations on the server. Note: For security reason, some pairs would not be shown. ### Method GET ### Endpoint /api/configurations/all ### Response #### Success Response (200) - **body** (object) - A JSON object containing configuration key-value pairs. ### Response Example ```json { "status": "OK", "message": "", "body": { "zeppelin.war.tempdir": "webapps", "zeppelin.notebook.homescreen.hide": "false", "zeppelin.interpreter.remoterunner": "bin/interpreter.sh", "zeppelin.notebook.s3.user": "user", "zeppelin.server.port": "8089", "zeppelin.dep.localrepo": "local-repo", "zeppelin.ssl.truststore.type": "JKS", "zeppelin.ssl.keystore.path": "keystore", "zeppelin.notebook.s3.bucket": "zeppelin", "zeppelin.server.addr": "0.0.0.0", "zeppelin.ssl.client.auth": "false", "zeppelin.server.context.path": "/", "zeppelin.ssl.keystore.type": "JKS", "zeppelin.ssl.truststore.path": "truststore", "zeppelin.ssl": "false", "zeppelin.notebook.autoInterpreterBinding": "true", "zeppelin.notebook.homescreen": "", "zeppelin.notebook.storage": "org.apache.zeppelin.notebook.repo.VFSNotebookRepo", "zeppelin.interpreter.connect.timeout": "30000", "zeppelin.server.allowed.origins":"*", "zeppelin.encoding": "UTF-8" } } ``` ``` -------------------------------- ### Validate R Installation Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/r.md Verify that R is installed correctly by running a simple arithmetic command. ```bash R -e "print(1+1)" ``` -------------------------------- ### Start Zeppelin Daemon Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/flink_and_spark_cluster.md Starts the Zeppelin server. This command should be run after the Spark cluster is up and running. ```bash cd $HOME zeppelin/bin/zeppelin-daemon.sh start ``` -------------------------------- ### Clone Repository and Initial Build Source: https://github.com/apache/zeppelin/blob/master/AGENTS.md Steps to clone the Apache Zeppelin repository and perform the initial build using Maven wrapper, skipping tests to verify the environment setup. ```bash # Clone the repository git clone https://github.com/apache/zeppelin.git cd zeppelin # First build — skip tests to verify environment works ./mvnw clean package -DskipTests # This takes ~10 minutes. If it succeeds, your environment is ready. # Frontend setup (only if working on UI) cd zeppelin-web-angular npm install cd .. ``` -------------------------------- ### Get single helium package Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/helium.md This GET method returns specified helium package information. ```APIDOC ## GET /api/helium/package/[Package Name] ### Description Returns specified helium package information. ### Method GET ### Endpoint /api/helium/package/[Package Name] ### Parameters #### Path Parameters - **Package Name** (string) - Required - The name of the helium package to retrieve. ### Response #### Success Response (200) - **status** (string) - The status of the request (e.g., "OK"). - **message** (string) - Any additional message regarding the request. - **body** (object) - Contains the helium package details. - **[Package Name]** (array) - An array of package configurations. - **registry** (string) - The registry where the package is located. - **pkg** (object) - Details about the package. - **type** (string) - The type of the package (e.g., "APPLICATION"). - **name** (string) - The name of the package. - **description** (string) - A description of the package. - **artifact** (string) - The artifact path for the package. - **className** (string) - The main class name for the package. - **resources** (array) - An array of resources required by the package. - **icon** (string) - An icon identifier for the package. - **enabled** (boolean) - Indicates if the package is enabled. ### Response Example ```json { "status": "OK", "message": "", "body": { "zeppelin.clock": [ { "registry": "local", "pkg": { "type": "APPLICATION", "name": "zeppelin.clock", "description": "Clock (example)", "artifact": "zeppelin-examples/zeppelin-example-clock/target/zeppelin-example-clock-0.7.0-SNAPSHOT.jar", "className": "org.apache.zeppelin.example.app.clock.Clock", "resources": [ [ ":java.util.Date" ] ], "icon": "icon" }, "enabled": false } ] } } ``` ``` -------------------------------- ### Spark SQL Example Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/spark.md Demonstrates creating a DataFrame and registering it as a temporary view using Spark SQL in a Scala interpreter. ```scala case class People(name: String, age: Int) var df = spark.createDataFrame(List(People("jeff", 23), People("andy", 20))) df.createOrReplaceTempView("people") ``` -------------------------------- ### Install Python Libraries for Non-Anaconda Users Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/flink.md Installs necessary Python libraries for users without Anaconda. ```bash pip install jupyter pip install grpcio pip install protobuf ``` -------------------------------- ### Cassandra Prepared Statement Commands Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/cassandra.md Demonstrates the commands for managing prepared and bound statements in the Cassandra interpreter. ```cassandra @prepare[statement-name]=... ``` ```cassandra @bind[statement-name]=’text’, 1223, ’2015-07-30 12:00:01’, null, true, [‘list_item1’, ’list_item2’] ``` ```cassandra @bind[statement-name-with-no-bound-value] ``` ```cassandra @remove_prepare[statement-name] ``` -------------------------------- ### Response for Creating Interpreter Setting Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/interpreter.md This is a sample JSON response after successfully creating a new interpreter setting. It confirms the creation and returns the details of the newly added setting. ```json { "status": "OK", "message": "", "body": { "id": "2AYW25ANY", "name": "Markdown setting name", "group": "md", "properties": { "propname": { "name": "propname", "value": "propvalue", "type": "textarea" }, "interpreterGroup": [ { "class": "org.apache.zeppelin.markdown.Markdown", "name": "md" } ], "dependencies": [ { "groupArtifactVersion": "groupId:artifactId:version", "exclusions": [ "groupId:artifactId" ] } ] } } ``` -------------------------------- ### Artifact Example: Local File System Path Source: https://github.com/apache/zeppelin/blob/master/docs/development/helium/writing_visualization_basic.md Specifies the location of the visualization's npm package when it exists on the local file system. ```json "artifact": "/path/to/my/visualization" ``` -------------------------------- ### Get all enabled helium packages Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/helium.md This GET method returns all enabled helium packages in configured registries. ```APIDOC ## GET /api/helium/enabledPackage ### Description This GET method returns all enabled helium packages in configured registries. ### Method GET ### Endpoint /api/helium/enabledPackage ### Response #### Success Response (200) - **status** (string) - OK - **message** (string) - - **body** (object) - - **[package_name]** (array) - - **registry** (string) - - **pkg** (object) - - **type** (string) - - **name** (string) - - **description** (string) - - **artifact** (string) - - **className** (string) - - **resources** (array) - - **icon** (string) - - **enabled** (boolean) - #### Response Example ```json { "status": "OK", "message": "", "body": { "zeppelin.clock": [ { "registry": "local", "pkg": { "type": "APPLICATION", "name": "zeppelin.clock", "description": "Clock (example)", "artifact": "zeppelin-examples\/zeppelin-example-clock\/target\/zeppelin-example\n-clock-0.7.0-SNAPSHOT.jar", "className": "org.apache.zeppelin.example.app.clock.Clock", "resources": [ [ ":java.util.Date" ] ], "icon": "icon" }, "enabled": false } ] } } ``` ``` -------------------------------- ### Get all available helium packages Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/helium.md This GET method returns all the available helium packages in configured registries. ```APIDOC ## GET /api/helium/package ### Description This GET method returns all the available helium packages in configured registries. ### Method GET ### Endpoint /api/helium/package ### Response #### Success Response (200) - **status** (string) - OK - **message** (string) - - **body** (object) - - **[package_name]** (array) - - **registry** (string) - - **pkg** (object) - - **type** (string) - - **name** (string) - - **description** (string) - - **artifact** (string) - - **className** (string) - - **resources** (array) - - **icon** (string) - - **enabled** (boolean) - #### Response Example ```json { "status": "OK", "message": "", "body": { "zeppelin.clock": [ { "registry": "local", "pkg": { "type": "APPLICATION", "name": "zeppelin.clock", "description": "Clock (example)", "artifact": "zeppelin-examples\/zeppelin-example-clock\/target\/zeppelin-example\n-clock-0.7.0-SNAPSHOT.jar", "className": "org.apache.zeppelin.example.app.clock.Clock", "resources": [ [ ":java.util.Date" ] ], "icon": "icon" }, "enabled": false } ] } } ``` ``` -------------------------------- ### List all prefix matched key/value pair of configurations Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/configuration.md This GET method returns all prefix matched key/value pairs of configurations on the server. For security reasons, some pairs may not be shown. ```APIDOC ## GET /api/configurations/prefix/[prefix] ### Description This GET method returns all prefix matched key/value pairs of configurations on the server. Note: For security reason, some pairs would not be shown. ### Method GET ### Endpoint /api/configurations/prefix/[prefix] ### Parameters #### Path Parameters - **prefix** (string) - Required - The prefix to match configuration keys against. ### Response #### Success Response (200) - **body** (object) - A JSON object containing configuration key-value pairs that match the provided prefix. ### Response Example ```json { "status": "OK", "message": "", "body": { "zeppelin.ssl.keystore.type": "JKS", "zeppelin.ssl.truststore.path": "truststore", "zeppelin.ssl.truststore.type": "JKS", "zeppelin.ssl.keystore.path": "keystore", "zeppelin.ssl": "false", "zeppelin.ssl.client.auth": "false" } } ``` ``` -------------------------------- ### Install OpenSSH Server Source: https://github.com/apache/zeppelin/blob/master/docs/setup/deployment/flink_and_spark_cluster.md Installs the OpenSSH server package, which is required for remote access and secure shell connections. ```bash sudo apt-get install openssh-server ``` -------------------------------- ### Mahout R-Like DSL Example Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/mahout.md Demonstrates Mahout's R-Like DSL for data manipulation and linear algebra operations. This code is compatible with both %flinkMahout and %sparkMahout interpreters. ```scala val drmData = drmParallelize(dense( (2, 2, 10.5, 10, 29.509541), // Apple Cinnamon Cheerios (1, 2, 12, 12, 18.042851), // Cap'n'Crunch (1, 1, 12, 13, 22.736446), // Cocoa Puffs (2, 1, 11, 13, 32.207582), // Froot Loops (1, 2, 12, 11, 21.871292), // Honey Graham Ohs (2, 1, 16, 8, 36.187559), // Wheaties Honey Gold (6, 2, 17, 1, 50.764999), // Cheerios (3, 2, 13, 7, 40.400208), // Clusters (3, 3, 13, 4, 45.811716)), numPartitions = 2) drmData.collect(::, 0 until 4) val drmX = drmData(::, 0 until 4) val y = drmData.collect(::, 4) val drmXtX = drmX.t %*% drmX val drmXty = drmX.t %*% y val XtX = drmXtX.collect val Xty = drmXty.collect(::, 0) val beta = solve(XtX, Xty) ``` -------------------------------- ### Get Zeppelin Version Source: https://github.com/apache/zeppelin/blob/master/docs/usage/rest_api/zeppelin_server.md This GET method returns the Zeppelin version. The response includes the version, git-commit-id, and git-timestamp. ```json { "status": "OK", "message": "Zeppelin version", "body": [ { "version": "0.8.0", "git-commit-id": "abc0123", "git-timestamp": "2017-01-02 03:04:05" } ] } ``` -------------------------------- ### Install Dependencies and Build Zeppelin Web Source: https://github.com/apache/zeppelin/blob/master/zeppelin-web/README.md Install required Node.js dependencies and build the Zeppelin web application for production. ```sh $ npm install $ npm run build:dist ``` -------------------------------- ### Run Zeppelin Web in Development Mode Source: https://github.com/apache/zeppelin/blob/master/zeppelin-web/README.md Start the frontend development server. Ensure a Zeppelin backend instance is also running. ```sh $ npm run dev ``` -------------------------------- ### List Installed Packages in Conda Environment Source: https://github.com/apache/zeppelin/blob/master/docs/interpreter/python.md Display a list of all packages installed within the currently active Conda environment. ```python %python.conda list ``` -------------------------------- ### Build and Run JDBC Interpreter Docker Image Source: https://github.com/apache/zeppelin/blob/master/jdbc/README.md Build the JDBC interpreter Docker image and run it as a container. This involves building the image using the provided Dockerfile and then starting the container, mapping necessary ports and setting environment variables. ```bash zeppelin $ ./mvnw clean install -DskipTests zeppelin $ ./bin/zeppelin-daemon.sh start # start zeppelin server. # check the port of the interpreter event server. you can find it by looking for the log that starts with "InterpreterEventServer is starting at" zeppelin $ docker build -f ./jdbc/Dockerfile -t jdbc-interpreter . zeppelin $ docker run -p {INTERPRETER_PROCESS_PORT_IN_HOST}:8082 \ -e INTERPRETER_EVENT_SERVER_PORT={INTERPRETER_EVENT_SERVER_PORT} \ jdbc-interpreter ```