From 0da86295b83ccc734778b80e0bf1a30d0b182eb5 Mon Sep 17 00:00:00 2001 From: Tong Li Date: Thu, 31 Mar 2016 14:22:46 -0400 Subject: [PATCH] Move out the binary files folder out of the project. The binary file folder was part of the project, it is not good to synch large files between deploy machine and target machine. This patch set also added procedure to install kibana. Change-Id: I8d035ef8f335aa1a715793e708b005da00d203bb --- vagrant/README.md | 65 +++++++++++++++---------- vagrant/onvm/conf/nodes.conf.yml | 7 +-- vagrant/onvm/scripts/install-elastic.sh | 19 +++++++- vagrant/rebootvm.sh | 8 +-- vagrant/stvm.sh | 4 +- 5 files changed, 67 insertions(+), 36 deletions(-) diff --git a/vagrant/README.md b/vagrant/README.md index e601c89..a464b3c 100644 --- a/vagrant/README.md +++ b/vagrant/README.md @@ -1,29 +1,42 @@ -Note +Introduction +============ +This subproject uses vagrant to setup kiloeyes. To make the install easier, +one should download java 8, elasticsearch, kibana and kafka binaries and place +these files into a directory named leapbin at the same directory where the +project kiloeyes is. Here is an example:: + + leapbin + elasticsearch-2.3.0.deb + jdk-8u77-linux-x64.tar.gz + kafka_2.11-0.9.0.0.tgz + kibana-4.5.0-linux-x64.tar.gz + kiloeyes + etc + kiloeyes + vagrant + .... + +Having the structure like this will make the install goes faster. And when you +need to run the scripts repeatly, you won't need to keep downloading these +large files. The example directory leapbin above also lists the current +required software to run kiloeyes. + + +Usage: ====== +You can install everything onto one machine or you can choose install different +components onto different servers. There can be a lot of ways to split up +servers for different services. Here is an example: -Only tested on Vagrant 1.7.x + VirtualBox 4.3 + controller: + java + elasticsearch + kibana + kiloeyes + devstack: + OpenStack environment + agent01: + agent -It will install JDK8, ElasticSeach, Kafka, Virtualenv, and VirtualenvWrapper for you. - -Usage -====== - -Create your own Vagrant config. file - -``` - cp ubuntu-virtualbox.yml.sample ubuntu-virtualbox.yml -``` - -You can change VM memory, Kafka, or ElasticSearch package URL. - -``` - vagrant up -``` - -Under /vagrant folder you can find kiloeyes project and Kafka uncompress folders. - -Use below command to start ElasticSearch: - -``` - sudo /etc/init.d/elasticsearch start -``` +To indicate how the servers will be used, please edit configuration file in +vagrant/onvm/conf/nodes.conf.yml and ids.conf.yml file. \ No newline at end of file diff --git a/vagrant/onvm/conf/nodes.conf.yml b/vagrant/onvm/conf/nodes.conf.yml index c17e55d..1e235da 100644 --- a/vagrant/onvm/conf/nodes.conf.yml +++ b/vagrant/onvm/conf/nodes.conf.yml @@ -20,7 +20,7 @@ logical2physical: kiloeyes: controller elastic: controller kafka: controller - devstack: devstack + devstack: controller # Define how many logical nodes and the sequence of the installation @@ -31,7 +31,8 @@ ctlnodes: - kiloeyes agentes: - - agent01 +# - agent01 +# - agent02 uselocalrepo: yes @@ -42,7 +43,7 @@ aptopt: --force-yes # The folder should be a local directory start from the project root synchfolders: elastic: - source: leapbin + source: ./../../leapbin target: /leapbin kiloeyes: source: ./../../kiloeyes diff --git a/vagrant/onvm/scripts/install-elastic.sh b/vagrant/onvm/scripts/install-elastic.sh index 3c79bb5..0d2a7ec 100644 --- a/vagrant/onvm/scripts/install-elastic.sh +++ b/vagrant/onvm/scripts/install-elastic.sh @@ -16,5 +16,22 @@ if [ -f /leapbin/elasticsearch-2.*.deb ];then echo 'Elastic install is now complete!' else echo 'Elasticsearch binary was not found!' - echo 'Download elasticsearch 2.2.x.deb and place it in tools/vagrant/ubuntu/leapbin directory.' + echo 'Download elasticsearch and configure the location in nodes.conf.yml file.' +fi + +if [ -f /leapbin/kibana-4.*-linux-x64.tar.gz ];then + mkdir -p /opt/kibana + tar -zxf /leapbin/kibana-4.*-linux-x64.tar.gz -C /opt/kibana + mv /opt/kibana/* /opt/kibana/kibana + echo -e 'elasticsearch.url: "http://'$2':9200"' >> /opt/kibana/kibana/config/kibana.yml + + # Start the kibana services + start-stop-daemon --start --quiet --chuid root \ + --exec /opt/kibana/kibana/bin/kibana \ + --pidfile /opt/kibana/kibana.pid --make-pidfile --background >> /dev/null 2>&1 + + echo 'Kibana install is now complete!' +else + echo 'Kibana binary was not found!' + echo 'Download kibana and and configure the location in nodes.conf.yml file.' fi diff --git a/vagrant/rebootvm.sh b/vagrant/rebootvm.sh index 20966c1..c837bf2 100755 --- a/vagrant/rebootvm.sh +++ b/vagrant/rebootvm.sh @@ -1,7 +1,7 @@ -VBoxManage snapshot h2-compute01 restore "Snapshot 3" -VBoxManage snapshot h2-nova restore "Snapshot 3" +#VBoxManage snapshot h2-compute01 restore "Snapshot 3" +#VBoxManage snapshot h2-nova restore "Snapshot 3" VBoxManage snapshot h2-controller restore "Snapshot 3" -vboxmanage startvm h2-compute01 --type headless -vboxmanage startvm h2-nova --type headless +#vboxmanage startvm h2-compute01 --type headless +#vboxmanage startvm h2-nova --type headless vboxmanage startvm h2-controller --type headless diff --git a/vagrant/stvm.sh b/vagrant/stvm.sh index 8c4892a..37d74ed 100755 --- a/vagrant/stvm.sh +++ b/vagrant/stvm.sh @@ -1,3 +1,3 @@ -vboxmanage controlvm h2-compute01 acpipowerbutton -vboxmanage controlvm h2-nova acpipowerbutton +#vboxmanage controlvm h2-compute01 acpipowerbutton +#vboxmanage controlvm h2-nova acpipowerbutton vboxmanage controlvm h2-controller acpipowerbutton