neverlock
10/28/2016 - 11:54 AM

docker3k.sh

#!/bin/bash
echo "net.ipv4.neigh.default.gc_thresh1 = 30000" >> /etc/sysctl.conf
echo "net.ipv4.neigh.default.gc_thresh2 = 32000" >> /etc/sysctl.conf
echo "net.ipv4.neigh.default.gc_thresh3 = 32768" >> /etc/sysctl.conf
sysctl -p
#!/bin/bash
cat init_config | curl -XPOST --unix-socket /var/run/docker.sock -H "Content-Type: application/json" -d @- http:/swarm/init
#!/bin/bash
tee /root/init_config <<EOF
{
  "ListenAddr": "0.0.0.0:2377",
  "AdvertiseAddr": "$1:2377",
  "ForceNewCluster": true,
  "Spec": {
    "Orchestration": {},
    "Raft": { "KeepOldSnapshots": 1000000 },
    "Dispatcher": {},
    "CAConfig": {}
  }
}
EOF