Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Use ISO document production OpenStack used CoreOS mirror     - 29 practical examples Linux system / network administrator of nmap (Linux)

- How do I upgrade to Ubuntu 15.04 (Beta) (Linux)

- Oracle PL / SQL selective basis (IF CASE), (LOOP WHILE FOR) (Database)

- Integrated security administrator Linux accident management (Linux)

- Use Git in Eclipse (Linux)

- Use Pylint regulate your Python code (Programming)

- Linux remote connectivity tools -OpenSSH (Linux)

- PostgreSQL 9.3.5 database installation under Ubuntu Server 14.04 (Database)

- Based Docker build stand-alone high-availability cluster Hadoop2.7.1 Spark1.7 (Server)

- Linux System Getting Started Learning: Disable Ubuntu Apport internal error reporting procedures (Linux)

- Use a soft Raid play multiple SSD hard drive performance and enhance data security (Linux)

- Java JDK has been able to compile without warning (Programming)

- WebLogic administrator account and reset the password (Database)

- Hadoop2.0 configuration yarn success (Server)

- Nginx Performance Tuning Guidelines (Server)

- Hadoop1.2.1 plug compilation (Server)

- Rails 4.1.6 start being given Could not find a JavaScript runtime (Linux)

- Shell scripts quickly deploy Tomcat project (Server)

- Linux rights management (Linux)

- Redis-2.8.17 installation and configuration process some errors (Linux)

 
         
  Use ISO document production OpenStack used CoreOS mirror
     
  Add Date : 2017-01-08      
         
         
         
  This article is the use of CoreOS ISO image file manually make files qcow2 openstack used on the CoreOS introduction, can be seen here

Use server: CentOS6.5

1. Download CoreOS Mirror (444.5.0 version)

You may require FQ

#coreOS installation file
# The following two files during the installation process, coreOS will automatically download, but due to the network, the download can be time consuming, so here is downloaded in advance (you may need to use a proxy to download)
wget http://stable.release.core-os.net/amd64-usr/444.5.0/coreos_production_image.bin.bz2
wget http://stable.release.core-os.net/amd64-usr/444.5.0/coreos_production_image.bin.bz2.sig

#iso image file
# Use this ISO image file creating
wget http://stable.release.core-os.net/amd64-usr/444.5.0/coreos_production_iso_image.iso

2. Create a virtual disk

# Virtual machine to install coreOS on this disk
qemu-img create -f qcow2 coreOS_v1.qcow2 20G
# After the step we will use the downloaded ISO file to install a virtual machine on this disk, and then through a custom configuration, virtual disk qcow2 this format is that we will eventually need a virtual machine image

3. Use the virt-install tool installation (from CD to boot the system) from the ISO file

virt-install -n core -r 1024 -c /data_lij/coreOS/coreos_production_iso_image.iso --disk path = / data / coreOS / coreos_test.qcow2, device = disk, bus = virtio, size = 5, format = qcow2 - vnc --vncport = 5900 --vnclisten = 0.0.0.0 -v

-n: name of the virtual machine
-r: allocate memory
-c: use ISO files
--disk: Setup Disk
-vnc: using a remote connection vnc
--vncport: vnc client access port

As used herein, the virt-install tool, as well as remote connection vnc

4. Set the cloud-config

cloud-config description:

CoreOS allows you to declaratively customize various OS-level items, such as network configuration, user accounts, and systemd units. This document describes the full list of items we can configure. The coreos-cloudinit program uses these files as it configures the OS after startup or during runtime.

Your cloud-config is processed during each boot. Invalid cloud-config will not be processed but will be logged in the journal. You can validate your cloud-config with the CoreOS validator or by running coreos-cloudinit -validate

Since coreOS default key landing, so we must find a way to inject a public key to a virtual machine, so the production out of the image that we can use to access key

The simplest cloud-config.yaml ssh_authorized_keys include only one field for key injection

Create a cloud-config.yaml file, ssh-rsa later pasting need to inject public key

shell> cat cloud-config.yaml
# Cloud-config

ssh_authorized_keys:
  - Ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g + ZTxC7weoIJLUafOgrm + h ...

5. Install coreOS to a virtual disk

Clients use vnc viewer tool to connect the virtual machine, the system is currently running we downloaded ISO image coreos_production_iso_image.iso, different from the centos system can be installed directly to disk, for coreOS, we need to use this ISO provides installation tool coreos-install go install coreOS to disk

Note: Run the following command coreos-install program will automatically download and install, but it is easy to download an error, it is best to use a local step 6 download method

coreos-install -d / dev / vda -C stable -V 444.5.0 -c cloud-config.yaml

# -d: Parameter specifies the installation disk, in this second step to create a virtual disk
# -C: Use version, stable stable version
# -V: CoreOS system version you want to install, coreos-install the specified version will be based here Quguan network to download the appropriate version of the installer
# -c: Cloud-config configuration file to specify a start can be performed after, for injecting the key

6. Use locally installed files

After executing step installation command, coreos-install will automatically invoke the following command to download the required installation files, and automatically installs

wget http://stable.release.core-os.net/amd64-usr/444.5.0/coreos_production_image.bin.bz2
wget http://stable.release.core-os.net/amd64-usr/444.5.0/coreos_production_image.bin.bz2.sig

Due to the network, the download may not be successful, or download very slow, so that we can set coreos-install download from the local address instead of downloading from the official website, which saves time

All we need to do is put this address: http: //stable.release.core-os.net/amd64-usr/444.5.0 replaced with a local address that can be accessed (self-built web server)

6.1 first need to set resolution, which allows stable.release.core-os.net resolves to local IP

echo "192.168.11.166 stable.release.core-os.net" >> / etc / hosts

6.2 The following configuration of a web host instead of the official website address

# In addition we need to use a virtual machine, set up a web server on which alternative http://stable.release.core-os.net/amd64-usr/444.5.0 this address, assuming its IP is 192.168.11.166

# Create a directory structure

mkdir /data/coreos/amd64-usr/444.5.0 -p
cd /data/coreos/amd64-usr/444.5.0

Step # Copy the downloaded installation file to catalog
cp coreos_production_image.bin.bz2 coreos_production_image.bin.bz2.sig.

# Into the / data / coreos directory using python http start a service, which is the root directory run python
cd / data / coreos
python -m SimpleHTTPServer 80 (This command creates a new web server and run the command directory as the web root directory)

6.3 Test web server

After the above two steps, now access http://stable.release.core-os.net/amd64-usr/444.5.0 on the server will be resolved to our self-built http host (192.168.11.166) up

Coreos-install 6.4 now can use a local installation file, and re-execute the following command to install the virtual machine

coreos-install -d / dev / vda -C stable -V 444.5.0 -c cloud-config.yaml

7. The boot script cloud-init

After installation is complete, in order that it can obtain the host name, keys, etc. from openstack, you need to add a start-up script

New cloudinit.sh

#! / Bin / bash

#get the env
export PATH = / usr / local / sbin: / usr / local / bin: / usr / sbin: / usr / bin: / sbin: / bin: / opt / bin

STATUS_CODE = `curl -I -m 10 -o / dev / null -s -w% {http_code} http: // 169.254.169.254 / latest`
if [! "$ STATUS_CODE" -eq "200"]; then
    / Bin / sleep 3
fi

# Set the root password using user data
STATUS_CODE = `curl -I -m 10 -o / dev / null -s -w% {http_code} http: // 169.254.169.254 / latest / user-data`
if [ "$ STATUS_CODE" -eq "200"]; then
    PASS = `curl -m 10 -s http://169.254.169.254/latest/user-data | awk -F '"' '{for (i = 1; i <= NF; i ++) {if ($ i ~ / password /) print $ (i + 2)}} ' `
    if [ "$ PASS" = ""!]; then
    / Usr / bin / echo "root: $ {PASS}"> tmp.txt
    / Usr / sbin / chpasswd     rm -f tmp.txt
    fi
fi

# Set the hostname using the meta-data service
STATUS_CODE = `curl -I -m 10 -o / dev / null -s -w% {http_code} http: // 169.254.169.254 / latest / meta-data / hostname`
if [ "$ STATUS_CODE" -eq "200"]; then
    curl -f http://169.254.169.254/latest/meta-data/hostname> / tmp / metadata-hostname 2> / dev / null
    if [$ -eq 0?]; then
        TEMP_HOST = `cat / tmp / metadata-hostname | awk -F '.novalocal' '{print $ 1}'`
        / Usr / bin / hostnamectl set-hostname $ {TEMP_HOST}
        / Usr / bin / hostname $ TEMP_HOST
        rm -f / tmp / metadata-hostname
    fi
fi

# Get the user ssh key using the meta-data service
STATUS_CODE = `curl -I -m 10 -o / dev / null -s -w% {http_code} http: // 169.254.169.254 / latest / meta-data / public-keys / 0 / openssh-key`
if [ "$ STATUS_CODE" -eq "200"]; then
    mkdir -p /root/.ssh
    / Usr / bin / echo >> /root/.ssh/authorized_keys
    curl -m 10 -s http://169.254.169.254/latest/meta-data/public-keys/0/openssh-key | grep 'ssh-rsa' >> /root/.ssh/authorized_keys
    chmod 0700 /root/.ssh
    chmod 0600 /root/.ssh/authorized_keys
fi

8. Set the boot

coreOS use systemd manage startup items, the information about systemd

Create a new boot configuration file cloudinit.service

cd / etc / systemd / system
#cat cloudinit.service
[Unit]
Description = OpenStack nova
Requires = coreos-setup-environment.service
After = coreos-setup-environment.service
Before = user-config.target

[Service]
Type = oneshot
RemainAfterExit = yes
EnvironmentFile = - / etc / environment
ExecStart = / usr / bin / bash /etc/cloud-init.sh # execute script file cloud-init.sh

[Install]
WantedBy = multi-user.target

# Added systemd management (setting the boot)

systemctl enable cloudinit.service

# After the execution enable, cloudinit.service the service will start-up, so we can execute scripts cloud-init.sh

# Verify cloudinit.service service is set to boot

systemctl is-enabled cloudinit
     
         
         
         
  More:      
 
- Install the Solaris 10 operating system environment over the network to sparc (Linux)
- OS X CAOpenGLLayer how to enable OpenGL 3.2 core profile (Programming)
- Git uses a small mind (Linux)
- Acquaintance C ++: the most simple C ++ program (Programming)
- CentOS 6.6 compile and install phpMyAdmin configuration PostgreSQL9.4.1 (Database)
- Ubuntu 14.04 to install file editor KKEdit 0.1.5 version (Linux)
- HTTP and FTP TCP-FLOOD CC Attacks Analysis and Prevention solutions under CentOS 6.5 (Linux)
- Extended VMware Ubuntu root partition size (Linux)
- shellinabox: one uses AJAX Web-based terminal emulator (Linux)
- Linux Apache server configure to protect system security (Linux)
- About Python default character set (Linux)
- Linux itself disguised illusion strengthen security (Linux)
- The most common and most effective security settings under linux (Linux)
- CentOS 6.4 dial-up Raiders (Linux)
- Ubuntu 14.04 compile RT288x_SDK / toolchain / squashfs3.2-r2 Error (Linux)
- SQL Server automatic backup script (Database)
- OpenStack package problems and solutions under CentOS6 (Linux)
- Intrusion analysis and prevention tools Knark under Linux platform (Linux)
- How to configure HTTP Strict Transport Security (HSTS) (Linux)
- Some security configuration of Linux systems (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.