1. Need to know
Two, use
1. Start
- Assigned to the
consul
directory, the development mode is started.\consul agent -dev
, and restarting after closing will not save the previous data
2. Use
-
1), visit
http://localhost:8500/
, as follows, clickKey/Value
-
2) Click
Create
to createFile/folder
-
3) Create
test
a folder, entertest/
and clickSave
.
-
4)
Save
After clicking , you will return to this page, we can continue to create in the root directory文件/文件夹
, or clicktest
to createtest
a subfolder
-
5), click
test
, click on the upper rightCreate
, entertest1/test11/test111/
, create a多个层级
folder once , and finally clickSave
, the page refreshes
-
6), in the
test111
creation under the nameconfig
of the configuration file, and configure content
[mysql]
host = 127.0.0.1
user = aaa
pwd = 111
dn = test
- 7), edit, as shown in the figure
Three, read consul content
- Project configuration file
congif
, configuration readconsul
content
[consul]
address = 127.0.0.1:8500
contexts = test/test1/test11/test111/config
timeout = 15s