linux install nacos
- 1. JDK installation
- 2. Install maven
- 3. Install nacos
-
- 3.1. Log in to the nacos official website to download the nacos installation package
- 3.2. Unzip the installation package
- 3.3. Put the decompressed folder in the server /usr/local folder
- 3.4, modify the database configuration
- 3.5. Start nacos in the usr/local/nacos-2.0.2/distribution/bin folder
- 3.6、error unable to access jarfile
To install nacos on linux, you first need to install jdk and maven. That is, install jdk and maven on the linux server and configure the environment variables.
Use the following command to check, if not installed according to the following method.
java -veriosn
mvn -v
1. JDK installation
1.1. Prepare the jdk1.8 installation package
Upload the jdk1.8 installation package of the local linux version to the server /usr/local through the connection tool
1.2. Unzip the JDK installation package
tar -zxvf jdk-8u121-linux-x64.tar.gz
1.3, configure the JDK variable environment
1. Open the configuration file with the following command
vi etc/profile
2. Configure the subordinate environment variable
jdk in the /etc/profile file to correspond to your own version
export JAVA_HOME=/usr/local/jdk1.8.0_121
export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
1.4. Refresh the environment variable to make it take effect
source /etc/profile
1.5. Check whether the JDK is installed successfully
java -version
2. Install maven
2.1, first go to the maven official website to download the maven compressed package
https://maven.apache.org/download.cgi
2.2. Upload the downloaded compressed package to the /usr/local directory of linux
You can use xftp to upload
and then go to /usr/local
cd /usr/local
2.3. Unzip the file
tar -zxvf apache-maven-3.8.4-bin.tar.gz
2.4, configure environment variables
1. Open the configuration file with the following command
vi /etc/profile
2. Configure the subordinate environment variable
jdk in the /etc/profile file to correspond to your own version
# maven版本号与自己下载的需要对应
export MAVEN_HOME=/usr/local/apache-maven-3.8.4
export PATH=$MAVEN_HOME/bin:$PATH
2.5. Refresh environment variables
source /etc/profile
2.6, check the version
mvn -v
3. Install nacos
3.1. Log in to the nacos official website to download the nacos installation package
https://github.com/alibaba/nacos/releases
3.2. Unzip the installation package
tar -zxvf nacos-server-1.3.2.tar.gz
3.3. Put the decompressed folder in the server /usr/local folder
mv nacos /usr/local/
3.4, modify the database configuration
To start Nacos, the database must be configured to support the mysql database, so add a database.
Find the nacos-mysql.sql file in the usr/local/nacos-2.0.2/distribution/conf directory and
execute the database script.
3.5. Start nacos in the usr/local/nacos-2.0.2/distribution/bin folder
Click Launch with the following command
sh startup.sh -m standalone
3.6、error unable to access jarfile
- This is because the target package is missing in the usr/local/nacos-2.0.2/distribution folder.
Just upload the following jar package in the local disk to the server target folder.
then reboot
# 单机启动
sh startup.sh -m standalone
# 关闭nacos
sh shutdown.sh