git clone https://github.com/tkaburagi/various-workloads-on-nomad
- mkdir mysql-dump
- Create a S3 Bucket
- Replace
s3://mysql-dump-tkaburagi/
to your bucket name in thedump-mysql.sh
andinit.sh
. - Run Nomad on localhost
- An example of the server config
- An example of the client config
- Replace
172.20.10.4(for Docker MySQL IP)
to your network in all files. watch -d -t -n 1 'echo Inside MySQL && mysql -h 172.20.10.4 -u root -D handson -e "select * from animals"'
- Monitoring Terminals
watch -t -d -n 1 'echo "Nomad Job Status" && nomad job status | rev | cut -c 26- | rev'
watch -d -t -n 1 'echo AWS S3 Bucket && aws s3 ls mysql-dump-tkaburagi --region ap-northeast-1'
watch -d -t -n 1 'echo Inside MySQL && mysql -h 172.20.10.4 -u root -D handson -e "select * from animals"'
nomad job run mysql.hcl
- when the first time,
mysql -h ${MYSQL_HOST} -u root -prooooot -D handson -e "drop table if exists animals"
mysql -h ${MYSQL_HOST} -u root -prooooot -D handson -e "create table animals (animal varchar(100));"
- when the first time,
nomad job run ui-java.hcl
- Open the browser.
http://127.0.0.1:8080/
- Open the browser.
./insert-dog.sh
nomad job run parameterized-toupper.hcl
echo "cat" | nomad job dispatch r2-parameterized-toUpper -
nomad job run front-api-go.hcl
curl 127.0.0.1:8888/animal/pig
nomad job run periodic-backup.hcl
nomad job run periodic-curl.hcl
./init.sh