This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris-website.git


The following commit(s) were added to refs/heads/master by this push:
     new cc64855  [blog](compilation-tutorial) Add doris-tutorial-compilation
cc64855 is described below

commit cc64855726f783e70b929c35d832a327062bbba8
Author: morningman <chenmin...@baidu.com>
AuthorDate: Sat Dec 25 11:17:40 2021 +0800

    [blog](compilation-tutorial) Add doris-tutorial-compilation
---
 .github/workflows/cron-deploy-website.yml          |   4 +-
 blogs/en/doris-tutorial-compilation.md             | 638 +++++++++++++++++++++
 .../image-20211220162256154.png                    | Bin 0 -> 90570 bytes
 .../image-20211220180120409.png                    | Bin 0 -> 207603 bytes
 .../image-20211220180317910.png                    | Bin 0 -> 124794 bytes
 .../image-20211220181157554.png                    | Bin 0 -> 11778 bytes
 .../image-20211220182911446.png                    | Bin 0 -> 124892 bytes
 .../image-20211220183806318.png                    | Bin 0 -> 878104 bytes
 .../image-20211220184120563.png                    | Bin 0 -> 18119 bytes
 .../image-20211220184752813.png                    | Bin 0 -> 149607 bytes
 .../image-20211220184756120.png                    | Bin 0 -> 149607 bytes
 .../image-20211220192355582.png                    | Bin 0 -> 67668 bytes
 .../image-20211221120403558.png                    | Bin 0 -> 62798 bytes
 .../image-20211221120445833.png                    | Bin 0 -> 116808 bytes
 .../image-20211221120543215.png                    | Bin 0 -> 119013 bytes
 .../image-20211221190909871.png                    | Bin 0 -> 54614 bytes
 .../image-20211221190954677.png                    | Bin 0 -> 45977 bytes
 .../image-20211221194520114.png                    | Bin 0 -> 165353 bytes
 .../image-20211221195227111.png                    | Bin 0 -> 228027 bytes
 .../image-20211221195250005.png                    | Bin 0 -> 196127 bytes
 .../image-20211221195340120.png                    | Bin 0 -> 149390 bytes
 .../image-20211221195424420.png                    | Bin 0 -> 132502 bytes
 .../image-20211221195548551.png                    | Bin 0 -> 94898 bytes
 .../image-20211221195624113.png                    | Bin 0 -> 174782 bytes
 .../image-20211221195653102.png                    | Bin 0 -> 153889 bytes
 .../image-20211221200029323.png                    | Bin 0 -> 176035 bytes
 .../image-20211221200137725.png                    | Bin 0 -> 163430 bytes
 .../image-20211221200346916.png                    | Bin 0 -> 259452 bytes
 .../image-20211221201459225.png                    | Bin 0 -> 46284 bytes
 .../image-20211221201650493.png                    | Bin 0 -> 341616 bytes
 .../image-20211221201751774.png                    | Bin 0 -> 70062 bytes
 .../image-20211221202312977.png                    | Bin 0 -> 84399 bytes
 .../image-20211221203204574.png                    | Bin 0 -> 166383 bytes
 .../image-20211221203243631.png                    | Bin 0 -> 360528 bytes
 .../image-20211221203405005.png                    | Bin 0 -> 392225 bytes
 .../image-20211221203712731.png                    | Bin 0 -> 322150 bytes
 .../image-20211221203847192.png                    | Bin 0 -> 287809 bytes
 .../image-20211221203955970.png                    | Bin 0 -> 385142 bytes
 .../image-20211221204030083.png                    | Bin 0 -> 346424 bytes
 .../image-20211221204116846.png                    | Bin 0 -> 326985 bytes
 .../image-20211221204709603.png                    | Bin 0 -> 103362 bytes
 blogs/zh-CN/doris-tutorial-compilation.md          | 636 ++++++++++++++++++++
 42 files changed, 1277 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/cron-deploy-website.yml 
b/.github/workflows/cron-deploy-website.yml
index 954e462..99d5c0e 100644
--- a/.github/workflows/cron-deploy-website.yml
+++ b/.github/workflows/cron-deploy-website.yml
@@ -23,7 +23,9 @@ jobs:
         cp -R blogs/zh-CN/ incubator-doris/docs/zh-CN/article/articles/
         cp -R blogs/en/ incubator-doris/docs/en/article/articles/
         cp -R blogs/images/blogs/ incubator-doris/docs/.vuepress/public/images/
-        cd incubator-doris/docs && npm install && npm run build
+        cd incubator-doris/docs
+        find ./ -name "*.md" -exec sed -i -e 's/!\[\(.*\)\][(]\(.*\)[)]/<img 
\:src=\"$withBase\('\''\2'\''\)\" alt=\"\1\">/g' {} \;
+        npm install && npm run build
         touch .vuepress/dist/.dummy
         ls .vuepress/dist/
         export DORIS_COMMIT=`git rev-parse HEAD`
diff --git a/blogs/en/doris-tutorial-compilation.md 
b/blogs/en/doris-tutorial-compilation.md
new file mode 100644
index 0000000..2a2aba1
--- /dev/null
+++ b/blogs/en/doris-tutorial-compilation.md
@@ -0,0 +1,638 @@
+---
+{
+    "title": "Apache Doris Docker Compilation Installation and Deployment 
Tutorial - Compilation",
+    "description": "The purpose of this tutorial is for students who know 
little or nothing about Docker containerization technology, but want to try to 
deploy the hottest MPP-OLAP database Apache Doris to play, or the company has 
new technical architecture needs, want to deploy a test environment for testing 
performance, simple build partners, the full text try to use concise vernacular 
text to enhance readability.",
+    "date": "2021-12-20",
+    "metaTitle": "Apache Doris Docker Compilation Installation and Deployment 
Tutorial - Compilation",
+    "language": "en",
+    "isArticle": true,
+    "author": "苏奕嘉",
+    "layout": "Article",
+    "sidebar": false
+}
+---
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Apache Doris Docker Compilation Installation and Deployment Tutorial 
(Win|Mac|Linux) - Compilation
+
+This tutorial is intended for students who know little or nothing about Docker 
containerization technology, but want to try to deploy the hottest MPP-OLAP 
database Apache Doris for fun, or companies with new technical architecture 
needs, want to deploy a test environment for testing performance, simple build 
partners, the full text to try to use concise vernacular to enhance readability.
+
+The tutorial starts with questions such as "What system can you compile 
with?", "How to configure the deployed cluster", "What is Docker", "Installing 
Docker and basic operations", and finally "How to compile Doris", "Doris quick 
deployment", etc. The full text is several thousand words, with a practical 
time of about 3-5 hours.
+
+This tutorial has two deployment modes, one is a multi-server multi-node 
cluster deployment mode, this mode is generally used for test environment 
deployment, a high-performance single node production multi-Docker do cluster, 
this mode is generally used for personal research, two deployment modes 
tutorial have detailed step-by-step instructions.
+
+The final standard you want to achieve is that even if you do not want to read 
any text descriptions throughout, just copy the code in the code box in turn, 
paste and execute in the specified place, you can complete the compilation and 
deployment of Apache Doris work!
+
+This tutorial will be divided into two parts, which have been tested on three 
platforms and successfully compiled and deployed~
+
+Translated with www.DeepL.com/Translator (free version)
+
+## 1 Deployment process
+
+*** This is the "Compilation" section, only for compilation. Deployment will 
be done by the "Deploy" section***
+
+1. Configure the compilation environment
+2. Get to know Docker
+3. Install Docker
+4. Docker basic commands
+5. How to compile Doris
+6. Two deployment methods of Doris
+   1. Standalone deployment
+   2. Docker Deployment
+7. Doris Deployment FAQ
+
+## 2 Tutorial environment (just view on demand)
+
+The compilation process is all based on the Docker image for compilation, 
divided into different platforms just to facilitate the reduction of the cost 
of use for students willing to try to use or test the environment to build, 
whether you have a Mac book at hand, a Win computer, or a cloud Linux server, 
you can complete the compilation work.
+
+Depending on your current system environment, you can select the following 
sections to read.
+
+* 2.1 Linux
+* 2.2 MaC
+* 2.3 Windows
+
+### 2.1 Linux environment
+
+Cluster size: 3 Tencent Cloud servers
+
+Cluster configuration: 1 node FE | 2 nodes BE (the number of nodes can be on 
demand, please refer to the recommendations in the Apache Doris official 
website deployment document)
+
+Standalone specifications: 2C 4G
+
+System version: CentOS 7.6
+
+Java version: JDK1.8
+
+Doris version: Apache Doris 0.15.0
+
+Docker version: 20.10.11
+
+#### 2.1.1 Cloud server environment preparation
+
+The newly acquired cloud server needs to do the following.
+
+1. install CentOS 7.6 system image
+2. modify the password to enter the system
+3. remote connection to the server can be
+
+### 2.2 Mac environment
+
+Cluster size: 1 MacOS computer Virtual 4 Docker objects
+
+Cluster configuration: 1 node FE | 3 nodes BE (the number of nodes can be on 
demand, see the recommendations in the official Apache Doris deployment 
documentation)
+
+Standalone specifications: 2C 4G
+
+System version: CentOS 7.6
+
+Java version: JDK1.8
+
+Doris version: Apache Doris 0.15.0
+
+Docker version: 20.10.11
+
+#### 2.2.1 MacOS environment preparation
+
+1. Go to the official website of Docker to download the Docker-MacOS 
installation package
+
+    Download address: https://hub.docker.com/
+
+2. Initial login, you need to register, after registration through the email 
link authentication
+
+3. Download and install Docker Tools, after the initialization of Docker 
Tools, the color block of Docker Logo in the lower left corner turns green, 
which means the initialization is successful.
+
+   
![image-20211221194520114](images/blogs/doris-tutorial-compilation/image-20211221194520114.png)
+
+4. There will be a code block in the Contalners/Apps Tab that says
+
+   ```shell
+   docker run -d -p 80:80 docker/getting-started
+   ```
+
+   Copy it and open Mac Terminal to run the first Docker image on your Mac 
(this image is not a Doris-related image)
+
+### 2.3 Windows environment
+
+Cluster size: 1 Win computer Make 4 virtual machine objects
+
+Cluster configuration: 1 node FE | 3 nodes BE (the number of nodes can be on 
demand, refer to the recommendations in the Apache Doris official website 
deployment documentation)
+
+Standalone specifications: 4C 8G
+
+System version: CentOS 7.6
+
+Java version: JDK1.8
+
+Doris version: Apache Doris 0.15.0
+
+Docker version: 20.10.11
+
+#### 2.3.1 Windows environment preparation
+
+- The computer needs to have VM virtual machine software (VMwareWorkstation) 
on it
+
+- Need to be prepared to download a good ISO image file of CentOS7
+
+- The computer configuration is best slightly better, easy to compile quickly
+
+Why not apply Windows-Docker for virtual environment installation?
+
+Because it is very tedious, will increase a lot of work, and there are many no 
common problems arise, not easy to write and read tutorials
+
+#### 2.3.2 Virtual Machine Cluster Installation and Deployment
+
+##### 2.3.2.1 Creating virtual machines with VMs
+
+1. Create a new virtual machine
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195227111.png)
+
+2. Select Advanced
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195250005.png)
+
+3. Select -Install Later when installing system sources
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195340120.png)
+
+4. Select Linux-CentOS 7 64-bit when choosing a system
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195424420.png)
+
+5. choose a larger processor, preferably more than 4 total cores (the number 
of cores determines the compilation speed)
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195548551.png)
+
+6. slightly more memory too, more than 4G-8G
+
+    ! [](images/blogs/doris-tutorial-compilation/image-20211221195624113.png)
+
+7. Select NAT network mode
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195653102.png)
+
+8. Capacity is optional, 50GB or more is fine
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221200029323.png)
+
+9. Once created, select Edit Virtual Machine Settings
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221200137725.png)
+
+10. Set the system ISO mapping file
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221200346916.png)
+
+11. Start the virtual machine and install the system
+
+##### 2.3.2.2 Configuring the VM and network environment
+
+First you need to configure the virtual network on the VM
+
+1. Click `Edit Menu`, click `Virtual Network Editor`
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203204574.png)
+
+2. Click Change Settings
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203243631.png)
+
+3. Check the box as shown, then set the subnet IP address segment, the fourth 
segment is 0
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203405005.png)
+
+4. Then click on NAT settings and modify the gateway IP. Note that both the 
gateway IP and the virtual machine IP should match the criteria of the subnet 
IP address segment, that is, the other IP address settings, the first three 
segments should be consistent with the subnet IP
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203712731.png)
+
+5. All OK and apply
+
+6. open the `Network and Internet` of your host computer (this computer)
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203847192.png)
+
+7. Right-click to edit the `VMnet8` network card and open the properties
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203955970.png)
+
+8. Select the IPv4 protocol and click Properties
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221204030083.png)
+
+9. Modify the items inside
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221204116846.png)
+
+   Note that
+
+   - IP address filling rules are the same as above, need to meet the subnet 
IP address segment rules
+   - The subnet mask should be the same as the subnet mask set in NAT mode in 
the VM virtual network settings.
+   - Select the default gateway address set in "item 4".
+
+   Just make sure
+
+After installing the virtual machine, log into the system and do the following 
things:
+
+1. Modify the NIC configuration to allow the system to connect to the host and 
external network
+
+   ```shell
+   vi /etc/sysconfig/network-scripts/ifcfg-ens33 #The last one is your network 
card name, change it according to your personal situation
+   ```
+
+   ![](images/blogs/doris-tutorial-compilation/image-20211221202312977.png)
+
+   Keep and add the following entries.
+
+   ```shell
+   BOOTPROTO=static # Network address assignment method is static
+   NAME=ens33 # NIC alias
+   DEVICE=ens33 # NIC driver name
+   ONBOOT=yes # Whether to activate the NIC at system boot
+   IPADDR=192.168.201.101 # local IP address, do not duplicate with the host 
VMnet8 IP address, to meet the rules of the subnet IP segment
+   GATEWAY=192.168.201.2 # Gateway address, the value in NAT mode in the 
virtual network settings
+   NETMASK=255.255.255.0 # Subnet mask
+   DNS1=8.8.8.8 # DNS server
+   ```
+
+   `Shift + ZZ` Save and exit
+
+   Reboot the network device and load the parameters we just finished modifying
+
+   ```shell
+   service network restart
+   ```
+
+   ![](images/blogs/doris-tutorial-compilation/image-20211221204709603.png)
+
+   Then ping the gateway, the host IP and the external network respectively
+
+   ```shell
+   ping 192.168.201.2
+   ping 192.168.3.5
+   ping www.baidu.com
+   ```
+
+   If they all ping successfully, then we can prove that our configuration is 
correct
+
+2. modify the firewall settings, close the firewall
+
+   Because it is a virtual machine, and the entire independent use, so 
directly shut down the virtual machine firewall is fine
+
+   ```shell
+   # Check the firewall status
+   systemctl status firewalld.service
+   # Shut down the firewall
+   systemctl stop firewalld.service
+   # Disable the firewall server on boot
+   systemctl disable firewalld.service
+   ````
+
+3. install wget tool
+
+   ```shell
+   yum -y install wget
+   ```
+
+At this point, the virtual machine of Win platform and CentOS7 system are 
configured and can be compiled normally
+
+## 3 Docker Awareness and Deployment
+
+### 3.1 Docker Awareness
+
+Docker is an open source application container engine that allows developers 
to package their applications and dependency packages into a portable image 
that can then be distributed to any popular Linux or Windows OS machine, and 
also virtualized. Containers are completely using the sandbox mechanism and 
will not have any interfaces with each other.
+
+In short, it can be analogous to the **virtual machine technology** that we 
often use in the learning process, but compared to virtual machines, Docker 
**extremely** lightweight and simple, through containerized deployment, you can 
quickly isolate a small and complete system container with resources, 
independent systems, and independent environment, we can manipulate our Linux 
system to create a Docker container for compiling Doris environment by simply 
installing and using simple commands.
+
+***------ recommends the following must read ------***
+
+So why not compile it directly (under CentOS or Redhat systems), instead of 
building an environment container with Docker for compilation?
+
+Very simple, afraid of various pre-dependent environment, compile under the 
user's own system may encounter no dependencies, does not exist to install the 
source, can not install a variety of problems (this environment caused by a 
variety of parameters is time-consuming and no value and meaning), in order to 
allow users to reduce unnecessary trouble in the compilation process, to 
improve the success rate of compilation, so, Apache Doris officially provides a 
Docker image they have config [...]
+
+**Summary is that compiling with Docker greatly simplifies the compilation 
process, greatly enhances compilation reliability, and greatly saves operation 
and maintenance time. ** Next, start deploying Docker components.
+
+Next, start deploying Docker components to the server system.
+
+### 3.2 Docker deployment
+
+1. Docker requires a kernel version higher than ``3.10`` on CentOS systems, 
first check if the kernel version of the system meets
+
+   ```shell
+   uname -r
+   ```
+
+2. Log in with ``root`` privileges and make sure the yum package is updated to 
the latest
+
+   ```shell
+   sudo yum update
+   ```
+
+3. If you have an older version installed, uninstall it first
+
+   ```shell
+   sudo yum remove docker docker-common docker-selinux docker-engine
+   ```
+
+4. install the required packages, yum-util provides yum-config-manager 
function, the other two are devicemapper driver dependencies
+
+   ```shell
+   sudo yum install -y yum-utils device-mapper-persistent-data lvm2
+   ```
+
+5. set yum source (to speed up yum downloads)
+
+   ```shell
+   sudo yum-config-manager --add-repo 
https://download.docker.com/linux/centos/docker-ce.repo
+   ```
+
+6. View all docker versions in all repositories and select a specific version 
to install, usually you can install the latest version directly
+
+   ```shell
+   yum list docker-ce --showduplicates | sort -r
+   ```
+
+7. Install docker
+
+   - Install the latest stable version
+
+     ```shell
+     sudo yum install docker-ce -y #Install the latest stable version, because 
the repo only opens the stable repository by default
+     ```
+
+   - Install the specified version
+
+     ```shell
+     sudo yum install <FQPN> -y
+     # Example.
+     sudo yum install docker-ce-20.10.11.ce -y
+     ```
+
+8. start and add bootstrap
+
+   ```shell
+   sudo systemctl start docker #start docker
+   sudo systemctl enable docker #Add boot to boot
+   ```
+
+9. Check the Version to verify if the installation is successful
+
+   ```shell
+   docker version
+   ```
+
+   If the Client and Server parts appear, the installation is successful.
+
+### 3.3 Docker common commands (can be omitted)
+
+This piece can be seen or not, see your basic use of Docker will be OK, do not 
see also does not prevent the next compilation
+
+- View the currently running Docker image
+
+  ```
+  docker ps
+  ```
+
+- Go to a Docker image
+
+  ```shell
+  docker exec -it <mirrorName> /bin/bash
+  ```
+
+- View the pulled mirrors for the current machine
+
+  ```
+  docker images
+  ```
+
+- Run the specified image to create a container
+
+  ```
+  docker run -p local mapping port:mirror mapping port -d --name start image 
name -e image start parameters image name:image version number
+  ```
+
+## 4 Apache Doris Compilation and Deployment
+
+> We won't go into details about Apache Doris, but we will go straight to the 
point - compiling Doris source code and generating a system-executable 
application.
+
+### 4.1 Compiling Apache Doris
+
+#### 4.1.1 Pulling images
+
+In the previous step, we have successfully deployed the Docker component on 
`CentOS 7.6` system. Now, we need to pull the official Apache Doris environment 
image from the image source for compiling Doris source code.
+
+- Pull the image
+
+```shell
+docker pull apache/incubator-doris:build-env-for-0.15.0 #This is version 0.15.0
+```
+
+![](images/blogs/doris-tutorial-compilation/image-20211221190909871.png)
+
+- After a successful pull, check the list of mirrors to see if they were 
successfully pulled
+
+```
+docker images
+```
+
+- If there is a red image circled below, the image is downloaded successfully
+
+![](images/blogs/doris-tutorial-compilation/image-20211221190954677.png)
+
+- If the pull is successful, run the run command and enter the Docker image
+
+```shell
+#Don't copy and paste this sentence yet, read the following description
+docker run -it apache/incubator-doris:build-env-for-0.15.0
+```
+
+After entering the mirror this way, all operations done are resource-isolated, 
and resources disappear as you exit the mirror.
+
+It is recommended to run the mirror with the local Doris source directory 
mounted, so that the compiled output binaries are stored in the host and do not 
disappear when the mirror is exited.
+
+It is also recommended to mount the `.m2` directory of maven in the mirror to 
the host directory to prevent repeated downloads of maven dependencies each 
time the mirror is started.
+
+The following commands need to be customized according to your needs
+
+Here, after creating the location for the host to download the source code, 
you can go to section ``4.1.3.1`` and download the source code to that folder 
first, and then execute the following statement
+
+```shell
+docker run --name apache-doris-0.15.0 -it -v /root/.m2:/root/.m2 -v Location 
where the host downloaded the source code: the location of the source code you 
want to see in the container apache/incubator-doris:build-env-for-0.15.0
+# Example
+# First go to section 4.1.3.1 wget and download the source code to the host 
/opt/doris folder and run the following command
+docker run --name apache-doris-0.15.0 -it -v /root/.m2:/root/.m2 -v 
/opt/doris:/opt/doris apache/incubator-doris:build-env-for-0.15.0
+```
+
+If the following command header appears after execution, the mirror has been 
successfully entered
+
+![](images/blogs/doris-tutorial-compilation/image-20211220181157554.png)
+
+#### 4.1.2 Specifying the JDK version (on-demand)
+
+After completing pulling and entering the image, this next step is quite 
important, **this step is about the JDK version you will subsequently use**.
+
+In the official compiled environment image we pull down, we are actually given 
two sets of JDKs to choose from, one for JDK8 and one for JDK11, the default is 
JDK11, so we modify it as needed.
+
+![](images/blogs/doris-tutorial-compilation/image-20211221120403558.png)
+
+If you want to use JDK8 for your subsequent work, please execute the following 
code in order to change the JDK version
+
+```shell
+# execute as needed
+alternatives --set java java-1.8.0-openjdk.x86_64
+alternatives --set javac java-1.8.0-openjdk.x86_64
+export JAVA_HOME=/usr/lib/jvm/java-1.8.0
+```
+
+![](images/blogs/doris-tutorial-compilation/image-20211221120445833.png)
+
+If you want to use JDK11 in the future, then either you should not perform any 
operation in the first place, because the default is JDK11. If you perform the 
above command to switch to JDK8 and want to cut back, then use the following 
command to switch to JDK11
+
+```shell
+# Execute on demand
+alternatives --set java java-11-openjdk.x86_64
+alternatives --set javac java-11-openjdk.x86_64
+export JAVA_HOME=/usr/lib/jvm/java-11
+```
+
+![](images/blogs/doris-tutorial-compilation/image-20211221120543215.png)
+
+#### 4.1.3 Compiling Doris
+
+##### 4.1.3.1 Downloading the source code and unpacking
+
+- Use the wget command to download
+
+```shell
+# Download example (with version 0.15.0 as an example)
+wget 
https://downloads.apache.org/incubator/doris/0.15.0-incubating/apache-doris-0.15.0-incubating-src.tar.gz
+```
+
+- Or use the following command (github pull, preferably with a ladder)
+
+```shell
+git clone https://github.com/apache/incubator-doris.git
+```
+
+After downloading, get the source tarball and execute the following command to 
extract it
+
+```shell
+tar -zxvf apache-doris-0.15.0-incubating-src.tar.gz 
+```
+
+After unzipping, get the folder ``apache-doris-0.15.0-incubating-src``
+
+Execute the following command to enter the directory
+
+```shell
+cd apache-doris-0.15.0-incubating-src
+```
+
+##### 4.1.3.2 Compiling source code
+
+```shell
+# Before copying and pasting this command, you need to read the following text
+sh build.sh
+```
+
+If the Docker version of the pulled Doris build environment is 
`build-env-1.4.2` or `build-env-for-0.15.0` (the version can be checked with 
the `docker images` command under CentOS as described in section `4.1.1`)
+
+![](images/blogs/doris-tutorial-compilation/image-20211220182911446.png)
+
+This is because the 1.4.2 image has been upgraded to ``thrift(0.9 -> 0.13)`, 
and you need to force the new version of ``thrift` to generate the code file 
with the --clean command, otherwise incompatible code will appear.
+
+```shell
+sh build.sh --clean --be --fe --ui -j2
+```
+
+Next, you can go do other things, the tutorial test machine is using `2C 4G 
8M` to compile, taking **two hours**, during the period if you find the 
following chart, and run super slow, is normal, the node do not continue to 
carry out other actions, just wait for the completion, so as not to occur 
inexplicable errors.
+
+![](images/blogs/doris-tutorial-compilation/image-20211220162256154.png)
+
+The following message will prove that the compilation was successful
+
+![](images/blogs/doris-tutorial-compilation/image-20211220184120563.png)
+
+##### 4.1.3.3 Occasional error
+
+The compilation ended up with Failed, which means that the compilation failed 
with the error message
+
+![](images/blogs/doris-tutorial-compilation/image-20211220183806318.png)
+
+where the main description is: `ninja: build stopped: subcommand failed.`
+
+The reason for this error is probably due to some problem in the system 
itself, but it may also be due to insufficient memory used during compilation, 
which can be solved by using the following solution
+
+The solution is to add a parameter at compile time and execute the following 
statement
+
+```shell
+sh build.sh --clean --be --fe --ui -j2
+# If it's not the first build, use
+sh build.sh -j2
+```
+
+If you still get the error, you need to reset the server system and start the 
compilation from scratch again~
+
+##### 4.1.3.4 Copying resources
+
+After successful compilation, the `output` folder will be created in the 
`apache-doris-0.15.0-incubating-src` directory (or the current directory if 
nothing else is done)
+
+![](images/blogs/doris-tutorial-compilation/image-20211220184756120.png)
+
+Execute the view directory command to see the contents of this folder
+
+```shell
+ll output
+```
+
+The following folders need to be in the directory for the compilation to be 
successful: ``fe``, ``be``
+
+- Linux cloud server.
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221201459225.png)
+
+- Win platform
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221201650493.png)
+
+- MacOS platform
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221201751774.png)
+
+At this point, all compilation steps are complete and successful~
+
+We need to copy the FE folder and BE folder to the host, this is the 
crystallization of our compilation, which is equivalent to the incubator 
successfully hatching the chick, we need to take the chick out of the incubator 
to feed and do subsequent operations~
+
+**Linux systems and Mac systems execute commands under the host computer**
+
+```shell
+docker cp container name: the path of the file to be copied inside the 
container to be copied to the corresponding path in the host 
+```
+
+Note that the container name here is the name of the currently running Docker 
container after executing the ``docker ps`` command **on the host**
+
+![](images/blogs/doris-tutorial-compilation/image-20211220192355582.png)
+
+```shell
+# For example
+docker cp ed22cbfd325a:/~/apache-doris-0.15.0-incubating-src/output/ /opt/
+```
+
+At this point, Doris compilation is complete.
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211220162256154.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220162256154.png
new file mode 100644
index 0000000..6a5da70
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220162256154.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211220180120409.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220180120409.png
new file mode 100644
index 0000000..003ad0b
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220180120409.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211220180317910.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220180317910.png
new file mode 100644
index 0000000..154616c
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220180317910.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211220181157554.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220181157554.png
new file mode 100644
index 0000000..8b39de4
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220181157554.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211220182911446.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220182911446.png
new file mode 100644
index 0000000..7ae2820
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220182911446.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211220183806318.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220183806318.png
new file mode 100644
index 0000000..8a2c205
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220183806318.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211220184120563.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220184120563.png
new file mode 100644
index 0000000..03c0ae3
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220184120563.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211220184752813.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220184752813.png
new file mode 100644
index 0000000..271d953
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220184752813.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211220184756120.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220184756120.png
new file mode 100644
index 0000000..271d953
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220184756120.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211220192355582.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220192355582.png
new file mode 100644
index 0000000..7450888
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211220192355582.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221120403558.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221120403558.png
new file mode 100644
index 0000000..70d1081
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221120403558.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221120445833.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221120445833.png
new file mode 100644
index 0000000..cca3024
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221120445833.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221120543215.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221120543215.png
new file mode 100644
index 0000000..4081315
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221120543215.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221190909871.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221190909871.png
new file mode 100644
index 0000000..d2e04b1
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221190909871.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221190954677.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221190954677.png
new file mode 100644
index 0000000..2c44558
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221190954677.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221194520114.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221194520114.png
new file mode 100644
index 0000000..892286a
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221194520114.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221195227111.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195227111.png
new file mode 100644
index 0000000..61c4a4c
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195227111.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221195250005.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195250005.png
new file mode 100644
index 0000000..6e7e106
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195250005.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221195340120.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195340120.png
new file mode 100644
index 0000000..f92c6f8
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195340120.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221195424420.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195424420.png
new file mode 100644
index 0000000..4ed31ee
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195424420.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221195548551.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195548551.png
new file mode 100644
index 0000000..9c8da12
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195548551.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221195624113.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195624113.png
new file mode 100644
index 0000000..4e1d1ad
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195624113.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221195653102.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195653102.png
new file mode 100644
index 0000000..ae79fdb
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221195653102.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221200029323.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221200029323.png
new file mode 100644
index 0000000..48b5671
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221200029323.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221200137725.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221200137725.png
new file mode 100644
index 0000000..eac3987
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221200137725.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221200346916.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221200346916.png
new file mode 100644
index 0000000..2d6e48f
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221200346916.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221201459225.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221201459225.png
new file mode 100644
index 0000000..5f05ccd
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221201459225.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221201650493.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221201650493.png
new file mode 100644
index 0000000..69674c9
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221201650493.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221201751774.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221201751774.png
new file mode 100644
index 0000000..89c9834
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221201751774.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221202312977.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221202312977.png
new file mode 100644
index 0000000..676458e
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221202312977.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221203204574.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203204574.png
new file mode 100644
index 0000000..23bf032
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203204574.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221203243631.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203243631.png
new file mode 100644
index 0000000..c1c7acc
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203243631.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221203405005.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203405005.png
new file mode 100644
index 0000000..2fcd0df
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203405005.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221203712731.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203712731.png
new file mode 100644
index 0000000..7e79ada
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203712731.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221203847192.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203847192.png
new file mode 100644
index 0000000..d4de650
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203847192.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221203955970.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203955970.png
new file mode 100644
index 0000000..ad2d204
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221203955970.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221204030083.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221204030083.png
new file mode 100644
index 0000000..65ea398
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221204030083.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221204116846.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221204116846.png
new file mode 100644
index 0000000..4b8d6c7
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221204116846.png 
differ
diff --git 
a/blogs/images/blogs/doris-tutorial-compilation/image-20211221204709603.png 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221204709603.png
new file mode 100644
index 0000000..33fc627
Binary files /dev/null and 
b/blogs/images/blogs/doris-tutorial-compilation/image-20211221204709603.png 
differ
diff --git a/blogs/zh-CN/doris-tutorial-compilation.md 
b/blogs/zh-CN/doris-tutorial-compilation.md
new file mode 100644
index 0000000..9dd4d0d
--- /dev/null
+++ b/blogs/zh-CN/doris-tutorial-compilation.md
@@ -0,0 +1,636 @@
+---
+{
+    "title": "Apache Doris 全平台保姆级Docker编译安装部署教程(Win|Mac|Linux)- 编译版",
+    "description": 
"本教程的目的,是针对对Docker容器化技术知之甚少甚至一无所知,但又想尝试部署当下最火热的MPP-OLAP数据库Apache 
Doris玩耍的同学,或者公司有新的技术架构需求,想部署测试环境进行测试性能、简单搭建的伙伴,全文尽量使用简练白话文增强可阅读性。",
+    "date": "2021-12-20",
+    "metaTitle": "Apache Doris 编译安装部署教程 - 编译版",
+    "language": "zh-CN",
+    "isArticle": true,
+    "author": "苏奕嘉",
+    "layout": "Article",
+    "sidebar": false
+}
+---
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+# Apache Doris 全平台保姆级Docker编译安装部署教程(Win|Mac|Linux)- 编译版
+
+本教程的目的,是针对对Docker容器化技术知之甚少甚至一无所知,但又想尝试部署当下最火热的MPP-OLAP数据库Apache 
Doris玩耍的同学,或者公司有新的技术架构需求,想部署测试环境进行测试性能、简单搭建的伙伴,全文尽量使用简练白话文增强可阅读性。
+
+本教程始于「用啥系统可以编译啊」、「部署的集群怎么配置」、「Docker是啥」、「安装Docker及基本操作」等疑问,终于「Doris如何编译」、「Doris快速部署」等话题,全文数千字,实战时间3-5小时左右。
+
+本教程的部署模式有两种,一种是多服务器多节点的集群部署模式,这种模式一般用于测试环境部署,一种是高性能的单节点制作多Docker做集群,这种模式一般用于个人研究,两种部署模式教程都有详细步骤说明。
+
+最终想要达到的标准是,哪怕你全程不想看任何的文字描述,只需要依次复制代码框里的代码,在指定的地方粘贴并执行,即可完成Apache Doris的编译及部署工作!
+
+本教程将会分为两部分,已经通过三平台分别测试,均成功编译及部署~
+
+## 1 部署流程
+
+***本篇为「编译篇」只涉及编译,部署将由「部署篇」完成***
+
+1. 配置编译环境
+2. 认识Docker
+3. 安装Docker
+4. Docker基本操作命令
+5. Doris如何编译
+6. Doris两种部署方法
+   1. 独立机器部署
+   2. Docker部署
+7. Doris部署常见问题及避坑
+
+## 2 教程环境(按需查看即可)
+
+编译过程都是基于Docker镜像进行编译的,分不同平台只是为了便于减少愿意尝试使用或者测试环境搭建的同学的使用成本,无论是你手头有Mac本,有Win电脑,还是有云端Linux服务器,都可以完成编译工作。
+
+可以根据当前系统环境,选择以下章节阅读:
+
+* 2.1 Linux
+* 2.2 MaC
+* 2.3 Windows
+
+### 2.1 Linux环境
+
+集群规模:3台 腾讯云服务器
+
+集群配置:1节点FE | 2节点BE(节点数可以按需,具体可参阅 Apache Doris 官网部署文档中的建议)
+
+单机规格:2C 4G
+
+系统版本:CentOS 7.6
+
+Java版本:JDK1.8
+
+Doris版本:Apache Doris 0.15.0
+
+Docker版本:20.10.11
+
+#### 2.1.1 云服务器环境准备
+
+新购置的云服务器需要做如下工作:
+
+1. 安装CentOS7.6系统镜像
+2. 修改进入系统密码
+3. 远程连接服务器即可
+
+### 2.2 Mac环境
+
+集群规模:1台MacOS电脑 虚拟4个Docker对象
+
+集群配置:1节点FE | 3节点BE(节点数可以按需,具体可参阅 Apache Doris 官网部署文档中的建议)
+
+单机规格:2C 4G
+
+系统版本:CentOS 7.6
+
+Java版本:JDK1.8
+
+Doris版本:Apache Doris 0.15.0
+
+Docker版本:20.10.11
+
+#### 2.2.1 MacOS环境准备
+
+1. 到Docker官网下载Docker-MacOS安装包
+
+    下载地址:https://hub.docker.com/
+
+2. 初次登陆,需要注册,注册后通过邮件链接认证
+
+3. 下载安装,Docker Tools初始化好后左下角Docker Logo所在的色块变绿色即代表初始化成功
+
+   
![image-20211221194520114](images/blogs/doris-tutorial-compilation/image-20211221194520114.png)
+
+4. Contalners/Apps Tab里会有一个代码块,写着
+
+   ```shell
+   docker run -d -p 80:80 docker/getting-started
+   ```
+
+   复制它,打开Mac终端,即可以运行你的Mac上第一个Docker镜像(该镜像非Doris相关镜像)
+
+### 2.3 Windows环境
+
+集群规模:1台Win电脑 制作4个虚拟机对象
+
+集群配置:1节点FE | 3节点BE(节点数可以按需,具体可参阅 Apache Doris 官网部署文档中的建议)
+
+单机规格:4C 8G
+
+系统版本:CentOS 7.6
+
+Java版本:JDK1.8
+
+Doris版本:Apache Doris 0.15.0
+
+Docker版本:20.10.11
+
+#### 2.3.1 Windows环境准备
+
+- 电脑上需要有VM虚拟机软件(VMwareWorkstation)
+
+- 需要准备下载好CentOS7的ISO镜像文件
+
+- 电脑配置最好稍好一些,易于快速编译
+
+为什么不适用Windows-Docker进行虚拟环境安装?
+
+因为很繁琐,会增加很多工作量,且有很多没有共性的问题出现,不便于教程编写和阅读
+
+#### 2.3.2 虚拟机集群安装部署
+
+##### 2.3.2.1 使用VM创建虚拟机
+
+1. 新建虚拟机
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195227111.png)
+
+2. 选择高级
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195250005.png)
+
+3. 在安装系统来源时选择-稍后安装
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195340120.png)
+
+4. 在选择系统时选择Linux-CentOS 7 64位
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195424420.png)
+
+5. 处理器选大一些,最好4内核总数以上(内核数量决定了编译速度)
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195548551.png)
+
+6. 内存也稍微大一些,4G-8G以上
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195624113.png)
+
+7. 选择NAT网络模式
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221195653102.png)
+
+8. 容量随意,50GB以上即可
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221200029323.png)
+
+9. 创建好以后选择 编辑虚拟机设置
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221200137725.png)
+
+10. 设置系统ISO映射文件
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221200346916.png)
+
+11. 开启虚拟机,安装系统即可
+
+##### 2.3.2.2 配置虚拟机及网络环境
+
+首先需要在VM上配置虚拟网络
+
+1. 点击`编辑菜单`,点击`虚拟网络编辑器`
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203204574.png)
+
+2. 点击更改设置
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203243631.png)
+
+3. 照图进行勾选,然后设置子网IP地址段,第四段为0
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203405005.png)
+
+4. 然后点击NAT设置,修改网关IP,要注意,无论网关IP还是虚拟机IP,都要符合子网IP地址段的标准,也就是说,其他的IP地址设置,前三段要和子网IP一致
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203712731.png)
+
+5. 全部确定及应用
+
+6. 打开你宿主机(本电脑)的`网络和Internet`
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203847192.png)
+
+7. 右键编辑 `VMnet8`网卡,打开属性
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221203955970.png)
+
+8. 选择IPv4协议,点击属性
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221204030083.png)
+
+9. 修改里面的项目
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221204116846.png)
+
+   其中注意
+
+   - IP地址填写规则跟上述一样,需要满足子网IP地址段规则
+   - 子网掩码和VM虚拟网络设置里的NAT模式中设置的子网掩码要一致
+   - 默认网关选择`第4项`设置的网关地址
+
+   确定即可
+
+安装好虚拟机以后,登录进入系统,需要做以下几件事
+
+1. 修改网卡配置,让系统可以连通宿主机和外网
+
+   ```shell
+   vi /etc/sysconfig/network-scripts/ifcfg-ens33 #最后这个是你的网卡名,根据个人情况更改
+   ```
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221202312977.png)
+
+   保留和新增如下项:
+
+   ```shell
+   BOOTPROTO=static          # 网络地址分配方式为静态
+   NAME=ens33                # 网卡别名
+   DEVICE=ens33              # 网卡驱动名称
+   ONBOOT=yes                # 系统启动时是否激活网卡
+   IPADDR=192.168.201.101    # 本机IP地址,勿与宿主机VMnet8的IP地址重复,要满足子网IP段规则
+   GATEWAY=192.168.201.2     # 网关地址,虚拟网络设置中NAT模式下的值
+   NETMASK=255.255.255.0     # 子网掩码
+   DNS1=8.8.8.8              # DNS服务器
+   ```
+
+   `Shift + ZZ`  保存并退出
+
+   重启网络设备,加载我们刚刚修改完成的参数
+
+   ```shell
+   service network restart
+   ```
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221204709603.png)
+
+   然后分别ping一下网关、宿主机IP及外网
+
+   ```shell
+   ping 192.168.201.2
+   ping 192.168.3.5
+   ping www.baidu.com
+   ```
+
+   如果都成功ping通,则证明我们配置无误
+
+2. 修改防火墙设置,关闭防火墙
+
+   由于是虚拟机,且全程自主使用,所以直接关了虚拟机防火墙也没事
+
+   ```shell
+   # 查看防火墙状态
+   systemctl status firewalld.service
+   # 关闭防火墙
+   systemctl stop firewalld.service
+   # 开机禁止防火墙服务器
+   systemctl disable firewalld.service
+   ```
+
+3. 安装wget工具
+
+   ```shell
+   yum -y install wget
+   ```
+
+至此,Win平台的虚拟机和CentOS7系统配置完毕,可正常进行编译工作
+
+## 3 Docker认知与部署
+
+### 3.1 Docker认知
+
+Docker是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的镜像中,然后发布到任何流行的 
Linux或Windows操作系统的机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口。
+
+简而言之,可以类比于我们在学习过程中经常使用到的**虚拟机技术**,但相较虚拟机,Docker**极**为轻量化和简单化,通过容器化部署,可以快速隔离出一个有资源、有独立系统、有独立环境的小型完备的系统容器,我们可以通过简单的安装和使用简单的命令,来操控我们的Linux系统创建一个用于编译Doris环境的Docker容器。
+
+***——————建议必读以下内容——————***
+
+那为什么不直接编译(在CentOS或者Redhat系统下),而要用Docker构建一个环境容器进行编译呢?
+
+很简单,怕各种前置性的依赖环境,在用户本身的系统下编译可能遇到没有依赖、不存在安装源、无法安装等各种问题(这种环境引起的各种参数问题很耗时且无任何价值和意义),为了让用户在编译过程中减少不必要的麻烦,提高编译成功率,所以,Apache
 Doris官方提供了一个他们已经配置好了基本环境的Docker镜像,只需要通过一行命令从云端拉取下来,然后再用一行命令进入容器进行编译即可~
+
+**总结就是,用Docker编译,极大的简化了编译过程、极大的增强了编译可靠性、极大的节省了运维时间。**
+
+接下来,开始部署Docker组件到服务器系统内。
+
+### 3.2 Docker部署
+
+1. Docker 要求 CentOS 系统的内核版本高于`3.10` ,首先查看系统内核版本是否满足
+
+   ```shell
+   uname -r
+   ```
+
+2. 使用 `root` 权限登录系统,确保 yum 包更新到最新
+
+   ```shell
+   sudo yum update
+   ```
+
+3. 假如安装过旧版本,先卸载旧版本
+
+   ```shell
+   sudo yum remove docker  docker-common docker-selinux docker-engine
+   ```
+
+4. 安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的
+
+   ```shell
+   sudo yum install -y yum-utils device-mapper-persistent-data lvm2
+   ```
+
+5. 设置yum源(加速yum下载速度)
+
+   ```shell
+   sudo yum-config-manager --add-repo 
https://download.docker.com/linux/centos/docker-ce.repo
+   ```
+
+6. 查看所有仓库中所有docker版本,并选择特定版本安装,一般可直接安装最新版
+
+   ```shell
+   yum list docker-ce --showduplicates | sort -r
+   ```
+
+7. 安装docker
+
+   - 安装最新稳定版本
+
+     ```shell
+     sudo yum install docker-ce -y  #安装的是最新稳定版本,因为repo中默认只开启stable仓库
+     ```
+
+   - 安装指定版本
+
+     ```shell
+     sudo yum install <FQPN> -y
+     # 例如:
+     sudo yum install docker-ce-20.10.11.ce -y
+     ```
+
+8. 启动并加入开机启动
+
+   ```shell
+   sudo systemctl start docker #启动docker
+   sudo systemctl enable docker #加入开机自启动
+   ```
+
+9. 查看Version,验证是否安装成功
+
+   ```shell
+   docker version
+   ```
+
+   若出现Client和Server两部分内容,则证明安装成功
+
+### 3.3 Docker常用命令(可略)
+
+这一块可看可不看,看了你对于Docker基本使用就OK了,不看也不妨碍接下来编译
+
+- 查看当前运行的Docker镜像
+
+  ```
+  docker ps
+  ```
+
+- 进入某个Docker镜像
+
+  ```shell
+  docker exec -it <镜像Name> /bin/bash
+  ```
+
+- 查看当前机器已拉取的镜像
+
+  ```
+  docker images
+  ```
+
+- 运行指定的镜像创建容器
+
+  ```
+  docker run -p 本机映射端口:镜像映射端口 -d  --name 启动镜像名称 -e 镜像启动参数  镜像名称:镜像版本号
+  ```
+
+## 4 Apache Doris编译与部署
+
+> 关于Apache Doris的相关介绍,就不再多做赘述,接下来直接步入正题——编译Doris源码,编译生成一个系统可以执行的应用程序。
+
+### 4.1 Apache Doris编译
+
+#### 4.1.1 拉取镜像
+
+上一步,我们已经成功在 `CentOS 7.6` 系统下部署了Docker组件,现在,我们需要从镜像源拉取Apache 
Doris官方制作的用于编译Doris源码的环境镜像。
+
+- 拉取镜像
+
+```shell
+docker pull apache/incubator-doris:build-env-for-0.15.0 #这是0.15.0版本
+```
+
+![](images/blogs/doris-tutorial-compilation/image-20211221190909871.png)
+
+- 拉取成功后,查看镜像列表,看是否已成功拉取
+
+```
+docker images
+```
+
+- 如有下图圈红镜像,则证明镜像下载成功
+
+![](images/blogs/doris-tutorial-compilation/image-20211221190954677.png)
+
+- 如已成功拉取,运行run命令,进入Docker镜像
+
+```shell
+#这句先别着急复制粘贴,看一下下面描述
+docker run -it apache/incubator-doris:build-env-for-0.15.0
+```
+
+这样进入镜像以后,做的所有操作都是资源隔离的,资源会随着退出镜像而消失。
+
+建议以挂载本地 Doris 源码目录的方式运行镜像,这样编译的产出二进制文件会存储在宿主机中,不会因为镜像退出而消失。
+
+同时,建议同时将镜像中 maven 的 `.m2` 目录挂载到宿主机目录,以防止每次启动镜像编译时,重复下载 maven 的依赖库。
+
+以下命令需要根据自己需要定制化修改
+
+在这里,宿主机下载源码的位置创建好以后,可以先到章节`4.1.3.1`所述,先下载源码至该文件夹下,然后再执行下述语句
+
+```shell
+docker run --name apache-doris-0.15.0 -it -v /root/.m2:/root/.m2 -v 
宿主机下载了源码的位置:容器内你想看到的源码位置 apache/incubator-doris:build-env-for-0.15.0
+# 例子
+# 先到4.1.3.1章节 wget 下载源码至宿主机/opt/doris文件夹下,运行以下命令
+docker run --name apache-doris-0.15.0 -it -v /root/.m2:/root/.m2 -v 
/opt/doris:/opt/doris apache/incubator-doris:build-env-for-0.15.0
+```
+
+执行以后出现如下命令头,则代表已成功进入镜像
+
+![](images/blogs/doris-tutorial-compilation/image-20211220181157554.png)
+
+#### 4.1.2 指定JDK版本(按需执行)
+
+完成了镜像的拉取和进入,接下来这步挺重要,**这步关乎到了你后续使用的JDK版本**。
+
+在我们拉取下的官方编译环境镜像中,其实给了两套JDK供我们选择,一套是JDK8、一套JDK11,默认使用的是JDK11,所以我们按需进行修改。
+
+![](images/blogs/doris-tutorial-compilation/image-20211221120403558.png)
+
+假如你希望以及后续工作都使用JDK8的话,请依次执行以下代码修改JDK版本
+
+```shell
+# 按需执行
+alternatives --set java java-1.8.0-openjdk.x86_64
+alternatives --set javac java-1.8.0-openjdk.x86_64
+export JAVA_HOME=/usr/lib/jvm/java-1.8.0
+```
+
+![](images/blogs/doris-tutorial-compilation/image-20211221120445833.png)
+
+假如你希望以后使用的是JDK11,那要么你一开始就不要执行任何操作,因为默认就是JDK11,如果执行了以上切换JDK8命令,又想切回来,那就用如下命令切换到JDK11
+
+```shell
+# 按需执行
+alternatives --set java java-11-openjdk.x86_64
+alternatives --set javac java-11-openjdk.x86_64
+export JAVA_HOME=/usr/lib/jvm/java-11
+```
+
+![](images/blogs/doris-tutorial-compilation/image-20211221120543215.png)
+
+#### 4.1.3 编译Doris
+
+##### 4.1.3.1 下载源码及解压
+
+- 使用wget命令下载
+
+```shell
+# 下载示例(以0.15.0版本为例)
+wget 
https://downloads.apache.org/incubator/doris/0.15.0-incubating/apache-doris-0.15.0-incubating-src.tar.gz
+```
+
+- 或者使用如下命令(github拉取,最好有梯子)
+
+```shell
+git clone https://github.com/apache/incubator-doris.git
+```
+
+下载后得到源码tar压缩包,执行以下命令解压缩
+
+```shell
+tar -zxvf apache-doris-0.15.0-incubating-src.tar.gz 
+```
+
+解压缩后得到文件夹 `apache-doris-0.15.0-incubating-src`
+
+执行如下命令进入目录
+
+```shell
+cd apache-doris-0.15.0-incubating-src
+```
+
+##### 4.1.3.2 编译源码
+
+```shell
+# 复制粘贴此命令前,需要看下面文字
+sh build.sh
+```
+
+假如拉取下的Doris编译环境的Docker版本是`build-env-1.4.2`或者`build-env-for-0.15.0`(版本可通过`4.1.1`章节所述,在CentOS系统下使用`docker
 images`命令进行查看)
+
+![](images/blogs/doris-tutorial-compilation/image-20211220182911446.png)
+
+则第一次编译的时候要使用如下命令,这是因为1.4.2 版本镜像升级了 `thrift(0.9 -> 0.13)`,需要通过 --clean 
命令强制使用新版本的 `thrift` 生成代码文件,否则会出现不兼容的代码。
+
+```shell
+sh build.sh --clean --be --fe --ui -j2
+```
+
+接下来,可以去做其他事情了,教程测试机器是使用`2C 4G 
8M`进行编译,耗时**两小时**,期间如发现出现如下图,且运行速度超慢,属正常现象,该节点勿持续进行其他动作,静待完成即可,以免发生莫名错误。
+
+![](images/blogs/doris-tutorial-compilation/image-20211220162256154.png)
+
+出现以下报文,则证明编译成功
+
+![](images/blogs/doris-tutorial-compilation/image-20211220184120563.png)
+
+##### 4.1.3.3 偶现错误
+
+编译最后出现了Failed,代表编译失败了,错误信息为
+
+![](images/blogs/doris-tutorial-compilation/image-20211220183806318.png)
+
+其中主要描述为:`ninja: build stopped: subcommand failed.`
+
+该错误原因大概率是因为本身系统出现一些问题,也有可能是由于编译时使用内存不够导致,可以尝试使用以下解决方案尝试解决
+
+解决方案为在编译时增加参数,执行如下语句
+
+```shell
+sh build.sh --clean --be --fe --ui -j2
+# 如果非第一次编译,使用
+sh build.sh -j2
+```
+
+若依旧出现该错误,则需要重新重置服务器系统,重新从头进行一遍编译工作~
+
+##### 4.1.3.4 拷贝资源
+
+编译成功后,在`apache-doris-0.15.0-incubating-src`目录(如无其他操作,则为当前目录)下会生成`output`文件夹
+
+![](images/blogs/doris-tutorial-compilation/image-20211220184756120.png)
+
+执行查看目录命令,查看该文件夹内容
+
+```shell
+ll output
+```
+
+目录下需要有如下文件夹才算编译成功:`fe`、`be`
+
+- Linux云服务器:
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221201459225.png)
+
+- Win平台
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221201650493.png)
+
+- MacOS平台
+
+    ![](images/blogs/doris-tutorial-compilation/image-20211221201751774.png)
+
+至此,编译步骤全部完成且成功~
+
+我们需要将FE文件夹和BE文件夹拷贝至宿主机,这是我们的编译结晶,相当于是孵化器成功孵化出小鸡,我们要把小鸡从孵化器中拎出来去喂养和做后续操作~
+
+**Linux系统和Mac系统在宿主机下执行命令**
+
+```shell
+docker cp 容器名:要拷贝的文件在容器里面的路径 要拷贝到宿主机的相应路径 
+```
+
+需要注意,这里的容器名是**在宿主机**执行`docker ps`命令后,得到的当前正在运行的Docker容器的名字
+
+![](images/blogs/doris-tutorial-compilation/image-20211220192355582.png)
+
+```shell
+# 例如
+docker cp ed22cbfd325a:/~/apache-doris-0.15.0-incubating-src/output/ /opt/
+```
+
+至此,Doris编译结束。
+

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to