-
Notifications
You must be signed in to change notification settings - Fork 3
/
userdata.sh
32 lines (26 loc) · 879 Bytes
/
userdata.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# The userdata of each crawler node is
# #! /bin/bash
# wget -O - https://raw.githubusercontent.com/gmosley/boontorrent/master/userdata.sh | bash
# This ensures that our deployment process is uniform
# Make sure that we clone/run as ubuntu
su ubuntu
cd ~
# install dependencies
echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4
sudo apt update
sudo apt install -y make htop openjdk-8-jdk maven
# get the geocity database
# wget http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
# tar -zxvf GeoLite2-City.tar.gz
# cd `find GeoLite2-City_* | head -1`
# mv *.mmdb ~
# cd ~
# Get latest copy of mldht
git clone https://github.com/dylanmann/mldht.git
cd mldht
# build code
mvn package dependency:copy-dependencies appassembler:assemble && mvn antrun:run
# run daemon as root
cd work
(make 0<&- &>> out.log &) &