Skip to content

Instantly share code, notes, and snippets.

@dpeek
Last active December 10, 2018 23:48
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dpeek/eaa9a612451987aaf7bd84e07494c0cb to your computer and use it in GitHub Desktop.
Save dpeek/eaa9a612451987aaf7bd84e07494c0cb to your computer and use it in GitHub Desktop.
Install Go and Dgraph on AWS ubuntu AMI and run as service
#!/bin/bash
# install dgraph
sudo apt-get update -y
sudo apt-get install -y gcc
curl https://get.dgraph.io -sSf | bash
# create dgraph.service
sudo bash -c 'cat << EOF > /etc/systemd/system/dgraph.service
[Unit]
Description=dgraph
[Service]
ExecStart=/usr/local/bin/dgraph -w /home/ubuntu/dgraph/w -p /home/ubuntu/dgraph/p -bindall
Restart=always
User=ubuntu
[Install]
WantedBy=multi-user.target
EOF'
# enable and start dgraph service
sudo systemctl enable dgraph.service
sudo systemctl start dgraph.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment