VirtualBox on the hard drive installation CoreOS

Source: Internet
Author: User
Tags etcd

Url:

http://www.serfdom.cn/index.php/archives/4/

Http://www.360doc.com/content/14/1118/10/15077656_426071504.shtml

The installation process is cumbersome, if you just follow the official document installing CoreOS to Disk, download the ISO and start, you can only get a completely unable to log on the system, after each reboot will be initialized, because the ISO is only loaded in RAM. It needs to be installed on the hard drive. In this article I lead the cost of installing CoreOS on a VirtualBox virtual machine.

Step 1: Resolve FQ Issues

The installation process requires downloading the CoreOS image. I am in the Baidu Network disk to provide the installation process required all the files: Http://pan.baidu.com/s/1sjNSJFJ, so you need to do is to download the four files, and then put in a simple wget you can go to the location. For example, I was on the VirtualBox, virtual an Ubuntu, set the network as a bridge, assuming the IP is 192.168.1.130, then install a apache2, and put it under/var/www/html,

[email protected]:/var/www/html# ls 444.5.0 coreos-install coreos_production_image.bin.bz2 id_rsa.pub static.network cloud-config.yaml coreos-install2 coreos_production_image.bin.bz2.sig index.html

And then you do it on the other machine, and wget http://192.168.1.130/cloud-config.yaml if the download is no problem, then step one is done.

Step 2: Configure Cloud-config.yaml
安装过程中最重要的就是修改cloud-config.yaml。我在步骤一已经为大家提供了一个配置模板,大家需要修改的是`ssh-authorized-keys`对应的值。这个是你登录coreos的跳板机ssh的公钥,可以通过如下步骤简单的生成:
[email protected]:~# ssh-keygenenterenter...

The middle need to select the steps, all the default carriage is completed. Then 2 files are generated under the current user's ~/.ssh/ id_rsa id_rsa.pub , and the encrypted strings inside the id_rsa.pub are affixed to the ssh-authorized-keys corresponding values.
The second is to ensure that static.network the corresponding name and network are consistent with the Cloud-config.yaml. For example, my configuration:

#cloud-confighostname: coreos1coreos:  etcd:    addr: $private_ipv4:4001    peer-addr: $private_ipv4:7001  units:    - name: etcd.service      command: start    - name: fleet.service      command: start    - name: static.network      content: |        [Match]        Name=enp0s8        [Network]        Address=192.168.1.120/24        Gateway=192.168.1.254        DNS=8.8.8.8        DNS=8.8.4.4users:     - name: core         ssh-authorized-keys:     - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDrBCWmYcPhOtsTYtgM7pF4cv5apCP/LHW7ZMZUZO5AZHaDG61fXGmgFc5Sy8t9yRV40/QLGE1BcwRiGVxx1ChPRzFB9/qSzxyzfErt0WGys44ly/d1KvKFNEhZif0hMtKcfGwntI8pILeaRX8pDK6Vct2u3oabPgvFZJZUUCcjv4Sf8ROjV9E8BVjtQNv7iNwgsDEP+Sgdhq/bsR+Nhcp6VX49rbT S+jEuAu+6EwvfU0ICv6S0txZn3x1W9b4XG9YfusRXNocNmtPjFsOCpL2hFwJk8mhorQFBLymOttzNcsW6WxuPyLScAbbrQBmgf/ej8GWw61fwKWba77acBNFt [email protected] st     - groups:         - sudo         - docker
Step 3: Install

In VirtualBox create a new virtual machine, network connection mode: Bridge network card, and then storage "Storage Tree" Controller:ide "Add disc" select Disk Select the Coreos_production_iso_image.iso you just downloaded, Last Click Save
Start the virtual machine you just added, is a core account in the user environment, you can directly switch to root as follows

    • 1, wget Http://192.168.1.130/cloud-config.yaml, because it has been configured in front, so you do not need to modify (cluster environment, need to modify for different network configuration, modify IP, the same below)
    • 2, wget http://192.168.1.130/static.network, and
mv static.network  
    • 3, wget Http://192.168.1.130/coreos-install, modify the inside 207 lines of Base_url for you Apache2 machine IP, this way also has another benefit. You can also directly modify the base_url of the coreos-install that CoreOS comes with:
cp /usr/bin/coreos-install coreos-install chmod +x coreos-installvim 修改BASE_URL (简单点,没有sed了)
    • 4, installation,
./coreos-install -d /dev/sda -C stable -c ./cloud-config.yaml

If there is no accident, the successful installation of the English Balabala will be displayed.

    • 5, Login
      After the installation is complete, you need to verify that it is installed correctly on the disk. First stop the CoreOS virtual machine and then remove the ISO from the previous step from the settings "storage" controll IDC, and this time you are booting directly from the hard drive.
      Then start the virtual machine.
      After startup, if there are no surprises, it will appear:
...coreos1 login:this is coreos1

Then, switch to your springboard, ssh [email protected]

[email protected]:~$ ssh [email protected] Last login: Mon Dec 1 00:37:45 2014 from 192.168.1.130 CoreOS (stable) [email protected] ~ $

Installation Successful

Step 4: Modify Cloud-config.yaml again

If you are not satisfied with the current CoreOS configuration, then you can continue to modify it (and of course, local tyrants will choose to install directly from the new installation)

    • 1, Stop CoreOS, insert CoreOS ISO disc (step 3), and reboot
    • 2, modify
[[email protected] ~]$ sudo -i [[email protected]~]# mount -o subvol=root /dev/sda9 /mnt [[email protected] ~]# vim /mnt/var/lib/coreos-install/user_data
    • 3, stop the virtual machine, unplug the disc, start to see if your configuration is in effect.

VirtualBox on the hard drive installation CoreOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.