# coreos **Repository Path**: gitxman/coreos ## Basic Information - **Project Name**: coreos - **Description**: 安装coreos - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 14 - **Created**: 2015-08-25 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 安装CoreOS > CoreOS 介绍 2014年7月底,CoreOS官方发布号称Production Ready的稳定版本。 CoreOS设计理念非常nice,但国内对于CoreOS系统的资料很少,固写这篇文章 ### - 系统更新周期短 - 双root分区 - 服务器发现 - 集群管理 - 默认支持docker(为docker而生的操作系统) ## 安装需求 1. 系统启动光盘 2. 一台web server(nginx\apache) 3. cloud-config.yaml文件(非常重要) 4. ssh公钥/私钥 光看官方说明,安装过程说的不是很明确,在安装过程中,我也踩了不少坑,借此篇文章分享一下 #####事先准备好ssh密钥,已方便编写cloud-config.yaml文件,来安装CoreOS系统 - 生成ssh密钥,使用PuttyGen - 公钥写到cloud-config.yaml文件中,私钥用来ssh登录CoreOS系统 #####准备cloud-config.yaml文件 CoreOS系统安装哪些服务,从这个文件中都可以一目了然 文件内容查看:[cloud-config.yaml](https://git.oschina.net/dockerf/coreos/blob/master/cloud-config.yaml) #####因为coreos服务器是在国外,安装CoreOS的时候,需提前把安装CoreOS的软件包下载到自己的web server上,在安装CoreOS系统的时候,能下载到这些包: - coreos_production_image.bin.bz2 - coreos_production_image.bin.bz2.DIGESTS.sig - coreos_production_image.bin.bz2.sig #####插入系统启动光盘,启动服务器,开始加载系统镜像,直到启动成功。 > 系统加载在内存中,需要执行安装脚本,把系统安装到硬盘中 #####配置网络,使得能让服务器访问网络(参考cloud-config.yaml文件中网络部分) #####假如web server上放有cloud-config.yaml和安装CoreOS的软件包 # wget http://your_server/cloud-config.yaml # sudo cp /usr/bin/coreos-install ./ # vim coreos-install 把:BASE_URL="http://${CHANNEL_ID}.release.core-os.net/amd64-usr" 改为:BASE_URL="http://YOUR_SERVER_URL" 以上工作做完后就万事俱备了,开始把CoreOS安装到硬盘上 [core@server ~]$ sudo coreos-install -d /dev/sda -C stable -c ./cloud-config.yaml ###### - -d 指定目标设备 - -C 指定版本 alpha/beta/stable - -c 指定配置文件 如无意外,安装完后就可以启动,并登录了。 ssh core@192.168.1.100 #####如果安装失败,可以重新用系统启动盘引导 [core@server ~]$ sudo -i [root@server ~]# mount -o subvol=root /dev/sda9 /mnt [root@server ~]# vim /mnt/var/lib/coreos-install/user_data 修改完毕后,重新启动! 下篇讲CoreOS集群安装!