Skip to content

Instantly share code, notes, and snippets.

@jbraeuer
Created February 1, 2012 08:43
Show Gist options
  • Save jbraeuer/1715985 to your computer and use it in GitHub Desktop.
Save jbraeuer/1715985 to your computer and use it in GitHub Desktop.
Install graphite 0.9.9 on Ubuntu 11.10 using PACKAGES
#! /bin/bash
#
# This script needs "fpm". If you dont have it,
# run "gem install fpm"
#
# You also need to "apt-get install python-setuptools" (otherwise fpm fails)
clean() {
rm -rf whisper-0.9.9 carbon-0.9.9 graphite-web-0.9.9
rm -f python*.deb
}
download() {
[ -e graphite-web-0.9.9.tar.gz ] || wget http://launchpad.net/graphite/0.9/0.9.9/+download/graphite-web-0.9.9.tar.gz
[ -e carbon-0.9.9.tar.gz ] || wget http://launchpad.net/graphite/0.9/0.9.9/+download/carbon-0.9.9.tar.gz
[ -e whisper-0.9.9.tar.gz ] || wget http://launchpad.net/graphite/0.9/0.9.9/+download/whisper-0.9.9.tar.gz
}
extract() {
tar -zxvf graphite-web-0.9.9.tar.gz
tar -zxvf carbon-0.9.9.tar.gz
tar -zxvf whisper-0.9.9.tar.gz
}
package() {
fpm -s python -t deb txamqp
fpm -s python -t deb -S 2.7 --depends "python" --depends "python-support" whisper-0.9.9/setup.py
fpm -s python -t deb -S 2.7 --depends "python" --depends "python-support" \
--depends "python-twisted" carbon-0.9.9/setup.py
fpm -s python -t deb -S 2.7 --depends "python" --depends "python-support" \
--depends "python-twisted" \
--depends "python-cairo" \
--depends "python-django" \
--depends "python-django-tagging" \
--depends "python-ldap" \
--depends "python-memcache" \
--depends "python-pysqlite2" \
--depends "python-sqlite" \
--depends "libapache2-mod-python" \
graphite-web-0.9.9/setup.py
}
install() {
sudo dpkg -i python*.deb
sudo apt-get -f install
}
download
clean
extract
package
install
@hontvari
Copy link

Thanks, yes, PATH was wrong, ./package-graphite must not be started with sudo, because by default sudo replaces path with a hard coded value, but anyway, the gem installed binary is not on the user path. So I prefixed fpm calls with the aboluste path: /var/lib/gems/1.8/bin/

However it fails first with this message:

whisper-0.9.9/PKG-INFO
Trying to download txamqp (using: easy_install)
/var/lib/gems/1.8/gems/fpm-0.3.11/lib/fpm/util.rb:4:in `safesystem': 'system(["easy_install", "-i", "http://pypi.python.org/simple", "--editable", "-U", "--build-directory", "/home/levente/python-build20120228-887-iwat8x", "txamqp"])' failed with error code: 127 (RuntimeError)
        from /var/lib/gems/1.8/gems/fpm-0.3.11/lib/fpm/source/python.rb:62:in `download'
        from /var/lib/gems/1.8/gems/fpm-0.3.11/lib/fpm/source/python.rb:46:in `get_source'
        from /var/lib/gems/1.8/gems/fpm-0.3.11/lib/fpm/source.rb:39:in `initialize'
        from /var/lib/gems/1.8/gems/fpm-0.3.11/lib/fpm/builder.rb:39:in `new'
        from /var/lib/gems/1.8/gems/fpm-0.3.11/lib/fpm/builder.rb:39:in `initialize'
        from /var/lib/gems/1.8/gems/fpm-0.3.11/lib/fpm/program.rb:55:in `new'
        from /var/lib/gems/1.8/gems/fpm-0.3.11/lib/fpm/program.rb:55:in `run'
        from /var/lib/gems/1.8/gems/fpm-0.3.11/bin/fpm:20
        from /var/lib/gems/1.8/bin/fpm:19:in `load'
        from /var/lib/gems/1.8/bin/fpm:19

@jbraeuer
Copy link
Author

jbraeuer commented Feb 28, 2012 via email

@hontvari
Copy link

easy_install was not installed at all. After

sudo apt-get install python-setuptools

the scripts goes further. Sorry, Python, Ruby are all Greek to me.
It does not completes though, these are the warnings and errors:

Extracted editable version of txamqp to /home/levente/python-build20120228-988-1vgv77v/txamqp
If it uses setuptools in its setup script, you can activate it in
"development" mode by going to that directory and running::
    /usr/bin/python setup.py develop
running get_metadata
{
  "description": "UNKNOWN",
  "license": "UNKNOWN",
  "author": "Esteve Fernandez ",
  "url": "https://launchpad.net/txamqp",
  "version": "0.5",
  "architecture": "all",
  "dependencies": [
    "Twisted >= 0"
  ],
  "name": "txAMQP"
}
W, [2012-02-28T15:45:08.110808 #988]  WARN -- : Debian tools (dpkg/apt) don't do well with packages that use capital letters in the name. In some cases it will automatically downcase them, in others it will not. It is confusing.Best to not use any capital letters at all.
Copying to /home/levente/build-deb-python-txamqp_0.5_all.deb/data.tar
W, [2012-02-28T15:45:08.401386 #988]  WARN -- : Downcasing dependency 'python-Twisted' because deb packages  don't work so good with uppercase names
Created /home/levente/python-txamqp_0.5_all.deb
Copying to /home/levente/build-deb-python2.7-whisper_0.9.9_all.deb/data.tar
Created /home/levente/python2.7-whisper_0.9.9_all.deb
/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
running get_metadata
{
  "description": "Backend data caching and persistence daemon for Graphite",
  "license": "Apache Software License 2.0",
  "author": "Chris Davis ",
  "url": "https://launchpad.net/graphite",
  "version": "0.9.9",
  "architecture": "all",
  "dependencies": [],
  "name": "carbon"
}
/usr/lib/python2.6/distutils/dist.py:266: UserWarning: Unknown distribution option: 'install_requires'
  warnings.warn(msg)
Unpacking python-txamqp (from python-txamqp_0.5_all.deb) ...
dpkg: dependency problems prevent configuration of python2.7-carbon:
 python2.7-carbon depends on python-twisted; however:
  Package python-twisted is not installed.

@jbraeuer
Copy link
Author

jbraeuer commented Feb 28, 2012 via email

@hontvari
Copy link

hontvari commented Mar 2, 2012

I was finally able to install Graphite. Thank you for your help.

@mohanr
Copy link

mohanr commented Mar 29, 2012

I just called 'fpm' to check and got this. A older version of gem seems to be interfering ?

/home/admin/.rvm/gems/ruby-1.9.3-p125/bin/fpm
Invalid gemspec in [/var/lib/gems/1.8/specifications/clamp-0.3.0.gemspec]: invalid date format in specification: "2011-10-30 00:00:00.000000000Z"
/usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require': no such file to load -- clamp (LoadError) from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:inrequire'
from /var/lib/gems/1.8/gems/fpm-0.4.3/lib/fpm/command.rb:4
from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:in gem_original_require' from /usr/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:53:inrequire'
from /var/lib/gems/1.8/gems/fpm-0.4.3/bin/fpm:6
from /home/admin/.rvm/gems/ruby-1.9.3-p125/bin/fpm:19:in `load'
from /home/admin/.rvm/gems/ruby-1.9.3-p125/bin/fpm:19

@jbraeuer
Copy link
Author

jbraeuer commented Mar 29, 2012 via email

@jbraeuer
Copy link
Author

jbraeuer commented Mar 29, 2012 via email

@tortura
Copy link

tortura commented Mar 30, 2012

hi,
does it(script) work with debian amd 64 ?

is it for ubuntu server or desktop?

do i need any other packages before running this script?
thanks for your time

@tortura
Copy link

tortura commented Mar 31, 2012

ive got it run on debian, its working, i had some problems, but its running now, for the answer

@jbraeuer
Copy link
Author

jbraeuer commented Mar 31, 2012 via email

@tortura
Copy link

tortura commented Mar 31, 2012

first : python 3.2 won't work on debian

and then some graphite dependencies

now while its running, is there a chance to insert data via java, c , python or script, i just didn't get it clearly, its logging things i didn't ask to like all the stuff in carbon->agents->....

thanks

@jbraeuer
Copy link
Author

jbraeuer commented Apr 1, 2012 via email

@tortura
Copy link

tortura commented Apr 1, 2012

i am newb, where can i find an example please?

PORT=2003
SERVER=graphite.your.org
echo "local.random.diceroll 4 date +%s" | nc ${SERVER} ${PORT};

do i open socket in java ? and just send a string ? :D
i am working on it, but a help to find a solution faster would be great
thanks

@jbraeuer
Copy link
Author

jbraeuer commented Apr 1, 2012 via email

@tortura
Copy link

tortura commented Apr 1, 2012

well i misunderstood the documentation, my fault, if i am right now it will be working soon

i´d still love to have some good advises

@rflopsy
Copy link

rflopsy commented Dec 15, 2014

I installed graphite on Ubuntu 14.04. I started carbon and apache2 but not getting any GUI, any ideas ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment