~jorge/charms/bundles/elasticsearch/bundle

« back to all changes in this revision

Viewing changes to demo.sh

  • Committer: Jorge O. Castro
  • Date: 2014-08-07 12:26:08 UTC
  • Revision ID: jorge@ubuntu.com-20140807122608-725t405yhynvh9ds
Add a more robust demo.sh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#/bin/bash
2
 
set +ex
3
 
sudo /usr/share/elasticsearch/bin/plugin -install lukas-vlcek/bigdesk
4
 
sudo /usr/share/elasticsearch/bin/plugin -install karmi/elasticsearch-paramedic
5
 
 
6
 
curl -XPUT http://localhost:9200/shakespeare -d '
7
 
{
8
 
 "mappings" : {
9
 
  "_default_" : {
10
 
   "properties" : {
11
 
    "speaker" : {"type": "string", "index" : "not_analyzed" },
12
 
    "play_name" : {"type": "string", "index" : "not_analyzed" },
13
 
    "line_id" : { "type" : "integer" },
14
 
    "speech_number" : { "type" : "integer" }
15
 
   }
16
 
  }
17
 
 }
18
 
}
19
 
';
20
 
wget http://www.elasticsearch.org/guide/en/kibana/current/snippets/shakespeare.json -O /home/ubuntu/shakespeare.json
21
 
curl -XPUT localhost:9200/_bulk --data-binary @/home/ubuntu/shakespeare.json
 
1
#!/bin/bash
 
2
set -ex
 
3
 
 
4
juju run --unit elasticsearch/0 "sudo /usr/share/elasticsearch/bin/plugin -install lukas-vlcek/bigdesk"
 
5
juju run --unit elasticsearch/0 "sudo /usr/share/elasticsearch/bin/plugin -install karmi/elasticsearch-paramedic"
 
6
 
 
7
wget http://www.elasticsearch.org/guide/en/kibana/current/snippets/shakespeare.json
 
8
juju scp shakespeare.json elasticsearch/0:
 
9
 
 
10
juju run --unit elasticsearch/0 "curl -XPUT localhost:9200/_bulk --data-binary @/home/ubuntu/shakespeare.json > /dev/null"
 
11
 
 
12
juju run --unit kibana/0 "cd /srv/kibana3/app/dashboards; sudo wget http://www.elasticsearch.org/guide/en/kibana/current/snippets/plays.json; sudo cp plays.json default.json; sudo /etc/init.d/nginx restart"