基於cdh5.4.2的Zeppelin編譯安裝

  • 一、先安裝nodejs和npm,根據zeppelin-web下的pom.xml中的java

<execution>node

            <id>install node and npm</id>python

            <goals>git

              <goal>install-node-and-npm</goal>github

            </goals>web

            <configuration>npm

              <nodeVersion>v0.10.22</nodeVersion>frontend

              <npmVersion>1.3.8</npmVersion>maven

            </configuration>grunt

          </execution>

來肯定要安裝的版本


  • 二、設置npm config set registry "http://registry.npmjs.org/"

  • 三、npm install -g bower,安裝完成後測試下bower是否加入環境變量

  • 四、npm install -g grunt-cli,安裝完成後測試下grunt是否加入環境變量

  • 五、刪除zeppelin-web下的pom.xml中的

<plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>0.0.23</version>
        <executions>

          <execution>
            <id>install node and npm</id>
            <goals>
              <goal>install-node-and-npm</goal>
            </goals>
            <configuration>
              <nodeVersion>v0.10.22</nodeVersion>
              <npmVersion>1.3.8</npmVersion>
            </configuration>
          </execution>

          <execution>
            <id>npm install</id>
            <goals>
              <goal>npm</goal>
            </goals>
          </execution>

          <execution>
            <id>bower install</id>
            <goals>
              <goal>bower</goal>
            </goals>
            <configuration>
              <arguments>--allow-root install</arguments>
            </configuration>
          </execution>

          <execution>
            <id>grunt build</id>
            <goals>
              <goal>grunt</goal>
            </goals>

            <configuration>
              <arguments>--no-color</arguments>
            </configuration>
          </execution>
        </executions>
      </plugin>

而後在zeppelin-web目錄下依次執行

npm install,

bower --allow-root install,

grunt --no-color --force,

mvn install -DskipTests,

把web項目打包,在target目錄下會生成war


  • 六、在項目根目錄下執行(根據你的需求替換版本)

mvn clean package -Pbuild-distr -Pspark-1.6 -Phadoop-2.6 -Pyarn -Ppyspark -Dhadoop.version=2.6.0-cdh5.4.2 -Pvendor-repo -DskipTests
  • 七、完成後zeppelin-distribution找到打好的包

  • 八、配置(黑色爲必填項,紅色爲pyspark配置看http://my.oschina.net/ldl123292/blog/657531)

/conf/zeppelin-env.sh

export JAVA_HOME=/usr/java/jdk1.8.0_45

export SPARK_HOME=/home/spark-1.6.0-bin-hadoop2.6

export PYSPARK_PYTHON=/home/spark-1.6.0-bin-hadoop2.6/python

export PYTHONPATH=/home/spark-1.6.0-bin-hadoop2.6/python:/home/spark-1.6.0-bin-hadoop2.6/python/lib/py4j-0.9-src.zip

export MASTER=spark://hadoop02:7077


/conf/zeppelin-site.xml(修改項目端口號)

<property>

  <name>zeppelin.server.port</name>

  <value>8800</value>

  <description>Server port.</description>

</property>

  • 九、zeppelin-0.5.6-incubating/lib下將jackson-*-2.5.0.jar替換爲jackson-*-2.4.4.jar,不替換好像是沒法執行sc.textFile之類的

  • 十、啓動

相關文章
相關標籤/搜索