Add openflowplugin-scalability.txt scriptplan
[integration/test.git] / csit / scripts / set_jvm_common_attribute.sh
1 #!/bin/bash
2 echo "Setup common config to ${ODL_SYSTEM_IP}"
3
4 cat > ${WORKSPACE}/org.apache.karaf.decanter.appender.elasticsearch.cfg <<EOF
5 host=${ODL_SYSTEM_IP}
6 port=9300
7 clusterName=elasticsearch
8
9 EOF
10
11 cat > ${WORKSPACE}/org.apache.karaf.decanter.collector.jmx-local.cfg <<EOF
12 type=jmx-local
13 url=local
14 object.name=java.lang:type=*,name=*
15
16 EOF
17
18 cat > ${WORKSPACE}/org.apache.karaf.decanter.collector.jmx-others.cfg <<EOF
19 type=jmx-local
20 url=local
21 object.name=java.lang:type=*
22
23 EOF
24
25 echo "Copying config files to ${ODL_SYSTEM_IP}"
26
27 scp ${WORKSPACE}/org.apache.karaf.decanter.appender.elasticsearch.cfg ${ODL_SYSTEM_IP}:/tmp/${BUNDLEFOLDER}/etc/
28 scp ${WORKSPACE}/org.apache.karaf.decanter.collector.jmx-local.cfg ${ODL_SYSTEM_IP}:/tmp/${BUNDLEFOLDER}/etc/
29 scp ${WORKSPACE}/org.apache.karaf.decanter.collector.jmx-others.cfg ${ODL_SYSTEM_IP}:/tmp/${BUNDLEFOLDER}/etc/
30
31 cat > ${WORKSPACE}/elasticsearch.yml <<EOF
32 cluster.name: elasticsearch
33 network.host: ${ODL_SYSTEM_IP}
34
35 EOF
36
37 scp ${WORKSPACE}/elasticsearch.yml ${ODL_SYSTEM_IP}:/tmp/
38 ssh ${ODL_SYSTEM_IP} "sudo mv /tmp/elasticsearch.yml /tmp/elasticsearch/elasticsearch-1.7.5/config/"
39 ssh ${ODL_SYSTEM_IP} "cat /tmp/elasticsearch/elasticsearch-1.7.5/config/elasticsearch.yml"
40
41 cat > ${WORKSPACE}/elasticsearch_startup.sh <<EOF
42 cd /tmp/elasticsearch
43 echo "Starting Elasticsearch node"
44 export JAVA_HOME=/usr
45 sudo /tmp/elasticsearch/elasticsearch-1.7.5/bin/elasticsearch > /dev/null 2>&1 &
46 ls -al /tmp/elasticsearch/elasticsearch-1.7.5/bin/elasticsearch
47
48 EOF
49
50 echo "Copying the elasticsearch_startup script to ${ODL_SYSTEM_IP}"
51 cat ${WORKSPACE}/elasticsearch_startup.sh
52 scp ${WORKSPACE}/elasticsearch_startup.sh ${ODL_SYSTEM_IP}:/tmp
53 ssh ${ODL_SYSTEM_IP} 'bash /tmp/elasticsearch_startup.sh'
54 ssh ${ODL_SYSTEM_IP} 'ps aux | grep elasticsearch'