Skip to content

Instantly share code, notes, and snippets.

@ricsiga
Last active April 5, 2017 15:14
Show Gist options
  • Save ricsiga/64bd2119e44cf0236b9ca8b99848f167 to your computer and use it in GitHub Desktop.
Save ricsiga/64bd2119e44cf0236b9ca8b99848f167 to your computer and use it in GitHub Desktop.
Build and install latest netdata (https://my-netdata.io/)
Build latest netdata in docker container:
  1. docker build -t build-netdata . --no-cache=true
  2. docker run build-netdata:latest
  3. docker cp $(docker ps -a | grep "build-netdata:latest" | cut -d " " -f1):/opt/netdata .
  4. docker rm $(docker ps -a | grep "build-netdata:latest" | cut -d " " -f1)
  5. docker rmi build-netdata:latest
Copy netdata to destination server:
  1. tar czf netdata.tgz netdata/
  2. scp netdata.tgz user@server:
  3. rm -rf netdata*
Run these commands on the server:
  1. sudo addgroup --system --gid 999 netdata
  2. sudo adduser --system --uid 999 --gid 999 --no-create-home --shell /usr/sbin/nologin netdata
  3. sudo usermod -G adm netdata
  4. tar xzf netdata.tgz
  5. sudo mv netdata /opt/
  6. sudo chown -R root:root /opt/netdata
  7. sudo chown -R netdata:netdata /opt/netdata/var/cache/netdata /opt/netdata/var/lib/netdata /opt/netdata/var/log/netdata /opt/netdata/etc/netdata /opt/netdata/usr/share/netdata/web
  8. sudo cp /opt/netdata/etc/netdata.service /etc/systemd/system/
  9. sudo systemctl enable netdata
  10. sudo systemctl start netdata
FROM ubuntu:16.04
# System upgrade
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get upgrade -y
# Install packages and build netdata
RUN apt-get install -y zlib1g-dev uuid-dev libmnl-dev gcc make git autoconf autoconf-archive autogen automake pkg-config curl
RUN git clone https://github.com/firehol/netdata.git --depth=1
RUN cd netdata; ./netdata-installer.sh --install /opt
RUN cp /netdata/system/netdata.service /opt/netdata/etc/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment