docker_practice/coreos/quickstart.md

86 lines
2.1 KiB
Go
Raw Normal View History

# CoreOS
2015-09-28 09:33:45 +00:00
使 Vagrant
2015-09-28 09:33:45 +00:00
*Vagrant 使*
2015-09-28 09:33:45 +00:00
CoreOS CoreOS
2015-09-28 09:33:45 +00:00
2017-11-22 03:22:57 +00:00
##
2015-09-28 09:33:45 +00:00
Virtualbox, Vagrant git
2015-09-28 09:33:45 +00:00
2017-11-22 03:22:57 +00:00
##
2015-09-28 09:33:45 +00:00
CoreOS
2015-09-28 09:33:45 +00:00
2017-11-22 03:13:23 +00:00
```bash
$ git clone https://github.com/coreos/coreos-vagrant
$ cd coreos-vagrant
$ cp user-data.sample user-data
2015-09-28 09:33:45 +00:00
```
token
2015-09-28 09:33:45 +00:00
2017-11-22 03:13:23 +00:00
```bash
$ curl https://discovery.etcd.io/new
2015-09-28 09:33:45 +00:00
```
token user-data
2015-09-28 09:33:45 +00:00
2017-11-22 03:13:23 +00:00
```yml
2015-09-28 09:33:45 +00:00
#cloud-config
coreos:
etcd:
discovery: https://discovery.etcd.io/<token>
```
2017-11-22 03:22:57 +00:00
##
2015-09-28 09:33:45 +00:00
CoreOS Vagrantfile
config.rb.sample .
2015-09-28 09:33:45 +00:00
2017-11-22 03:13:23 +00:00
```bash
2015-09-28 09:33:45 +00:00
cp config.rb.sample config.rb
```
num_instances3
2015-09-28 09:33:45 +00:00
2017-11-22 03:13:23 +00:00
```bash
2015-09-28 09:33:45 +00:00
vagrant up
=>
Bringing machine 'core-01' up with 'virtualbox' provider...
Bringing machine 'core-02' up with 'virtualbox' provider...
Bringing machine 'core-03' up with 'virtualbox' provider...
==> core-01: Box 'coreos-alpha' could not be found. Attempting to find and install...
core-01: Box Provider: virtualbox
core-01: Box Version: >= 0
==> core-01: Adding box 'coreos-alpha' (v0) for provider: virtualbox
core-01: Downloading: http://storage.core-os.net/coreos/amd64-usr/alpha/coreos_production_vagrant.box
core-01: Progress: 46% (Rate: 6105k/s, Estimated time remaining: 0:00:16)
```
ssh
2015-09-28 09:33:45 +00:00
2017-11-22 03:13:23 +00:00
```bash
2015-09-28 09:33:45 +00:00
ssh-add ~/.vagrant.d/insecure_private_key
```
2017-11-22 03:13:23 +00:00
```bash
2015-09-28 09:33:45 +00:00
vagrant ssh core-01 -- -A
```