Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Matters needing attention for setting up stand-alone Spark in Ubuntu system

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

For Spark, if you just want to touch and be familiar with it, you can build a stand-alone Spark. The general steps are as follows (I use Ubuntu 14.04under VMWare, which is run under root without considering security issues for the time being):

1. Install Ubuntu 14.04. after installation, you need to disable the firewall (ufw disable), install the SSH server, and enable root users.

2. Download and install JDK-1.8, scala 2.11.8 (need to cooperate with the jar version of spark, this is not necessary for practice), spark, maven (for build, the scala version here needs to be consistent with spark, otherwise a ClassNotDef exception may occur)

3. Configure environment variables in .profile, such as:

Export SPARK_HOME=/root/spark-2.2.0-bin-hadoop2.7

Export SPARK_LOCAL_HOST=192.168.162.132

Export SPARK_MASTER_HOST=192.168.162.132

4. Start spark:

$SPARK_HOME/sbin/start-master.sh

# it must also be started in the case of a stand-alone machine, otherwise there is no worker

$SPARK_HOME/sbin/start-slave.sh

5. Use maven to compile a sample program (of course, sbt can also)

6. Submit your test program as follows:

$SPARK_HOME/spark-submit-- class "class name"-- master spark://IP:Port package file name

In addition, it is important to note that hostnames need to be correctly configured in / etc/hosts and / etc/hostname, otherwise IOException may appear

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report