Manual Installation and Deployment(ARM version)
This document is deployed using the CentOS/RedHat system as an example, and can also be used as a reference for the Kirin V10 and Huawei Euler systems; The differences between the Debian series systems will be separately noted.
Environment Preparation
-
Prepare a Linux server with minimum configuration requirements: 8 cores, 32G RAM, 40G data disk (excluding system disk). Recommended Servers. Make sure ports
8880
,38880
,38881
are not occupied. -
Log in to the server with the root user account
-
If the server has a data disk, please mount the data disk to the
/data
directory before deployment, or modify the default storage path of the data to the path where your data disk is mounted during installation -
Shut down Firewalld
systemctl stop firewalld && systemctl disable firewalld
-
Shut down SELinux
setenforce 0
sed -i s/"^SELINUX=.*$"/"SELINUX=disabled"/g /etc/selinux/config
-
Adjust 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
-
Adjust 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
-
Adjust 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
-
If the operating system is Debian 10 or above, please first check if there are any iptables using the
iptables --version
command;If there is no iptables, it needs to be installed. The reference command is as follows (the server needs to be able to access the Internet):
apt-get update
apt install -y iptables
Docker Installation
-
Download the installation package
- Internet Access Available
- Internet Access Unavailable
wget https://pdpublic.nocoly.com/offline/common/arm64/docker-24.0.9.tgz
# Download link for the installation package. After downloading, upload it to the deployment server.
https://pdpublic.nocoly.com/offline/common/arm64/docker-24.0.9.tgz -
Unzip the package and move the file to the binary file directory
tar -zxvf docker-24.0.9.tgz
mv -f docker/* /usr/local/bin/
-
Create docker configuration file
The default docker data directory is /data/docker, if you need to change the default data directory, modify the data-root value in the configuration file.
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 -
Configure systemd to manage 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 -
Start docker
systemctl daemon-reload && systemctl start docker && systemctl enable docker
Standalone Installation
-
Download the mirror (Offline package)
docker pull nocoly/hap-community-arm64:5.8.0
docker pull nocoly/hap-sc-arm64:3.0.0
docker pull nocoly/hap-command-arm64:node2011-python312
docker pull nocoly/hap-doc-arm64:1.2.0
-
Download manager
wget https://pdpublic.nocoly.com/5.8.0/hap_captain_linux_arm64.tar.gz
-
Create a directory and unzip the manager into the newly created directory
mkdir /usr/local/MDPrivateDeployment/
tar -zxvf hap_captain_linux_arm64.tar.gz -C /usr/local/MDPrivateDeployment/
-
Navigate to the directory where the manager is located, and start the manager.
cd /usr/local/MDPrivateDeployment/
bash ./service.sh start
-
After successful startup, access
http://{server IP}:38881
in your browser to complete the system access address setting and initialization (initialization takes about 5 minutes).