Rate This Document
Findability
Accuracy
Completeness
Readability

Compiling and Installing MyCAT

  1. Download the MyCAT source package and copy it to the /home/mycat directory on your server.
    1. Download the MyCAT source package.

      Download URL: https://github.com/MyCATApache/Mycat-Server/archive/refs/tags/1.6.76-release-2020-11-2.tar.gz

    2. Create a mycat directory.
      1
      mkdir -p /home/mycat
      
    3. Copy the source package to the /home/mycat directory on the server.
    If the server is connected to the Internet, you can run the wget command to download the installation package.
    1
    2
    cd /home/mycat
    wget https://github.com/MyCATApache/Mycat-Server/archive/refs/tags/1.6.76-release-2020-11-2.tar.gz --no-check-certificate
    
  2. Decompress the source package.
    1
    2
    tar -zxvf 1.6.76-release-2020-11-2.tar.gz
    cd Mycat-Server-1.6.76-release-2020-11-2
    
  3. Perform the compilation.
    1
    mvn clean install
    
  4. View the files generated after the compilation.
    1
    2
    cd /home/mycat/Mycat-Server-1.6.76-release-2020-11-2/target
    ls
    

  5. Decompress the generated TAR package.
    1
    2
    3
    4
    cd /home/mycat/Mycat-Server-1.6.76-release-2020-11-2/target
    tar -zxvf Mycat-server-1.6.7.6-release-*-linux.tar.gz -C /usr/local
    cd /usr/local/mycat
    ls
    

  6. Download the AArch64 wrapper package and decompress it.
    1
    2
    3
    4
    5
    cd /home
    wget https://download.tanukisoftware.com/wrapper/3.5.46/wrapper-linux-arm-64-3.5.46.tar.gz --no-check-certificate
    tar -zxvf wrapper-linux-arm-64-3.5.46.tar.gz
    cd wrapper-linux-arm-64-3.5.46
    ls
    

  7. Copy the wrapper file to the /usr/local/mycat directory.
    1
    2
    3
    cp bin/wrapper /usr/local/mycat/bin
    cp lib/libwrapper.so /usr/local/mycat/lib
    cp lib/wrapper.jar /usr/local/mycat/lib
    

  8. Open the wrapper.conf file.
    1. Open the wrapper.conf configuration file.
      1
      vim /usr/local/mycat/conf/wrapper.conf
      
    2. Modify lines 30, 39, and 42 as follows:
      1
      2
      3
      wrapper.java.additional.4=-XX:MaxDirectMemorySize=4G
      wrapper.java.initmemory=512
      wrapper.java.maxmemory=512
      

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  9. Add environment variables.
    1. Open /etc/profile.
      1
      vim /etc/profile
      
    2. Add environment variables.
      1
      export PATH=$PATH:/usr/local/mycat/bin
      
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
    4. Make the settings take effect.
      1
      source /etc/profile
      
  10. Start MyCAT.
    1
    2
    mycat start
    mycat status
    

  11. Stop MyCAT.
    1
    mycat stop