main page
记事 | 链接 | 数据 | 上传 | audio | video | 思维导图
logs | technolog | english | finance | social | eBook | diary/index TODO |
finance | social | booklist | resource |
MathJax
MathJax demos web
Mathjax与LaTex公式简介
latex
latex - 高等数学
latex - 线性代数
latex - 概率统计
latex - 3D变换
latex - 相似度
latex - 算法
latex - 理财
yzlit
* link
-
bullet list item 1
- bullet list item 2
-
bullet list item 3
- bullet list item 4
- bullet list item 5
- bullet list item 6
-
bullet list item 7
- bullet list item 8
- bullet list item 9
- numbered list item 1
-
numbered list item 2
- numbered list item 3
- numbered list item 4
- numbered list item 3
[link this](http://www.baidu.com)

Thumbnails
\( \sum_i a_i^2 = 1 \)
bold text
italic text
strikeout test
code (no syntax) text 获取帮助文件:h vimwiki-syntax
superscript subscript
blockquote
This would be a blockquote in vimwiki. It is not highlighted in vim but could be styled by CSS in HTML. Blockquotes are usually used to quote a long piece of text from another source.
this is a test for me this is a test for me test is ok?
If you do not want a wiki page to be converted to HTML, place: \\%nohtml into it. To apply a concrete HTML template to a wiki page, place: \\%template name into it. If you have Calendar.vim installed you can use it to create diary notes. Just open calendar with :Calendar and tap <Enter> on the date. A wiki file will be created in the default wiki's diary. Get it from http://www.vim.org/scripts/script.php?script_id=52 See |g:vimwiki_use_calendar| option to turn it off/on.
Each template could look like: >
<html>
<head>
<link rel="Stylesheet" type="text/css" href="%root_path%style.css" />
<title>%title%</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="content">
%content%
</div>
</body>
</html>
Table of Contents
Whatever
合并单元格
| a | b | c | d |
| e | f | ||
| g | |||
| h | |||
test one | test two | test three | test one | test two | test three |
Command: :VimwikiTable
| first name | name1 | ||||
|---|---|---|---|---|---|
main
-
test1
- labe1
this is a test for me
- labe12
- label3
-
item1
- label1
- label2
- label3
- item2
- item3
- item1
- item2
Markdown File Template
# Markdown CMD.md Template
## 项目说明
本项目演示如何使用 Spring Cloud Alibaba Nacos 相关 Starter 完成 Spring Cloud 应用的服务发现和配置管理。
[Nacos](https://github.com/alibaba/Nacos) 是阿里巴巴开源的一个更易于构建云原生应用的动态服务发现、配置管理和服务管理平台。
## 正确配置并启动 Nacos Server 2.4.2
在 Nacos 2.4.2 中,加入了用户鉴权相关的功能,在首次启动 Nacos Server 时,需要正确配置,避免出现启动失败的问题。
### 下载 Nacos Server
> 本示例中使用 Nacos Server 版本为 2.4.2!
Nacos 支持直接下载和源码构建两种方式。**推荐在 Spring Cloud Alibaba 2023.x 中使用 Nacos Server 2.4.2 版本。**
**注意 本章节只是为了便于理解接入方式,本示例代码中已经完成接入工作,无需再进行修改。**
1. 首先,修改 `pom.xml` 文件,引入 spring-cloud-starter-alibaba-nacos-config ;
```xml
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
</dependency>
```
2. 在应用的 `/src/main/resources/application.yaml` 配置文件中配置 Nacos 地址并引入服务配置;
```yml
spring:
cloud:
nacos:
serverAddr: 127.0.0.1:8848
# 以下配置项必须填写
username: 'nacos'
password: 'nacos'
config:
import:
- nacos:nacos-config-example.properties?refreshEnabled=true&group=DEFAULT_GROUP
```
3. 完成上述两步后,应用会从 Nacos Server 中获取相应的配置,并添加在 Spring Environment 的 PropertySources 中。使用 Nacos 配置中心保存 Nacos 的部分配置时,有以下四种方式:
- BeanAutoRefreshConfigExample: 通过将配置信息配置为bean,支持配置变自动刷新的例子;
- ConfigListenerExample: 监听配置信息的例子;
- DockingInterfaceExample: 对接 Nacos 接口,通过接口完成对配置信息增删改查的例子;
- ValueAnnotationExample: 通过 @Value 注解进行配置信息获取的例子。
#### Nacos Server 中添加配置
在命令行执行如下命令,向 Nacos Server 中添加一条配置。**可直接通过 Nacos 控制台注入!**
> **注意:需要替换 accessToken。**
#### 验证
##### 验证自动注入
在浏览器地址栏输入 `http://127.0.0.1:18084/nacos/bean`,并点击调转,可以看到成功从 Nacos Server 中获取了数据。


#### More
##### 更多配置项
配置项|key|默认值|说明
----|----|-----|-----
服务端地址|spring.cloud.nacos.config.server-addr||服务器ip和端口
DataId前缀|spring.cloud.nacos.config.prefix|${spring.application.name}|DataId的前缀,默认值为应用名称
Group|spring.cloud.nacos.config.group|DEFAULT_GROUP|
DataId后缀及内容文件格式|spring.cloud.nacos.config.file-extension|properties|DataId的后缀,同时也是配置内容的文件格式,目前只支持 properties
配置内容的编码方式|spring.cloud.nacos.config.encode|UTF-8|配置的编码
获取配置的超时时间|spring.cloud.nacos.config.timeout|3000|单位为 ms
> **注意:需要替换 accessToken!**
###### dataID
在 Nacos Config Starter 中,dataId 的拼接格式如下
${prefix} - ${spring.profiles.active} . ${file-extension}
* `prefix` 默认为 `spring.application.name` 的值,也可以通过配置项 `spring.cloud.nacos.config.prefix`来配置。
* `spring.profiles.active` 即为当前环境对应的 profile,详情可以参考 [Spring Boot文档](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-profiles.html#boot-features-profiles)
**注意,当 active profile 为空时,对应的连接符 `-` 也将不存在,dataId 的拼接格式变成 `${prefix}`.`${file-extension}`**
* `file-extension` 为配置内容的数据格式,可以通过配置项 `spring.cloud.nacos.config.file-extension`来配置。
目前只支持 `properties` 类型。
## 更多介绍
Nacos 为用户提供包括动态服务发现,配置管理,服务管理等服务基础设施,帮助用户更灵活,更轻松地构建,交付和管理他们的微服务平台,基于 Nacos, 用户可以更快速的构建以“服务”为中心的现代云原生应用。Nacos 可以和 Spring Cloud、Kubernetes/CNCF、Dubbo 等微服务生态无缝融合,为用户提供更卓越的体验。更多 Nacos 相关的信息,请参考 [Nacos 项目](https://github.com/alibaba/Nacos)。
