Skip to content

Instantly share code, notes, and snippets.

@ysdede
Last active November 25, 2023 19:32
Show Gist options
  • Save ysdede/a7f878f51fb9f4d84a7607d11996e182 to your computer and use it in GitHub Desktop.
Save ysdede/a7f878f51fb9f4d84a7607d11996e182 to your computer and use it in GitHub Desktop.
InfluxDB 2.x Open Source Time Series Database on wsl2
wget -qO- https://repos.influxdata.com/influxdb.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdb.gpg > /dev/null
export DISTRIB_ID=$(lsb_release -si); export DISTRIB_CODENAME=$(lsb_release -sc)
echo "deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list > /dev/null
sudo apt-get update && sudo apt-get install influxdb2
sudo chmod +x /etc/init.d/influxdb
sudo chown root:root /etc/init.d/influxdb
sudo update-rc.d influxdb defaults
sudo update-rc.d influxdb enable
sudo service influxdb start
@MurrMack
Copy link

Thanks for this - I had to go to the influxdb github and copy the etc/init.d/influxdb script as this did not install automatically for me in wsl2 (ubuntu 20.04)

@ysdede
Copy link
Author

ysdede commented Apr 27, 2022

Hey thanks for reporting.

@nmtinh86
Copy link

nmtinh86 commented May 10, 2022

I had a error when run this command on Ubuntu 20.04 LTS on WSL2 Windows 11
sudo chmod +x /etc/init.d/influxdb

chmod: cannot access '/etc/init.d/influxdb': No such file or directory

@ysdede
Copy link
Author

ysdede commented May 10, 2022

Hi you need influxdb init.d script as a user mentioned. https://gist.github.com/ysdede/a7f878f51fb9f4d84a7607d11996e182?permalink_comment_id=4048704#gistcomment-4048704

I am posting my init.d script form my wsl. I hope it helps.

https://gist.github.com/ysdede/124d629bc0fa1f92f8c9a529b68c557b

@nmtinh86
Copy link

Hi you need influxdb init.d script as a user mentioned. https://gist.github.com/ysdede/a7f878f51fb9f4d84a7607d11996e182?permalink_comment_id=4048704#gistcomment-4048704

I am posting my init.d script form my wsl. I hope it helps.

https://gist.github.com/ysdede/124d629bc0fa1f92f8c9a529b68c557b

Thanks, it's running

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