slinjing's Technical Blog

website·Indexed 29 days ago

https://slinjing.github.io/

A collection of technical guides and tutorials covering DevOps and system administration, including Docker, Kubernetes, MySQL 8.0, Prometheus, Harbor, Portainer, and Cloudpods. It also features guides on setting up static blogs using Jekyll (with Chirpy theme) and Hexo, as well as CentOS system configuration, PXE server deployment, and disk partitioning.

Tokens
21K
Snippets
170
Records
193
Agent score
72%

What's inside slinjing

  1. Understand the PXE network boot process

    PXE (Preboot Execution Environment) allows a client computer to boot from a remote server over a network. The process follows these steps:

    1. The PXE client sends a DHCP request for an IP address.
    2. The DHCP server assigns an IP and provides the TFTP server's IP address and the bootloader filename (e.g., pxelinux.0).
    3. The client requests the pxelinux.0 bootloader from the TFTP server.
    4. The TFTP server transfers the bootloader to the client.
    5. The client boots to the installation interface and requests OS installation files from a file sharing server (FTP, HTTP, or NFS).
    6. The file sharing server (e.g., vsftpd) transfers the installation files.
    7. The user completes the OS installation via the guided interface.
  2. Access and initialize Portainer

    After deployment, access the Portainer web interface at http://<host-ip>:9000. On the first login, you must create an administrator user and password. Once logged in, select the 'local' tab to view detailed information about the local Docker environment.
  3. Understand the PXE network booting process

    PXE (Preboot Execution Environment) allows a computer to boot and install an operating system over a network. The process follows these steps:

    1. DHCP Request: The client requests an IP address from the DHCP server.
    2. DHCP Response: The server assigns an IP and provides the TFTP server's IP address and the bootloader filename (e.g., pxelinux.0).
    3. Bootloader Retrieval: The client requests pxelinux.0 from the TFTP server.
    4. Bootloader Execution: The TFTP server sends the file, and the client boots to the installation interface.
    5. OS Image Retrieval: The client requests the actual OS installation files (CentOS/Windows) from a file sharing server (FTP, HTTP, or NFS).
    6. Installation: The file server transfers the installation files, and the user completes the OS installation via the setup wizard.
  4. Create callout prompts in Chirpy

    Use blockquotes combined with specific prompt classes to create styled callout boxes for tips, info, warnings, and danger alerts.
    > An example showing the `tip` type prompt. {: .prompt-tip }
    > An example showing the `info` type prompt. {: .prompt-info }
    > An example showing the `warning` type prompt. {: .prompt-warning }
    > An example showing the `danger` type prompt. {: .prompt-danger }
  5. Install Docker using automated script

    Docker provides a convenience script for automated installation. You can use the --mirror option to specify a domestic mirror (e.g., Aliyun) for faster downloads.
    curl -fsSL get.docker.com -o get-docker.sh
    sudo sh get-docker.sh --mirror Aliyun
  6. Install dependencies for Jekyll Chirpy

    After cloning your repository locally, run the bundle command in the project root to install dependencies. If the download speed is too slow, you can use a mirror source (e.g., ruby-china).
    bundle config mirror.https://rubygems.org https://gems.ruby-china.com
    bundle
  7. Install windows_exporter as a Windows Service

    Use the sc create command to register windows_exporter as a system service. The binpath parameter must point to the full directory path and filename of the .exe executable.
    sc create windows_exporter binpath= "D:\windows_exporter\windows_exporter-0.21.0-386.exe" type= own start= auto displayname= windows_exporter
  8. Deploy Cloudpods using the ocboot tool

    Cloudpods is deployed using the ocboot tool. You must clone the specific release branch, run the installation script with the target host IP, and then access the web interface using the default credentials (admin / admin@123).

    If the default package download is too slow, use the Aliyun mirror flag -m.

    # 1. Download ocboot tool
    git clone -b release/3.10 https://github.com/yunionio/ocboot && cd ./ocboot
    
    # 2. Run installation (replace <host_ip> with your node IP)
    ./run.py virt <host_ip>
    
    # Optional: Use Aliyun mirror if downloads are slow
    ./run.py -m https://mirrors.aliyun.com/pypi/simple/ virt <host_ip>
  9. Deploy Portainer using Docker Compose

    Portainer is a lightweight application that provides a graphical user interface for managing Docker environments (both single-node and cluster). To deploy Portainer, create a docker-compose.yml file with the service configuration and run the deployment command.
    version: '3.2'
    services:
      portainer:
        image: registry.cn-chengdu.aliyuncs.com/shulinjing/portainer-ce:latest
        container_name: portainer
        restart: always
        ports:
           - 8000:8000
           - 9000:9000
        volumes:
           - /var/run/docker.sock:/var/run/docker.sock
           - portainer_data:/data
    networks:
      portainer_net:
    volumes:
      portainer_data:
    docker-compose up -d
  10. Access and initialize Portainer

    After deploying Portainer, access the web interface at http://<host-ip>:9000. On the first login, you will be required to create an administrator username and password. Once logged in, select the 'local' tab to view detailed information about the local Docker environment.
  11. Install Jekyll prerequisites

    Jekyll is a static site generator that converts text into HTML, CSS, and JavaScript. To run Jekyll, the following dependencies must be installed on your system:

    • Ruby 2.5.0+
    • RubyGems
    • GCC and Make