在Linux centos 服务器搭建单机nacos。内容来自nacos官网。
Nacos 致力于帮助您发现、配置和管理微服务。就时间 2022年5月13日 10:00:11
- 服务发现和服务健康监测
- 动态配置服务
- 动态 DNS 服务
- 服务及其元数据管理
nacos官网
Linux上安装nacos(完整版)
linux下nacos安装
如何在 Linux 安装 Nacos 服务
centos7 开机延迟几分钟后自启动
centos环境变量设置
Linux开机启动程序rc.local
下载的是编译好的可执行代码
下载地址:https://github.com/alibaba/nacos/releases
服务器创建临时目录
mkdir temp-file
上传到服务器
命令记录
tar -zxvf nacos-server-2.1.0.tar.gz # 解压tar包
mv nacos /usr/local/ # 移动到usr系统目录
cd /usr/local/nacos/bin/ # 跳转
java -version # java版本
sh startup.sh -m standalone # 单机模式启动
vim password # 开发环境 记录一下 账号密码 默认 nacos nacos
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 # 获取java 的环境设置
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脚本
#!/bin/bash
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>Nacostitle>
<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
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)