Twitter Strom cluster creation instance

Source: Internet
Author: User

Maven installation Configuration

1. First install Maven on the Local Computer, download the http://maven.apache.org from the official maven website/

2. decompress it locally, and then use the settings. xml file under the corresponding directory/apache-maven-3.0.3/conf/of the configuration,

The settings. xml file package contains configuration details related to the system environment, such as Agent configuration, remote repository, localRepository, and server authentication information.

The most important is the local repository Path of localRepository, Which is <localRepository> yourlocalRepository Path </localRepository>.

Setting. xml detailed explanation see http://maven.apache.org/settings.html

3. Configure the environment variables. If the environment variables are in linux, modify the corresponding/etc/profile file. For windows, refer to java environment variable settings.

Configure MAVEN_HOME = yourpath \ apache-maven-3.0.3,

Add apache-maven-3.0.3 \ bin to system variable Path,

Configure JAVA_HOME = yourJDKPath,

Make sure that the Path of the system variable contains the JDK bin directory. Otherwise, an error is returned! It cannot be compiled in windows!

4. Verify that Maven is configured successfully.

Run mvn-v in the cmd window. The installed Maven version is displayed.

Download storm-starter compilation and import the eclipse project

1. Download the strom starter code git clone https://github.com/nathanmarz/storm-starter.git

2. Use mvn-f m2-pom.xml package for compilation

3. Copy m2_pom.xml in the storm-starter directory to pom. xml, because eclipse requires pom. xml

4. Use mvn eclipse: eclipse to compile it into an eclipse project

5. In Eclipse, select the storm-starter path for import. Generally, after importing a project, you need to set the appropriate M2 _ to check whether the project is correct. You may need to configure the M2_REPO variable,

M2_REPO configuration method: Right-click the project and choose Properties> Java Build Path> Libraries> AddVariable> Configure Variable> New

Enter Name: M2_REPO, Path: localRepository Path-> OK to refresh the project. The code is correct and can be developed.

6. After the compilation is correct, run WordCountTopology in the storm. starter directory locally. The screenshot below shows that the local mode can run through

Use the export function of eclipse to export the jar package of the project, so that the corresponding logic can be submitted in Distributed scenarios.

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.