Skip to content

Instantly share code, notes, and snippets.

@Pitastic
Last active January 8, 2023 20:02
Show Gist options
  • Save Pitastic/ed373bb51150b50e67b3c9569051517e to your computer and use it in GitHub Desktop.
Save Pitastic/ed373bb51150b50e67b3c9569051517e to your computer and use it in GitHub Desktop.
Build Influx > v2.0 and Grafana v9 under FreeBSD (tested on 13.1)

Thanks to this issue and @phaethon . I just split up the commands into two seperated scripts and bumped the Influx version.

gmake test will return errors about InfluxQL tests. I don't know how bad this is...

Install Command

chmod a+x requirements.sh
chmod a+x install.sh
./requirements.sh && ./install.sh

# Copy influxd into /etc/rc.d/
chmod a+x /etc/rc.d/influxd
sysrc influxd_enable="YES"

sysrc grafana_enable="YES"

# Cleanup (optional)
rm -rf /tmp/influxd
rm -rf /tmp/influx-cli

The logfile from InfluxDB is located at /var/log/influxd.log. Grafana configs are available in usr/local/etc/grafana.

Configurte InfluxDB and Grafana to your needs.

#!/bin/sh
. /etc/rc.subr
name=influxd
rcvar=influxd_enable
start_cmd="${name}_start"
stop_cmd=":"
load_rc_config $name
influxd_start()
{
/usr/local/bin/influxd --reporting-disabled >> /var/log/influxd.log 2>&1 &
}
run_rc_command "$1"
#!/usr/local/bin/bash
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
source /root/.gvm/scripts/gvm
gvm install go1.18 -b
gvm use go1.18
export PATH=$PATH:/root/go/bin
cd /tmp
git clone https://github.com/influxdata/influxdb.git --branch v2.6.0 --single-branch
git clone https://github.com/influxdata/influx-cli.git --branch v2.6.0 --single-branch
cd influx-cli
gmake
cd ../influxdb
find . -name *.proto -exec sed -i .bkp 's$^option go_package = ".;$option go_package = "./;$' \{\} \;
find . -name *.proto.bkp -exec rm \{\} \;
gmake
#gmake test
cp -a /tmp/influxdb/bin/freebsd/influxd /usr/local/bin/influxd
cp -a /tmp/influx-cli/bin/freebsd/influx /usr/local/bin/influx
#!/bin/sh
pkg --version -y
pkg install -y nano git gmake go rust pkgconf goprotobuf bash bison gcc grafana9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment