Compiling and Installing MyCAT
- Download the MyCAT source package and copy it to the /home/mycat directory on your server.
- 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
- Create a mycat directory.
1mkdir -p /home/mycat
- 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
- Download the MyCAT source package.
- 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
- Perform the compilation.
1mvn clean install
- View the files generated after the compilation.
1 2
cd /home/mycat/Mycat-Server-1.6.76-release-2020-11-2/target ls

- 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

- 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

- 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

- Open the wrapper.conf file.
- Open the wrapper.conf configuration file.
1vim /usr/local/mycat/conf/wrapper.conf - 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

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

- Stop MyCAT.
1mycat stop
Parent topic: MySQL Database+MyCAT Deployment Guide