安装jdk
查看jdk是否安装
java -version
下载网址:https://www.oracle.com/java/technologies/downloads/?er=221886
下载命令:
wget https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.tar.gz
解压:
tar -zxvf jdk-17_linux-x64_bin.tar.gz -C /usr/local
修改环境变量【注意jdk版本可能不同】:
sudo vim /etc/profile
export JAVA_HOME=/usr/local/jdk-17.0.11
export PATH=$PATH:$JAVA_HOME/bin
生效环境变量:
source /etc/profile
安装nacos
下载网址:https://github.com/alibaba/nacos/releases
下载命令:
wget https://github.com/alibaba/nacos/releases/download/2.3.2/nacos-server-2.3.2.tar.gz
解压:
tar -zxvf nacos-server-2.2.3.tar.gz -C /usr/local
启动:
sh /usr/local/nacos/bin/startup.sh -m standalone
【会在/root目录下生成logs和work目录,standalone代表着单机模式运行,非集群模式】
停止:
sh /usr/local/nacos/bin/shutdown.sh
查看日志:
cat /usr/local/nacos/logs/start.out
修改配置文件:
vim /usr/local/nacos/conf/application.properties
访问
http://192.168.66.101:8848/nacos