From e33e18050f7c3fdc9093f3f2da8470fbf8017e57 Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 1 Apr 2014 22:35:37 +0200 Subject: add graphite deployment --- sites/elchstats.nsupdate.info/carbon.service | 15 +++++++++++ sites/elchstats.nsupdate.info/graphite-web.service | 14 ++++++++++ sites/elchstats.nsupdate.info/graphite.journal.txt | 31 ++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 sites/elchstats.nsupdate.info/carbon.service create mode 100644 sites/elchstats.nsupdate.info/graphite-web.service create mode 100644 sites/elchstats.nsupdate.info/graphite.journal.txt (limited to 'sites/elchstats.nsupdate.info') diff --git a/sites/elchstats.nsupdate.info/carbon.service b/sites/elchstats.nsupdate.info/carbon.service new file mode 100644 index 00000000..d7087d41 --- /dev/null +++ b/sites/elchstats.nsupdate.info/carbon.service @@ -0,0 +1,15 @@ +[Unit] +Description=Graphite Carbon +After=network.target + +[Service] +Type=forking +User=graphite +Group=graphite +RemainAfterExit=yes +PIDFile=/opt/graphite/storage/carbon-cache-a.pid +ExecStart=/opt/graphite/bin/carbon-cache.py start +ExecStop=/opt/graphite/bin/carbon-cache.py stop + +[Install] +WantedBy=multi-user.target diff --git a/sites/elchstats.nsupdate.info/graphite-web.service b/sites/elchstats.nsupdate.info/graphite-web.service new file mode 100644 index 00000000..4fc25467 --- /dev/null +++ b/sites/elchstats.nsupdate.info/graphite-web.service @@ -0,0 +1,14 @@ +[Unit] +Description=Graphite Web +After=network.target + +[Service] +Type=simple +User=graphite +Group=graphite +RemainAfterExit=yes +Environment=PYTHONPATH=/opt/graphite/webapp +ExecStart=/usr/bin/django-admin.py runserver 0.0.0.0:8080 --settings=graphite.settings + +[Install] +WantedBy=multi-user.target diff --git a/sites/elchstats.nsupdate.info/graphite.journal.txt b/sites/elchstats.nsupdate.info/graphite.journal.txt new file mode 100644 index 00000000..83e36c93 --- /dev/null +++ b/sites/elchstats.nsupdate.info/graphite.journal.txt @@ -0,0 +1,31 @@ +#?/bin/sh +# from http://graphite.wikidot.com/installation + +git clone https://github.com/graphite-project/graphite-web.git +git clone https://github.com/graphite-project/carbon.git +git clone https://github.com/graphite-project/whisper.git + +pacman -S python2 gcc pkg-config cairo +for i in whisper carbon graphite-web;do + cd $i + pip2 install -r requirements.txt||: + python2 setup.py install +done +cd /opt/graphite/conf +cp carbon.conf.example carbon.conf +cp storage-schemas.conf.example storage-schemas.conf +cd /opt/graphite/webapp/graphite +cp local_settings.py.example local_settings.py +PYTHONPATH=/opt/graphite/webapp django-admin.py syncdb --settings=graphite.settings +# push in the texts + +useradd -m graphite -d /opt/graphite -r +chown -R graphite /opt/graphite +cd here +cp carbon.service /opt/systemd/system/ +systemctl enable carbon +systemctl start carbon +cp graphite-web.service /opt/systemd/system/ +systemctl enable graphite-web +systemctl start graphite-web + -- cgit v1.2.3 From 6d78922eddbbb24d812973558355a74d2bd786c7 Mon Sep 17 00:00:00 2001 From: makefu Date: Wed, 2 Apr 2014 13:25:36 +0200 Subject: graphite-web.service: make startup more robust --- sites/elchstats.nsupdate.info/graphite-web.service | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sites/elchstats.nsupdate.info') diff --git a/sites/elchstats.nsupdate.info/graphite-web.service b/sites/elchstats.nsupdate.info/graphite-web.service index 4fc25467..798f82ba 100644 --- a/sites/elchstats.nsupdate.info/graphite-web.service +++ b/sites/elchstats.nsupdate.info/graphite-web.service @@ -6,9 +6,11 @@ After=network.target Type=simple User=graphite Group=graphite -RemainAfterExit=yes +#RemainAfterExit=yes Environment=PYTHONPATH=/opt/graphite/webapp ExecStart=/usr/bin/django-admin.py runserver 0.0.0.0:8080 --settings=graphite.settings +TimeoutSec=45s +Restart=always [Install] WantedBy=multi-user.target -- cgit v1.2.3 From 95fbba75246cf1b5115bc5493d3119f9ea91221e Mon Sep 17 00:00:00 2001 From: makefu Date: Sun, 27 Apr 2014 18:18:08 +0200 Subject: update things --- sites/elchstats.nsupdate.info/graphite.journal.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sites/elchstats.nsupdate.info') diff --git a/sites/elchstats.nsupdate.info/graphite.journal.txt b/sites/elchstats.nsupdate.info/graphite.journal.txt index 83e36c93..d3a73433 100644 --- a/sites/elchstats.nsupdate.info/graphite.journal.txt +++ b/sites/elchstats.nsupdate.info/graphite.journal.txt @@ -1,21 +1,27 @@ #?/bin/sh +set -euf # from http://graphite.wikidot.com/installation git clone https://github.com/graphite-project/graphite-web.git git clone https://github.com/graphite-project/carbon.git git clone https://github.com/graphite-project/whisper.git -pacman -S python2 gcc pkg-config cairo +pacman -S python2 gcc pkg-config cairo python2-pip for i in whisper carbon graphite-web;do cd $i pip2 install -r requirements.txt||: python2 setup.py install + cd - done cd /opt/graphite/conf cp carbon.conf.example carbon.conf +# edit carbon.conf, fix max writes per second, max adds per minute cp storage-schemas.conf.example storage-schemas.conf +# edit storage-schemas.conf, fix storage time + cd /opt/graphite/webapp/graphite cp local_settings.py.example local_settings.py +# change SECRET_KEY PYTHONPATH=/opt/graphite/webapp django-admin.py syncdb --settings=graphite.settings # push in the texts -- cgit v1.2.3 From 92fe3350fe6e3da26fa1ad0522aabaa0f146d575 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 5 May 2014 09:53:32 +0200 Subject: Merge all the shits --- sites/elchstats.nsupdate.info/graphite.journal.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sites/elchstats.nsupdate.info') diff --git a/sites/elchstats.nsupdate.info/graphite.journal.txt b/sites/elchstats.nsupdate.info/graphite.journal.txt index d3a73433..777f4650 100644 --- a/sites/elchstats.nsupdate.info/graphite.journal.txt +++ b/sites/elchstats.nsupdate.info/graphite.journal.txt @@ -17,8 +17,8 @@ cd /opt/graphite/conf cp carbon.conf.example carbon.conf # edit carbon.conf, fix max writes per second, max adds per minute cp storage-schemas.conf.example storage-schemas.conf -# edit storage-schemas.conf, fix storage time +# edit storage-schemas.conf, fix storage time cd /opt/graphite/webapp/graphite cp local_settings.py.example local_settings.py # change SECRET_KEY @@ -27,7 +27,7 @@ PYTHONPATH=/opt/graphite/webapp django-admin.py syncdb --settings=graphite.setti useradd -m graphite -d /opt/graphite -r chown -R graphite /opt/graphite -cd here +cd _here_ cp carbon.service /opt/systemd/system/ systemctl enable carbon systemctl start carbon -- cgit v1.2.3