Skip to content

Commit 227f8a3

Browse files
safchainGerrit Code Review
authored andcommitted
devstack: fix ES installation and add loglevel
Change-Id: I9f73ceb7f9fb4feab1271fd303c00b0862166d4e
1 parent e807164 commit 227f8a3

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ The plugin accepts the following parameters:
243243

244244
# Remote port for ovsdb server.
245245
#SKYDIVE_OVSDB_REMOTE_PORT=6640
246+
247+
# Set the default log level, default: INFO
248+
#SKYDIVE_LOGLEVEL=DEBUG
246249
```
247250

248251
## Contributing

devstack/plugin.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,15 @@ SKYDIVE_AGENT_PROBES=${SKYDIVE_AGENT_PROBES:-"netlink netns ovsdb neutron"}
4343
# Remote port for ovsdb server.
4444
SKYDIVE_OVSDB_REMOTE_PORT=6640
4545

46+
# Default log level
47+
SKYDIVE_LOGLEVEL=${SKYDIVE_LOGLEVEL:-INFO}
48+
4649
# Storage used by the analyzer to store flows
4750
SKYDIVE_STORAGE=${SKYDIVE_STORAGE:-"elasticsearch"}
4851

52+
ELASTICSEARCH_BASE_URL=https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution
53+
ELASTICSEARCH_VERSION=2.3.1
54+
4955
function install_go {
5056
if [[ `uname -m` == *"64" ]]; then
5157
arch=amd64
@@ -64,11 +70,21 @@ function install_go {
6470
export GOPATH=$GOPATH
6571
}
6672

73+
function download_elasticsearch {
74+
if is_ubuntu; then
75+
wget ${ELASTICSEARCH_BASE_URL}/deb/elasticsearch/${ELASTICSEARCH_VERSION}/elasticsearch-${ELASTICSEARCH_VERSION}.deb \
76+
-O ${TOP_DIR}/files/elasticsearch-${ELASTICSEARCH_VERSION}.deb
77+
elif is_fedora; then
78+
wget ${ELASTICSEARCH_BASE_URL}/rpm/elasticsearch/${ELASTICSEARCH_VERSION}/elasticsearch-${ELASTICSEARCH_VERSION}.rpm \
79+
-O ${TOP_DIR}/files/elasticsearch-${ELASTICSEARCH_VERSION}.noarch.rpm
80+
fi
81+
}
82+
6783
function pre_install_skydive {
6884
install_go
69-
if is_service_enabled skydive-analyzer ; then
70-
ELASTICSEARCH_VERSION=2.3.1
71-
$TOP_DIR/pkg/elasticsearch.sh download
85+
if is_service_enabled skydive-analyzer; then
86+
download_elasticsearch
87+
export ELASTICSEARCH_VERSION
7288
$TOP_DIR/pkg/elasticsearch.sh install
7389
fi
7490
}
@@ -136,6 +152,9 @@ EOF
136152
analyzer:
137153
listen: $SKYDIVE_ANALYZER_LISTEN
138154
storage: $SKYDIVE_STORAGE
155+
156+
logging:
157+
default: $SKYDIVE_LOGLEVEL
139158
EOF
140159
fi
141160

0 commit comments

Comments
 (0)