同步操作将从 iresty/Apache APISIX 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Turning on the APISIX node in Stand-alone mode will no longer use the default etcd as the configuration center.
This method is more suitable for two types of users:
The routing rules in the conf/apisix.yaml
file are loaded into memory immediately after the APISIX node service starts. And every time interval (default 1 second), will try to detect whether the file content is updated, if there is an update, reload the rule.
Note: When reloading and updating routing rules, they are all hot memory updates, and there will be no replacement of working processes, it is a hot update.
To enable Stand-alone model, we can set apisix.config_center
to yaml
in file conf/config.yaml
.
Refer to the example below:
apisix:
# ...
config_center: yaml # etcd: use etcd to store the config value
# yaml: fetch the config value from local yaml file
# `/your_path/conf/apisix.yaml`
In addition, since the current Admin API is based on the etcd configuration center solution, the Admin API will not actually work when the Stand-alone mode is enabled.
All of the rules are stored in one file which named conf/apisix.yaml
,
the APISIX will check if this file has any changed every second.
If the file changed and we found #END
at the end of the file,
APISIX will load the rules in this file and update to memory of APISIX.
Here is a mini example:
routes:
-
uri: /hello
upstream:
nodes:
"127.0.0.1:1980": 1
type: roundrobin
#END
NOTE: APISIX will not load the rules into memory from file conf/apisix.yaml
if there is no #END
at the end.
Single Router:
routes:
-
uri: /hello
upstream:
nodes:
"127.0.0.1:1980": 1
type: roundrobin
#END
Multiple Router:
routes:
-
uri: /hello
upstream:
nodes:
"127.0.0.1:1980": 1
type: roundrobin
-
uri: /hello2
upstream:
nodes:
"127.0.0.1:1981": 1
type: roundrobin
#END
routes:
-
uri: /hello
service_id: 1
services:
-
id: 1
upstream:
nodes:
"127.0.0.1:1980": 1
type: roundrobin
#END
routes:
-
uri: /hello
upstream_id: 1
upstreams:
-
id: 1
nodes:
"127.0.0.1:1980": 1
type: roundrobin
#END
routes:
-
uri: /hello
service_id: 1
services:
-
id: 1
upstream_id: 2
upstreams:
-
id: 2
nodes:
"127.0.0.1:1980": 1
type: roundrobin
#END
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。