Run kmeans on Twister

Source: Internet
Author: User
1. Prepare 1.1 to start activemq and twister in advance.
xiuwenyi@Twister1:~/apache-activemq-5.4.2/bin$ ./activemq console
xiuwenyi@Twister1:~/twister-0.9/bin$ ./start_twister.sh 
1.2 jar package (on all nodes) Run ant under $ twister_home/samples/kmeans to copy the generated Twister-Kmeans-0.9.jar to the $ twister_home/apps path

2. Run the kmeans algorithm 2.1 to create the kmeans input directory

xiuwenyi@Twister1:~$ cd $TWISTER_HOME/bin xiuwenyi@Twister1:~/twister-0.9/bin$ ./twister.sh mkdir kmeans

2.2 generate data
xiuwenyi@Twister1:~/twister-0.9/bin$ cd $TWISTER_HOME/samples/kmeans/bin xiuwenyi@Twister1:~/twister-0.9/samples/kmeans/bin$ ./gen_data.sh init_clusters.txt 3 3 /kmeans km_data 6  60000
Automatically upload the generated data files to each node in the cluster on average. If you do not need to generate data automatically, use the following command to allocate data.
cd $TWISTER_HOME/bin ./twister.sh put $TWISTER_HOME/samples/kmeans/input kmeans


2.3 create a partition File

xiuwenyi@Twister1:~/twister-0.9/samples/kmeans/bin$ cd $TWISTER_HOME/bin xiuwenyi@Twister1:~/twister-0.9/bin$ ./create_partition_file.sh kmeans km_data $TWISTER_HOME/samples/kmeans/bin/kmeans.pf
2.4 run
xiuwenyi@Twister1:~/twister-0.9/samples/kmeans/bin$ cd $TWISTER_HOME/samples/kmeans/binxiuwenyi@Twister1:~/twister-0.9/samples/kmeans/bin$ ./run_kmeans.sh init_clusters.txt 6 kmeans.pf



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.