介绍
在Linux centos 服务器搭建单机nacos。内容来自nacos官网。 Nacos 致力于帮助您发现、配置和管理微服务。就时间 2022年5月13日 10:00:11
Nacos 的关键特性
- 服务发现和服务健康监测
- 动态配置服务
- 动态 DNS 服务
- 服务及其元数据管理
操作
参考
nacos官网 Linux上安装nacos(完整版) linux下nacos安装 如何在 Linux 安装 Nacos 服务 centos7 开机延迟几分钟后自启动 centos环境变量设置 Linux开机启动程序rc.local
下载、上传nacos
下载的是编译好的可执行代码 下载地址:https://github.com/alibaba/nacos/releases 服务器创建临时目录
mkdir temp-file
上传到服务器 命令记录
tar -zxvf nacos-server-2.1.0.tar.gz
mv nacos /usr/local/
cd /usr/local/nacos/bin/
java -version
sh startup.sh -m standalone
vim password
ps -ef|grep nacos
curl http://127.0.0.1:8848/nacos/index.html
vim nacos_self_start.sh
chmod +x nacos_self_start.sh
cat /etc/profile
vim /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local
systemctl enable rc-local
systemctl start rc-local
systemctl status rc-local
延迟启动sh脚本
echo "nacos delayed 60s start"
sleep 60
sh startup.sh -m standalone
echo "nacos start end"
开机脚本追加,先设置java环境变量,在启动nacos
export JAVA_HOME=/opt/java
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
# start nacos
nohup /usr/local/nacos/bin/nacos_self_start.sh &
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<title>Nacos</title>
<link rel="shortcut icon" href="console-ui/public/img/nacos-logo.png" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/console1412.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/codemirror.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/merge.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/icon.css">
<link rel="stylesheet" type="text/css" href="console-ui/public/css/font-awesome.css">
<link href="./css/main.css?fd60064fb047286c26f3" rel="stylesheet"></head>
<body>
<div id="root" style="overflow:hidden"></div>
<div id="app"></div>
<div id="other"></div>
<script src="console-ui/public/js/jquery.js"></script>
<script src="console-ui/public/js/codemirror.js"></script>
<script src="console-ui/public/js/javascript.js"></script>
<script src="console-ui/public/js/xml.js"></script>
<script src="console-ui/public/js/codemirror.addone.fullscreen.js"></script>
<script src="console-ui/public/js/codemirror.addone.lint.js"></script>
<script src="console-ui/public/js/codemirror.lib.json-lint.js"></script>
<script src="console-ui/public/js/codemirror.addone.json-lint.js"></script>
<script src="console-ui/public/js/codemirror.lib.clike-lint.js"></script>
<script src="console-ui/public/js/diff_match_patch.js"></script>
<script src="console-ui/public/js/merge.js"></script>
<script src="console-ui/public/js/loader.js"></script>
<script type="text/javascript" src="./js/main.js?fd60064fb047286c26f3"></script></body>
</html>
登录nacos
http://IP:8848/nacos/#/login
|