Skip to content

Commit e021266

Browse files
An-DJjuzhiyuanshreemaan-abhishek
authored
docs(getting-started): rewrite the install section (#8807)
Co-authored-by: 琚致远 / Zhiyuan Ju <[email protected]> Co-authored-by: Abhishek Choudhary <[email protected]>
1 parent e587bc4 commit e021266

File tree

2 files changed

+35
-114
lines changed

2 files changed

+35
-114
lines changed

docs/en/latest/getting-started.md

+18-56
Original file line numberDiff line numberDiff line change
@@ -119,41 +119,20 @@ We receive a JSON response when we send the request:
119119

120120
## Install Apache APISIX
121121

122-
To get started, we will install Apache APISIX with Docker and enable the [Admin API](./admin-api.md).
122+
APISIX can be easily installed and started with the quickstart script.
123123

124-
First clone the [apisix-docker](https://github.com/apache/apisix-docker) repository:
125-
126-
```shell
127-
git clone https://github.com/apache/apisix-docker.git
128-
cd apisix-docker/example
129-
```
130-
131-
Now, you can use `docker-compose` to start APISIX.
132-
133-
<Tabs
134-
groupId="cpu-arch"
135-
defaultValue="x86"
136-
values={[
137-
{label: 'x86', value: 'x86'},
138-
{label: 'ARM/M1', value: 'arm'},
139-
]}>
140-
<TabItem value="x86">
141-
142-
```shell
143-
docker-compose -p docker-apisix up -d
124+
```sh
125+
curl -sL https://run.api7.ai/apisix/quickstart | sh
144126
```
145127

146-
</TabItem>
128+
This command runs APISIX and etcd locally with Docker. APISIX uses etcd to save and synchronize configuration. Both etcd and APISIX use the [**host**](https://docs.docker.com/network/host/) Docker network mode. That is, APISIX can be accessed locally.
147129

148-
<TabItem value="arm">
130+
If everything is ok, you will see the following message.
149131

150-
```shell
151-
docker-compose -p docker-apisix -f docker-compose-arm64.yml up -d
132+
```text
133+
✔ APISIX is ready!
152134
```
153135

154-
</TabItem>
155-
</Tabs>
156-
157136
:::note
158137

159138
You can check out [Installing Apache APISIX](./installation-guide.md) for different installation methods.
@@ -164,39 +143,22 @@ You can check out [Installing Apache APISIX](./installation-guide.md) for differ
164143

165144
Make sure that all the required ports (default: 9080, 9180, 9443 and 2379) are available and not used by other system processes.
166145

167-
On Unix-based systems, you can run the command below to terminate a process listening on a specific port:
168-
169-
```bash
170-
sudo fuser -k 9443/tcp
171-
```
172-
173-
If a Docker container is crashing, you can inspect the logs to diagnose the problem:
174-
175-
```bash
176-
docker logs -f --tail <container_id>
177-
```
178-
179146
:::
180147

181-
Once APISIX is running, you can use `curl` to access the Admin API. You can also check if APISIX is running properly by running this command and checking the response.
148+
Once APISIX is running, you can use curl to access it. Send a simple HTTP request to validate if APISIX is working properly or not.
182149

183-
```bash
184-
curl "http://127.0.0.1:9180/apisix/admin/services/" -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
150+
```sh
151+
curl "http://127.0.0.1:9080" --head | grep Server
185152
```
186153

187-
This response indicates that APISIX is running successfully:
154+
If everything is ok, you will get the following response.
188155

189-
```json
190-
{
191-
"count":0,
192-
"node":{
193-
"key":"/apisix/services",
194-
"nodes":[],
195-
"dir":true
196-
}
197-
}
156+
```text
157+
Server: APISIX/3.1.0
198158
```
199159

160+
You now have APISIX installed and running successfully!​
161+
200162
## Create a Route
201163

202164
From the previous step, we have a running instance of APISIX in Docker. Now let's create a Route.
@@ -206,7 +168,7 @@ APISIX provides a powerful [Admin API](./admin-api.md) and [APISIX Dashboard](ht
206168
We will configure the Route so that APISIX can forward the request to the corresponding Upstream service:
207169

208170
```bash
209-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
171+
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT -d '
210172
{
211173
"methods": ["GET"],
212174
"host": "example.com",
@@ -241,7 +203,7 @@ Instead of configuring the Upstream directly to the Route, you can create an Ups
241203
To create an Upstream object:
242204

243205
```bash
244-
curl "http://127.0.0.1:9180/apisix/admin/upstreams/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
206+
curl "http://127.0.0.1:9180/apisix/admin/upstreams/1" -X PUT -d '
245207
{
246208
"type": "roundrobin",
247209
"nodes": {
@@ -255,7 +217,7 @@ This is the same as the Upstream service we configured directly into the Route o
255217
To bind this Upstream to the Route, we can use the `upstream_id` as `1`:
256218

257219
```bash
258-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
220+
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT -d '
259221
{
260222
"methods": ["GET"],
261223
"host": "example.com",

docs/zh/latest/getting-started.md

+17-58
Original file line numberDiff line numberDiff line change
@@ -111,41 +111,20 @@ curl --location --request GET "http://httpbin.org/get?foo1=bar1&foo2=bar2"
111111

112112
## 安装 APISIX
113113

114-
我们将使用 Docker 安装 APISIX 并启用 [Admin API](./admin-api.md)
114+
APISIX 可以借助 quickstart 脚本快速安装并启动
115115

116-
首先,通过 `git` 命令克隆 [apisix-docker](https://github.com/apache/apisix-docker) 仓库:
117-
118-
```bash
119-
git clone https://github.com/apache/apisix-docker.git
120-
cd apisix-docker/example
121-
```
122-
123-
现在你可以通过 `docker-compose` 启动 APISIX。
124-
125-
<Tabs
126-
groupId="cpu-arch"
127-
defaultValue="x86"
128-
values={[
129-
{label: 'x86', value: 'x86'},
130-
{label: 'ARM/M1', value: 'arm'},
131-
]}>
132-
<TabItem value="x86">
133-
134-
```shell
135-
docker-compose -p docker-apisix up -d
116+
```sh
117+
curl -sL https://run.api7.ai/apisix/quickstart | sh
136118
```
137119

138-
</TabItem>
120+
该命令在本地安装并运行了基于 Docker 的 APISIX 和 etcd 容器,其中 APISIX 采用 etcd 保存和同步配置信息。APISIX 和 etcd 容器使用 [**host**](https://docs.docker.com/network/host/) 的 Docker 网络模式,因此可以从本地直接访问。
139121

140-
<TabItem value="arm">
122+
如果一切顺利,将输出如下信息。
141123

142-
```shell
143-
docker-compose -p docker-apisix -f docker-compose-arm64.yml up -d
124+
```text
125+
✔ APISIX is ready!
144126
```
145127

146-
</TabItem>
147-
</Tabs>
148-
149128
:::note
150129

151130
你也可以参考 [APISIX 安装指南](./installation-guide.md)了解不同的安装方法。
@@ -156,41 +135,21 @@ docker-compose -p docker-apisix -f docker-compose-arm64.yml up -d
156135

157136
请确保其他系统进程没有占用 **9080、9180、9443 和 2379** 端口。
158137

159-
在基于 UNIX 的系统中,可以使用以下命令来终止指定监听端口的运行:
160-
161-
```bash
162-
sudo fuser -k 9443/tcp
163-
```
164-
165-
如果 Docker 容器不能正常运行,你可以通过以下命令检查日志进行问题诊断:
166-
167-
```bash
168-
docker logs -f --tail $<container_id>
169-
```
170-
171138
:::
172139

173-
安装完成后,你可以在运行 Docker 的宿主机上执行 `curl` 命令访问 Admin API,根据返回数据判断 APISIX 是否成功启动
140+
你可以通过 curl 来访问正在运行的 APISIX 实例。比如,你可以发送一个简单的 HTTP 请求来验证 APISIX 运行状态是否正常
174141

175-
```bash
176-
# 注意:请在运行 Docker 的宿主机上执行 curl 命令。
177-
curl "http://127.0.0.1:9180/apisix/admin/services/" -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1'
142+
```sh
143+
curl "http://127.0.0.1:9080" --head | grep Server
178144
```
179145

180-
如果返回数据如下所示,则表示 APISIX 成功启动:
146+
I如果一切顺利,将输出如下信息。
181147

182-
```json
183-
{
184-
"count":0,
185-
"node":{
186-
"key":"/apisix/services",
187-
"nodes":[],
188-
"dir":true
189-
}
190-
}
148+
```text
149+
Server: APISIX/3.1.0
191150
```
192151

193-
完成上述步骤后,你就已经拥有了一个正在运行的 APISIX 的实例了,现在你可以从之后的小节中学习如何创建路由以及了解 APISIX Dashboard 的操作。
152+
现在,你已经成功安装并运行了 APISIX
194153

195154
## 创建路由
196155

@@ -199,7 +158,7 @@ APISIX 提供了强大的 [Admin API](./admin-api.md) 和 [Dashboard](https://gi
199158
以下示例代码中,我们将为路由配置匹配规则,以便 APISIX 可以将请求转发到对应的上游服务:
200159

201160
```bash
202-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
161+
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT -d '
203162
{
204163
"methods": ["GET"],
205164
"host": "example.com",
@@ -232,7 +191,7 @@ curl -i -X GET "http://127.0.0.1:9080/anything/foo?arg=10" -H "Host: example.com
232191
你可以通过以下命令创建一个上游,并在路由中使用它,而不是直接将其配置在路由中:
233192

234193
```bash
235-
curl "http://127.0.0.1:9180/apisix/admin/upstreams/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
194+
curl "http://127.0.0.1:9180/apisix/admin/upstreams/1" -X PUT -d '
236195
{
237196
"type": "roundrobin",
238197
"nodes": {
@@ -246,7 +205,7 @@ curl "http://127.0.0.1:9180/apisix/admin/upstreams/1" -H "X-API-KEY: edd1c9f0343
246205
上游服务创建完成后,可以通过以下命令绑定到指定路由:
247206

248207
```bash
249-
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -H "X-API-KEY: edd1c9f034335f136f87ad84b625c8f1" -X PUT -d '
208+
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -X PUT -d '
250209
{
251210
"uri": "/get",
252211
"host": "httpbin.org",

0 commit comments

Comments
 (0)