linux install nacos

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

insert image description here

1.2. Unzip the JDK installation package

insert image description here

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

insert image description here

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

insert image description here

2. Install maven

2.1, first go to the maven official website to download the maven compressed package

https://maven.apache.org/download.cgi

insert image description here

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

insert image description here
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 

insert image description here

3. Install nacos

3.1. Log in to the nacos official website to download the nacos installation package

https://github.com/alibaba/nacos/releases

insert image description here

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.

insert image description here

Find the nacos-mysql.sql file in the usr/local/nacos-2.0.2/distribution/conf directory and
execute the database script.
insert image description here

insert image description here

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.

insert image description here
then reboot

# 单机启动
sh startup.sh -m standalone

# 关闭nacos
sh shutdown.sh

Guess you like

Origin blog.csdn.net/qq_46112274/article/details/123117926