[Spark Asia Pacific Research Institute Series] the path to spark practice-Chapter 1 building a spark cluster (step 4) (2)

Source: Internet
Author: User
Step 2: Use the spark cache mechanism to observe the Efficiency Improvement

 

Based on the above content, we are executing the following statement:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/AF/wKioL1QY8tmiGO95AAG6MKKe5vI885.jpg "style =" float: none; "Title =" 1.png" alt = "wkiol1qy8tmigo95aag6mkke5vi885.jpg"/>

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/AD/wKiom1QY8sLjnB_KAAHXbDhuD_I646.jpg "style =" float: none; "Title =" 2.png" alt = "wkiom1qy8sljnb_kaahxbdhud_i646.jpg"/>

It is found that the same calculation result is 15.

In this case, go to the Web console:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/AF/wKioL1QY8tqRkwVjAAHBoCNvJwc204.jpg "style =" float: none; "Title =" 3.png" alt = "wkiol1qy8tqrkwvjaahbocnv1_c204.jpg"/>

The console clearly shows that we performed the "count" Operation twice.

Now we will execute the "Sparks" variable for the "cache" Operation:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/AD/wKiom1QY8sPzYb0MAABRE_EwatM469.jpg "style =" float: none; "Title =" 4.png" alt = "wkiom1qy8spzyb0maabre_ewatm469.jpg"/>

Run the Count operation to view the Web console:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M02/49/AF/wKioL1QY8tuzn5haAAHpGKSBXjc247.jpg "style =" float: none; "Title =" 5.png" alt = "wkiol1qy8tuzn5haaahpgksbxjc247.jpg"/>

At this time, we found that the three count operations we performed before and after were respectively 0.7 s, 0.3 s, 0.5 s.

In this case, we perform the Count operation for the fourth time and check the effect of the Web Console:

The fourth clear operation on the console takes only 17 ms, which is about 30 times faster than the first three operations. This is the huge speed improvement brought by caching, and cache-based computing is one of the core of spark!

 

Step 3: Build the spark IDE development environment

 

Step 1: At present, the preferred inteiiij IDE development tool for spark in the world is idea. Download inteiiij idea:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/AF/wKioL1QY8tzTCFI0AAGQrWJOjqU385.jpg "style =" float: none; "Title =" 1.png" alt = "wkiol1qy8tztcfi0aagqrwjojqu385.jpg"/>

Download the latest version 13.1.4:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/AF/wKioL1QY8t2Bh0KYAAJdv8xtjs0326.jpg "style =" float: none; "Title =" 2.png" alt = "wkiol1qy8t2bh0kyaajdv8xtjs0326.jpg"/>

For the version selection, the official team provides the following options:

Here we select the "Community edition free" version in Linux, which can fully meet Scala development needs of any degree of complexity.

After the download is complete, save it to the following local location:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M00/49/AD/wKiom1QY8sXSj-_lAAEYDV12uFs177.jpg "style =" float: none; "Title =" 3.png" alt = "wKiom1QY8sXSj-_lAAEYDV12uFs177.jpg"/>

Step 2: Install idea and configure idea system environment variables

Create the "/usr/local/idea" directory:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/AF/wKioL1QY8t3yheg2AADla2-FKNs119.jpg "style =" float: none; "Title =" 4.png" alt = "wKioL1QY8t3yheg2AADla2-FKNs119.jpg"/>

Decompress the downloaded idea package to this directory:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/49/AD/wKiom1QY8sbAlaWeAAHeLrunSlc705.jpg "style =" float: none; "Title =" 5.png" alt = "wkiom1qy8sbalaweaahelruntmp705.jpg"/>

After the installation is complete, in order to facilitate the use of the command in the bin directory, we configure it in the "~ /. Bashrc ":


This article is from the spark Asia Pacific Research Institute blog, please be sure to keep this source http://rockyspark.blog.51cto.com/2229525/1553616

[Spark Asia Pacific Research Institute Series] the path to spark practice-Chapter 1 building a spark cluster (step 4) (2)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.