Linux安装Nacos

一、下载安装包

wget https://github.com/alibaba/nacos/releases/download/2.2.3/nacos-server-2.2.3.tar.gz

二、安装

解压安装包

tar -zxvf nacos-server-2.2.3.tar.gz

移动到目录/opt

mv nacos /opt/

配置nacos数据库

mysql> create database nacos;
Query OK, 1 row affected (0.00 sec)

mysql> use nacos;
Database changed
mysql> source /opt/nacos/conf/mysql-schema.sql
Query OK, 0 rows affected, 3 warnings (0.01 sec)

Query OK, 0 rows affected, 3 warnings (0.01 sec)

Query OK, 0 rows affected, 3 warnings (0.02 sec)

Query OK, 0 rows affected, 3 warnings (0.00 sec)

Query OK, 0 rows affected, 4 warnings (0.02 sec)

Query OK, 0 rows affected, 9 warnings (0.01 sec)

Query OK, 0 rows affected, 4 warnings (0.02 sec)

Query OK, 0 rows affected, 9 warnings (0.01 sec)

Query OK, 0 rows affected, 5 warnings (0.02 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 1 row affected (0.02 sec)

Query OK, 1 row affected (0.00 sec)
 

修改配置文件/opt/nacos/conf/application.properties

 spring.datasource.platform=mysql
 spring.sql.init.platform=mysql

### Count of DB:
 db.num=1

### Connect URL of DB:
 db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
 db.user.0=root
 db.password.0=root
 

启动服务

/opt/nacos/bin/startup.sh -m standalone 

/opt/nacos/logs/start.out日志文件没报错的话说明启动成功

:   |   \ | :  ,--.--.     ,---.  /   /   | /  /    '   Pid: 3575
|   : '  '; | /       \   /     \.   ; ,. :|  :  /`./   Console: http://192.168.222.128:8848/nacos/index.html
'   ' ;.    ;.--.  .-. | /    / ''   | |: :|  :  ;_
|   | | \   | \__\/: . ..    ' / '   | .; : \  \    `.      https://nacos.io
'   : |  ; .' ," .--.; |'   ; :__|   :    |  `----.   \
|   | '`--'  /  /  ,.  |'   | '.'|\   \  /  /  /`--'  /
'   : |     ;  :   .'   \   :    : `----'  '--'.     /
;   |.'     |  ,     .-./\   \  /            `--'---'
'---'        `--`---'     `----'

2023-08-10 07:28:00,143 INFO Tomcat initialized with port(s): 8848 (http)

2023-08-10 07:28:00,233 INFO Root WebApplicationContext: initialization completed in 2376 ms

2023-08-10 07:28:03,159 INFO Adding welcome page: class path resource [static/index.html]

2023-08-10 07:28:03,672 WARN You are asking Spring Security to ignore Ant [pattern='/**']. This is not recommended -- please use permitAll via HttpSecurity#authorizeHttpRequests instead.

2023-08-10 07:28:03,673 INFO Will not secure Ant [pattern='/**']

2023-08-10 07:28:03,700 INFO Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@40dd3977, org.springframework.security.web.context.SecurityContextPersistenceFilter@674c583e, org.springframework.security.web.header.HeaderWriterFilter@362a019c, org.springframework.security.web.csrf.CsrfFilter@5d5d9e5, org.springframework.security.web.authentication.logout.LogoutFilter@32cb636e, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@3f23a3a0, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@5fb97279, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@3a4e343, org.springframework.security.web.session.SessionManagementFilter@5c48c0c0, org.springframework.security.web.access.ExceptionTranslationFilter@4ef27d66]

2023-08-10 07:28:03,729 INFO Exposing 1 endpoint(s) beneath base path '/actuator'

2023-08-10 07:28:03,778 INFO Tomcat started on port(s): 8848 (http) with context path '/nacos'

2023-08-10 07:28:03,800 INFO Nacos started successfully in stand alone mode. use external storage

2023-08-10 07:28:14,892 INFO Initializing Servlet 'dispatcherServlet'

2023-08-10 07:28:14,894 INFO Completed initialization in 2 ms
 

根据日志里的地址可以访问nacos管理界面

http://192.168.222.128:8848/nacos/index.html

停止nacos命令

/opt/nacos/bin/shutdown.sh

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值