diff --git a/README.md b/README.md index 3416650b..640cc49a 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,10 @@ To contribute to the development of the SONATA gui you have to fork the reposito ## Installation ``` docker run -d --name son-monitor-influxdb -p 8086:8086 son-monitor-influxdb -docker run -d --name son-monitor-mysql -e MYSQL_ROOT_PASSWORD=user -e MYSQL_USER=user -e MYSQL_PASSWORD=pass -e MYSQL_DATABASE=dbname -p 3306:3306 son-monitor-mysql +docker run -d --name son-monitor-postgres -e POSTGRES_DB=dbname -e POSTGRES_USER=user -e POSTGRES_PASSWORD=pass -p 5433:5432 ntboes/postgres-uuid docker run -d --name son-monitor-pushgateway -p 9091:9091 son-monitor-pushgateway docker run -d --name son-monitor-prometheus -p 9090:9090 -p 9089:9089 -e RABBIT_URL=:5671 --add-host pushgateway:127.0.0.1 --add-host influx:127.0.0.1 son-monitor-prometheus -docker run -d --name son-monitor-manager --add-host mysql:127.0.0.1 --add-host prometheus:127.0.0.1 -p 8000:8000 son-monitor-manager +docker run -d --name son-monitor-manager --add-host postgsql:127.0.0.1 --add-host prometheus:127.0.0.1 -p 8000:8000 son-monitor-manager ``` ## Usage diff --git a/manager/Dockerfile b/manager/Dockerfile index 6c33de29..28059b24 100644 --- a/manager/Dockerfile +++ b/manager/Dockerfile @@ -1,7 +1,7 @@ FROM ubuntu:14.04 RUN apt-get update && apt-get -y upgrade && \ -apt-get -y install apache2 python2.7 python-pip libmysqlclient-dev python2.7-dev libyaml-dev libapache2-mod-wsgi +apt-get -y install apache2 python2.7 python-pip libmysqlclient-dev python2.7-dev libpq-dev libyaml-dev libapache2-mod-wsgi RUN mkdir /opt/Monitoring COPY ./ /opt/Monitoring diff --git a/manager/ManagerSrv/settings.py b/manager/ManagerSrv/settings.py index c2cfcc16..8b4ec6df 100644 --- a/manager/ManagerSrv/settings.py +++ b/manager/ManagerSrv/settings.py @@ -124,12 +124,12 @@ DATABASES = { 'default': { - 'ENGINE': 'django.db.backends.mysql', + 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'monitoring', 'USER': 'monitoringuser', 'PASSWORD': 'sonata', - 'HOST': 'mysql', - 'PORT': 3306, + 'HOST': 'postgsql', + 'PORT': 5433, } } diff --git a/manager/requirements.txt b/manager/requirements.txt index 0dc6f35a..9b7b39aa 100644 --- a/manager/requirements.txt +++ b/manager/requirements.txt @@ -8,3 +8,4 @@ Markdown==2.6.5 mysqlclient==1.3.7 Pygments==2.1.1 PyYAML==3.11 +psycopg2==2.6.2 \ No newline at end of file diff --git a/manager/run.sh b/manager/run.sh index 17394765..26317e04 100644 --- a/manager/run.sh +++ b/manager/run.sh @@ -1,6 +1,6 @@ #!/bin/bash echo "Wait for sqlDB...." -while ! nc -z mysql 3306; do +while ! nc -z postgsql 5433; do sleep 1 && echo -n .; # waiting for mysql done; python /opt/Monitoring/manage.py makemigrations && \ diff --git a/mysql/Dockerfile b/mysql/Dockerfile deleted file mode 100644 index 7efee1dc..00000000 --- a/mysql/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM mysql:5.7