Open7
nomad on oci
sudo apt update
sudo apt install docker.io
export IP=192.168.0.30
hashi-up nomad install \
--ssh-target-addr $IP \
--ssh-target-user ubuntu \
--server \
--ssh-target-key ~/.ssh/id_rsa
$ sudo cat /etc/nomad.d/nomad.hcl
datacenter = "dc1"
data_dir = "/opt/nomad"
server {
enabled = true
bootstrap_expect = 1
}
client {
enabled = true
servers = ["127.0.0.1:4646"]
}
plugin "raw_exec" {
config {
enabled = true
}
}
plugin "docker" {
config {
volumes {
enabled = true
selinuxlabel = "z"
}
}
}
WebGUIが見たいのでSSHトンネル。
ssh -N ubuntu@仮想マシンのグローバルIP -L <WSLのIPアドレス>:4646:仮想マシンのローカルIP:4646
% ssh -N ubuntu@仮想マシンのグローバルIP -L $(ip -4 --json addr show | jq -r '.[] | select(.ifname=="eth0").addr_info[].local'):4646:0.0.0.0:4646
export NOMAD_ADDR=http://$(ip -4 --json addr show | jq -r '.[] | select(.ifname=="eth0").addr_info[].local'):4646
nomad node status
git clone https://github.com/****
nomad job run database.nomad
これやっとく。
ログインするとコメントできます