跳到主要内容

手动安装部署示例

这里以 CentOS 7.9 服务器为例,麒麟V10 X86、华为欧拉可以直接使用;Debian系列区别有注明区别,有问题欢迎及时反馈

一、环境准备

  1. 准备一台 Linux 服务器,最低配置要求:8核、24G内存、40G数据盘(系统盘除外),更多推荐 ,确保 88803888038881 端口不被占用

  2. 使用 root 用户登录服务器

  3. 关闭 Firewalld

    systemctl stop firewalld && systemctl disable firewalld
  4. 关闭 SELinux

    setenforce 0
    sed -i s/"^SELINUX=.*$"/"SELINUX=disabled"/g /etc/selinux/config
  5. 调整 MaxMapCount

    sysctl -w vm.max_map_count=262144
    grep -q '^vm.max_map_count' /etc/sysctl.conf && sed -i 's/^vm.max_map_count.*/vm.max_map_count=262144/' /etc/sysctl.conf || echo 'vm.max_map_count=262144' >> /etc/sysctl.conf
  6. 调整 SysFileNr

    sysctl -w fs.file-max=2048000
    grep -q '^fs.file-max' /etc/sysctl.conf && sed -i 's/^fs.file-max.*/fs.file-max=2048000/' /etc/sysctl.conf || echo 'fs.file-max=2048000' >> /etc/sysctl.conf
  7. 调整 IPv4Forward

    sysctl -w net.ipv4.ip_forward=1
    grep -q '^net.ipv4.ip_forward' /etc/sysctl.conf && sed -i 's/^net.ipv4.ip_forward.*/net.ipv4.ip_forward=1/' /etc/sysctl.conf || echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf
  8. 如果操作系统是Debian系列10+版本,需要安装iptables,命令如下:

    apt-get updates
    apt install -y iptables

二、Docker 安装

  1. 下载 docker 安装包

    wget https://pdpublic.mingdao.com/private-deployment/offline/common/docker-24.0.9.tgz
  2. 解压,并将文件移动到二进制文件目录

    tar -zxvf docker-24.0.9.tgz
    mv -f docker/* /usr/local/bin/
  3. 创建 docker 配置文件

    默认 docker 数据目录在 /data/docker,如果需要修改默认数据目录,请修改上述配置文件中的 data-root 值

    mkdir -p  /etc/docker/
    cat > /etc/docker/daemon.json <<EOF
    {
    "registry-mirrors": ["https://uvlkeb6d.mirror.aliyuncs.com"],
    "data-root": "/data/docker",
    "max-concurrent-downloads": 10,
    "exec-opts": ["native.cgroupdriver=cgroupfs"],
    "storage-driver": "overlay2",
    "default-address-pools":[{"base":"172.80.0.0/16","size":24}]
    }
    EOF
  4. 配置 systemd 管理 docker

    cat > /etc/systemd/system/docker.service <<EOF
    [Unit]
    Description=Docker
    After=network-online.target
    Wants=network-online.target
    [Service]
    Type=notify
    ExecStart=/usr/local/bin/dockerd
    ExecReload=/bin/kill -s HUP \$MAINPID
    LimitNOFILE=102400
    LimitNPROC=infinity
    LimitCORE=0
    TimeoutStartSec=0
    Delegate=yes
    KillMode=process
    Restart=on-failure
    StartLimitBurst=3
    StartLimitInterval=60s
    [Install]
    WantedBy=multi-user.target
    EOF
  5. 启动 docker

    systemctl daemon-reload && systemctl start docker && systemctl enable docker

三、HAP 单机版本安装

  1. 下载镜像(离线包下载

    docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-community:5.2.3
    docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-sc:2.0.0
    docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-command:node1018-python36
    docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-doc:1.2.0
  2. 下载管理器

    wget https://pdpublic.mingdao.com/private-deployment/5.2.3/mingdaoyun_private_deployment_captain_linux_amd64.tar.gz
  3. 创建目录,并解压管理器到新创建的目录下

    mkdir /usr/local/MDPrivateDeployment/
    tar -zxvf mingdaoyun_private_deployment_captain_linux_amd64.tar.gz -C /usr/local/MDPrivateDeployment/
  4. 进入管理器所在目录,启动管理器

    cd /usr/local/MDPrivateDeployment/
    bash ./service.sh start 
  5. 启动成功后在浏览器中通过 http://{服务器IP}:38881 进行访问,完成系统访问地址设置及初始化(初始化过程持续约 5 分钟左右)