Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Start a Zookeeper instance. From the S4 base directory, do:
    Code Block
    ./s4 zkServer
  2. Define 2 clusters : 1 for deploying the twitter-counter app, and 1 for the adapter app
    Code Block
    ./s4 newCluster -c=cluster1 -nbTasks=2 -flp=12000; ./s4 newCluster -c=cluster2 -nbTasks=1 -flp=13000
  3. Start 2 app nodes (you may want to start each node in a separate console) :
    Code Block
    ./s4 node -c=cluster1
    ./s4 node -c=cluster1
    
  4. Start 1 node for the adapter app:
    Code Block
    ./s4 node -c=cluster2 -p=s4.adapter.output.stream=RawStatus
  5. Deploy twitter-counter app (you may also first build the s4r then publish it, as described in the previous section)
    Code Block
    ./s4 deploy -appName=twitter-counter -c=cluster1 -b=`pwd`/test-apps/twitter-counter/build.gradle
  6. Deploy twitter-adapter app. In this example, we don't directly specify the app class of the adapter, we use the deployment approach for apps (remember, the adapter is also an app).
    Code Block
    ./s4 deploy -appName=twitter-adapter -c=cluster2 -b=`pwd`/test-apps/twitter-adapter/build.gradle
  7. Observe the current 10 most popular topics in file TopNTopics.txt. The file gets updated at regular intervals, and only outputs topics with a minimum of 10 occurrences, so you may have to wait a little before the file is updated :
    Code Block
    tail -f TopNTopics.txt
  8. You may also check the status of the S4 node with:
    Code Block
    ./s4 status

...