← Back to team overview

graphite-dev team mailing list archive

[Question #288727]: Building Graphite & dependencies from source without pip, yum, CPAN and other automation tools

 

New question #288727 on Graphite:
https://answers.launchpad.net/graphite/+question/288727

This is not a question - it is a howto guide for building Graphite without automated package tools.

How to build Graphite and its dependencies from source without pip, yum, CPAN and other automation tools.

I work in a development environment that is very limited in connectivity and requires that linux software packages be as contained as possible off of /opt. I can't just upgrade existing or install new perl and python modules into the system perl and python directories because that may cause other software on the server to break. Also, we have very locked down proxied internet access that requires authentication and pretty much works for desktop web browsers only. Because of these restrictions, using automated package management tools like pip, yum, and "perl -MCPAN -e shell" to obtain and install packages just plain doesn't work on my linux servers. I wanted to try out Graphite, so I spent many hours figuring out what versions of each source package I needed and how to configure/make/install each one in the right order. The instructions below will put everything in /opt/graphite. 

My base system is RHEL6 but these instructions should work reasonably well on most up to date linux systems.

As root, create /opt/graphite and give the ownership of the dir to the userid that will own/maintain/run graphite. In this example, my graphite userid is called nmsuser.

cd /opt
mkdir graphite
chown nmsuser.users graphite

Exit your root shell and switch over to the nmsuser id and create a tgz dir for all of your source packages.

su - nmsuser
mkdir /opt/graphite/tgz

Create a file named 00-build-vars.sh in /opt/graphite/tgz with the following lines in it:
#
#
#### 00-build-vars.sh – helpful env vars for building graphite and its dependencies
PYTHONPATH=/opt/graphite/bin:/opt/graphite/:/opt/graphite/lib64/python2.6/site-packages/:/opt/graphite/lib/python2.6/site-packages/
export PYTHONPATH
BUILD_DIR=/opt/graphite/tgz
export BUILD_DIR
INSTALL_DIR=/opt/graphite
export INSTALL_DIR
PATH=/opt/graphite/bin:$PATH
export PATH=$INSTALL_DIR/bin:$PATH
export LDFLAGS="-L${INSTALL_DIR}/lib"
export CPPFLAGS="-I/opt/graphite/include -I/opt/graphite/include/python2.6"
export MAKE=make
export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config
#### end of 00-build-vars.sh

Save that file, and source it by typing…

. /opt/graphite/tgz/00-build-vars.sh

…on a line by itself. There will be no output from this command.

Now you are ready to download and build all the source packages. The list of source packages below is what worked for me and I strongly suggest you stick to these versions of these packages. I spent a considerable amount of time fooling around with other (usually more recent) versions of some of these packages and beat my head against problems that turned out to be version specific issues that lead to dependency breakage.

It is also very important to build these packages in the order listed below because many of the later source packages require libraries, header files, etc. from the earlier packages.

So download each tar.gz or zip file below and execute configure/make/build/install. For things like pkg-config, perl, python, and net-snmp, pay special attention to the configure directives. It took me quite some time and a lot of forum reading to get all of these right.

tar –zxvf pkg-config-0.28.tar.gz
cd pkg-config-0.28
./configure --prefix=/opt/graphite/ --with-internal-glib
make
make install
cd ..

tar -zxvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure --prefix=/opt/graphite/
make
make install
cd ..

tar -zxvf libpng-1.6.21.tar.gz
cd libpng-1.6.21
./configure --prefix=/opt/graphite/
make
make install
cd ..

tar -zxvf pixman-0.34.0.tar.gz
cd pixman-0.34.0
./configure --prefix=/opt/graphite/
make
make install
cd ..

tar -zxvf freetype-2.3.5.tar.gz
cd freetype-2.3.5
./configure --prefix=/opt/graphite/
make
make install
cd ..

tar –zxvf libxml2-2.6.32.tar.gz
cd libxml2-2.6.32
./configure --prefix=/opt/graphite/
make
make install
cd ..

tar –zxvf fontconfig-2.4.2.tar.gzc
cd fontconfig-2.4.2
./configure --prefix=/opt/graphite/
make
make install
cd ..

tar –zxvf cairo-1.14.6.tar.gz
cd cairo-1.14.6
./configure --prefix=/opt/graphite/
make
make install
cd ..

tar –zxvf httpd-2.2.31.tar.gz
cd httpd-2.2.31
./configure --prefix=/opt/graphite/
make
make install
cd ..

tar –zxvf perl-5.22.1.tar.gz
cd perl-5.22.1
CFLAGS='-m64 -mtune=nocona' ./Configure -des -Dusershrplib -Dprefix=/opt/graphite -A ccflags=-fPIC
make
make install
cd ..

tar –zxvf Python-2.6.6.tgz
cd Python-2.6.6
./configure --prefix=/opt/graphite/ --enable-shared
make
make install
cd ..

tar –zxvf mod_wsgi-3.4.tar.gz
cd mod_wsgi-3.4
./configure --prefix=/opt/graphite/
make
make install
cd ..

tar –zxvf django-1.4.22.tar.gz
cd django-1.4.22
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf libevent-2.0.22-stable.tar.gz
cd libevent-2.0.22-stable
./configure --prefix=opt/graphite
make
make install
cd ..

tar –zxvf memcached-1.4.25.tar.gz
cd memcached-1.4.25
./configure --prefix=opt/graphite
make
make install
cd ..

tar –zxvf zope.interface-4.1.3.tar.gz
cd zope.interface-4.1.3
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf setuptools-20.2.2.tar.gz
cd setup-tools-20.2.2
python setup.py install –prefix=/opt/graphite
cd ..

tar –zxvf Twisted-12.0.0.tar.gz
cd Twisted-12.0.0
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf py2cairo-1.10.0.tar.gz
cd py2cairo-1.10.0
./waf configure --prefix=/opt/graphite/
./waf build
./waf build install
cd ..

tar –zxvf django-tagging-0.3.1.zip
cd django-tagging-0.3.1
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf sqlite_2.8.17.orig.tar.gz
cd sqlite_2.8.17.orig
./configure --prefix=opt/graphite
make
make install
cd ..

tar –zxvf sqlite-autoconf-3110100.tar.gz
cd sqlite-autoconf-3110100
./configure --prefix=opt/graphite
make
make install
cd ..

tar –zxvf whitenoise-2.0.6.tar.gz
cd whitenoise-2.0.6
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf pysqlite-2.6.3.tar.gz
cd pysqlite-2.6.3
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf txAMQP-0.6.2.tar.gz
cd txAMQP-0.6.2
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf six-1.9.0.tar.gz
cd six-1.9.0.tar
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf python-memcached-1.57.tar.gz 
cd python-memcached-1.57
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf argparse-1.4.0.tar.gz
cd argparse-1.4.0
python setup.py install --prefix=/opt/graphite/
cd ..

unzip net-snmp-5.7.3.zip
cd net-snmp-5.7.3
./configure --prefix=/opt/graphite/ --with-python-modules --with-perl-modules
You will now be asked for some info by the net-snmp configure script. Just take the defaults. We aren't going to actually run the system's SNMP daemon from /opt/graphite/bin, we just need net-snmp libraries to build the perl SNMP modules.
make
make install
cd ..

tar –zxvf SNMP-Multi-2.1.tar.gz
cd SNMP-Multi-2.1
perl Makefile.PL
make
make install
cd ..

tar –zxvf YAML-1.15.tar.gz
cd YAML-1.15
perl Makefile.PL
make
make install
cd ..

tar –zxvf Log-Log4perl-1.46.tar.gz
cd Log-Log4perl-1.46
perl Makefile.PL
make
make install
cd ..

tar –zxvf Parallel-ForkManager-1.17.tar.gz
cd Parallel-ForkManager-1.17
perl Makefile.PL
make
make install
cd ..

tar –zxvf Module-Build-0.4216.tar.gz
cd Module-Build-0.4216
perl Makefile.PL
make
make install
cd ..

tar –zxvf Python-Serialise-Pickle-0.01.tar.gz
cd Python-Serialise-Pickle-0.01
perl Makefile.PL
make
make install
cd ..

tar –zxvf carbon-0.9.15.tar.gz
cd carbon-0.9.15
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf graphite-web-0.9.15.tar.gz
cd graphite-web-0.9.15
python check-dependencies.py
At this stage you should pass all of the dependency checks except LDAP. If you want LDAP authentication support you will have to deal with python-ldap and its dependencies. LDAP has a fairly lengthy chain of dependencies like OpenLDAP and GNUTLS which each have even more dependencies. For now I don't want to deal with all that so I'm skipping LDAP support.
If you are happy with the dependency check results, make sure you are still in the graphite-web-0.9.15 dir and execute…
python setup.py install --prefix=/opt/graphite/
cd ..

tar –zxvf whisper-0.9.15.tar.gz
cd whisper-0.9.15
python setup.py install --prefix=/opt/graphite/
cd ..


Now, go here… 
http://graphite.readthedocs.org/en/latest/install.html#initial-configuration
…to configure the components, start up the system, view log files, etc. 


Happy Graphit'ing and I hope this info is helpful and time saving to someone.



-- 
You received this question notification because your team graphite-dev
is an answer contact for Graphite.