Skip to content

Commit 6f9e9b0

Browse files
committed
add configure
1 parent 2a0ee35 commit 6f9e9b0

File tree

2 files changed

+83
-73
lines changed

2 files changed

+83
-73
lines changed

docs/zh/installation/linux/index.md

Lines changed: 75 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ description: "使用 Linux 操作系统安装 RustFS 的快速指导"
1313

1414
1. 请明确您的三种安装启用模式:
1515

16-
1. [单机单盘模式(SNSD)](./single-node-single-disk.md)
17-
2. [单机多盘模式(SNMD)](./single-node-multiple-disk.md)
18-
3. [多机多盘模式(MNMD)](./multiple-node-multiple-disk.md)
16+
1. 单机单盘模式(SNSD)
17+
2. 单机多盘模式(SNMD)
18+
3. 多机多盘模式(MNMD)
1919

2020
2. [安装前检查](../checklists/index.md),确保各项指标符合生产指导特征,若不需要生产标准可不阅读此指导;
2121

@@ -25,7 +25,7 @@ description: "使用 Linux 操作系统安装 RustFS 的快速指导"
2525

2626
2. 防火墙;
2727

28-
3. 主机名
28+
3. 主机别名或者域名解析
2929

3030
4. 内存条件;
3131

@@ -41,7 +41,7 @@ description: "使用 Linux 操作系统安装 RustFS 的快速指导"
4141

4242
### 2.1. 操作系统版本
4343

44-
我们推荐 Linux 内核为 4.x 及以上的版本,但是 5.x 及以上的版本可以获得更好的 IO 吞吐和网络性能。
44+
我们推荐 Linux 内核为 4.x 及以上的版本。因为,5.x / 6.x 的版本可以获得更好的 IO 吞吐和网络性能。
4545

4646
您可以使用 Ubuntu 22.04 和 RHEL8.x 来安装 RustFS。
4747

@@ -68,13 +68,21 @@ firewall-cmd --reload
6868
```
6969
部署中的所有 RustFS 服务器 **必须** 使用相同的监听端口。如果您使用的是 9000 端口,其他服务器的所有端口均需要为 9000 端口。
7070

71-
### 2.3 主机名
71+
72+
73+
74+
75+
### 2.3 主机名(单机单盘和单机多盘可跳过此步骤)
7276

7377
创建 RustFS 集群必须要使用 **相同的、具备连续性** 的主机名。有两种方式实现连续性的主机名:
7478

75-
1. DNS 配置;
79+
** 1. DNS 配置:**
80+
81+
请配置你的DNS解析服务器,保障名字的连续性。
82+
83+
2. ** HOSTS 配置:**
7684

77-
2. HOSTS 配置。
85+
修改 /etc/hosts中的本地别名设置,具体操作如下:
7886

7987

8088
```bash
@@ -90,7 +98,8 @@ vim /etc/hosts
9098

9199
### 2.4 内存条件
92100

93-
RustFS 需要至少 2 GB 的内存来运行测试环境,生产的环境最低需要 64 GB 的内存。
101+
RustFS 需要至少 2 GB 的内存来运行测试环境,生产的环境最低需要 128 GB 的内存。
102+
94103

95104
### 2.5 时间同步
96105

@@ -109,88 +118,97 @@ timedatectl status
109118

110119
## 三、配置用户名
111120

112-
RustFS 启动,我们建议您配置一个专门的无登录权限的用户进行启动 RustFS 的服务。在 rustfs.service 启动控制脚本中,默认的用户和用户组是 `rustfs-user``rustfs-user`
121+
RustFS 启动,我们建议您配置一个专门的无登录权限的用户进行启动 RustFS 的服务。在 rustfs.service 启动控制脚本中。
122+
123+
1. **不修改默认启动账户** :默认的用户和用户组是 `root``root` ,若您想使用默认的`root``root`,则不需要进行任何修改。
124+
2. **不修改默认启动账户** :您可以使用 groupadd 和 useradd 命令创建用户和组,添加后修改 systemctl 启动配置文件的用户名和密码。
125+
126+
127+
以下示例是修改创建用户、组并设置权限以访问 RustFS 指定的数据目录(可选):
128+
129+
~~~
130+
groupadd -r rustfs-user
131+
useradd -M -r -g rustfs-user rustfs-user
132+
chown rustfs-user:rustfs-user /data/rustfs*
133+
~~~
134+
135+
注意:
136+
- 如果创建了rustfs-user用户和组需要将 `/etc/systemd/system/rustfs.service` 中的User 和Group改为 `rustfs-user` ;
137+
-` /data/rustfs*` 调整为指定的挂载目录。
138+
139+
113140

114-
您可以使用 groupadd 和 useradd 命令创建用户和组。以下示例创建用户、组并设置权限以访问 RustFS 指定的数据目录。
115141

116142
## 四、下载安装包
117143

118144
请先安装 wge 或者 curl 下载 rustfs 安装包。
119145

120146
```bash
121147
# 下载地址
122-
wget https://dl.rustfs.com/artifacts/rustfs/release/rustfs-linux-x86_64-latest.zip
123-
unzip rustfs-linux-x86_64-latest.zip
148+
wget https://dl.rustfs.com/artifacts/rustfs/release/rustfs-linux-x86_64-musl-latest.zip
149+
unzip rustfs-linux-x86_64-musl-latest.zip
124150
chmod +x rustfs
125151
mv rustfs /usr/local/bin/
126152
```
127153

128154

129155

130156
### 五、配置环境变量
157+
158+
159+
131160
1. 创建配置文件
132161

133162

134163
```bash
164+
# 单机单盘模式
165+
sudo tee /etc/default/rustfs <<EOF
166+
RUSTFS_ACCESS_KEY=rustfsadmin
167+
RUSTFS_SECRET_KEY=rustfsadmin
168+
RUSTFS_VOLUMES="/data/rustfs0"
169+
RUSTFS_ADDRESS=":9000"
170+
RUSTFS_CONSOLE_ENABLE=true
171+
RUST_LOG=error
172+
RUSTFS_OBS_LOG_DIRECTORY="/var/logs/rustfs/"
173+
EOF
174+
```
175+
176+
177+
```bash
178+
# 单机多盘模式
135179
sudo tee /etc/default/rustfs <<EOF
136180
RUSTFS_ACCESS_KEY=rustfsadmin
137181
RUSTFS_SECRET_KEY=rustfsadmin
138182
RUSTFS_VOLUMES="/data/rustfs{0...3}"
139183
RUSTFS_ADDRESS=":9000"
140-
#RUSTFS_SERVER_DOMAINS="play.rustfs.com:9000"
141184
RUSTFS_CONSOLE_ENABLE=true
142-
RUSTFS_OBS_ENDPOINT=""
143-
RUSTFS_TLS_PATH="/opt/tls"
185+
RUST_LOG=error
186+
RUSTFS_OBS_LOG_DIRECTORY="/var/logs/rustfs/"
144187
EOF
145188
```
146189

190+
```bash
191+
# 多机多盘模式
192+
sudo tee /etc/default/rustfs <<EOF
193+
RUSTFS_ACCESS_KEY=rustfsadmin
194+
RUSTFS_SECRET_KEY=rustfsadmin
195+
RUSTFS_VOLUMES="http://node{1...4}:9000/data/rustfs{0...3}"
196+
RUSTFS_ADDRESS=":9000"
197+
RUSTFS_CONSOLE_ENABLE=true
198+
RUST_LOG=error
199+
RUSTFS_OBS_LOG_DIRECTORY="/var/logs/rustfs/"
200+
EOF
201+
```
202+
203+
204+
147205
2. 创建存储目录
148206
```bash
149207
sudo mkdir -p /data/rustfs{0..3} /var/logs/rustfs /opt/tls
150208
sudo chmod -R 750 /data/rustfs* /var/logs/rustfs
151209
```
152210

153-
### 六、配置可观测性系统
154-
1. 创建观测配置文件
155-
```
156-
export RUSTFS_OBS_ENDPOINT=http://localhost:4317 # OpenTelemetry Collector 的地址
157-
export RUSTFS_OBS_USE_STDOUT=false # 是否使用标准输出
158-
export RUSTFS_OBS_SAMPLE_RATIO=2.0 # 采样率,0.0-1.0之间,0.0表示不采样,1.0表示全部采样
159-
export RUSTFS_OBS_METER_INTERVAL=1 # 采样间隔,单位为秒
160-
export RUSTFS_OBS_SERVICE_NAME=rustfs # 服务名称
161-
export RUSTFS_OBS_SERVICE_VERSION=0.1.0 # 服务版本
162-
export RUSTFS_OBS_ENVIRONMENT=develop # 环境名称
163-
export RUSTFS_OBS_LOGGER_LEVEL=debug # 日志级别,支持 trace, debug, info, warn, error
164-
export RUSTFS_OBS_LOCAL_LOGGING_ENABLED=true # 是否启用本地日志记录
165-
# 日志目录 当 `RUSTFS_OBS_ENDPOINT` 值为空时,默认执行下面的日志处理规则
166-
export RUSTFS_OBS_LOG_DIRECTORY="$current_dir/deploy/logs" # Log directory
167-
export RUSTFS_OBS_LOG_ROTATION_TIME="minute" # Log rotation time unit, can be "second", "minute", "hour", "day"
168-
export RUSTFS_OBS_LOG_ROTATION_SIZE_MB=1 # Log rotation size in MB
169-
170-
# 配置日志记录
171-
export RUSTFS_SINKS_FILE_PATH="$current_dir/deploy/logs/rustfs.log"
172-
export RUSTFS_SINKS_FILE_BUFFER_SIZE=12
173-
export RUSTFS_SINKS_FILE_FLUSH_INTERVAL_MS=1000
174-
export RUSTFS_SINKS_FILE_FLUSH_THRESHOLD=100
175-
```
176211

177-
2. 设置日志轮转
178-
```bash
179-
sudo tee /etc/logrotate.d/rustfs <<EOF
180-
/var/logs/rustfs/*.log {
181-
daily
182-
rotate 7
183-
missingok
184-
notifempty
185-
compress
186-
delaycompress
187-
sharedscripts
188-
postrotate
189-
systemctl restart rustfs >/dev/null 2>&1 || true
190-
endscript
191-
}
192-
EOF
193-
```
194212

195213
### 七、配置系统服务
196214
1. 创建 systemd 服务文件
@@ -273,15 +291,7 @@ curl -u rustfsadmin:rustfsadmin http://localhost:9000/
273291

274292
5. 查看日志文件
275293
```bash
276-
tail -f /var/logs/rustfs/app.log
277-
```
278-
279-
6. 测试存储接口(示例)
280-
```bash
281-
curl -X PUT -u rustfsadmin:rustfsadmin \
282-
-H "Content-Type: application/octet-stream" \
283-
--data-binary @testfile \
284-
http://localhost:9000/bucket1/object1
294+
tail -f /var/logs/rustfs/rustfs*.log
285295
```
286296

287297

docs/zh/integration/virtual.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ RustFS 100%的符合S3存储协议的要求,在S3存储时,请求路径分
1515

1616

1717

18-
|特性 |虚拟主机模式 (Virtual Host Style) |路径模式 (Path Style)|
18+
|特性 | 虚拟主机模式 (Virtual Host Style) |路径模式 (Path Style)|
1919
| - | - | - |
20-
|URL 格式 |https://<bucket>.<endpoint>/<object> |https://<endpoint>/<bucket>/<object>|
21-
|存储桶位置 |在主机名(域名)中,作为子域名| 在 URL 路径中|
22-
|示例| https://my-bucket.s3.rustfs.com/cat.jpg| https://s3.rustfs.com/my-bucket/cat.jpg|
23-
24-
20+
|URL 格式 | https://<bucket>.<endpoint>/<object> |https://<endpoint>/<bucket>/<object> |
21+
|存储桶位置 | 在主机名(域名)中,作为子域名 | 在 URL 路径中|
22+
|示例| https://my-bucket.s3.rustfs.com/cat.jpg | https://s3.rustfs.com/my-bucket/cat.jpg |
2523

2624

2725

@@ -44,13 +42,15 @@ http://rustfs.com/test
4442
在启动的时,可以将模式改为Virtual Host Style。Virtual Host Style模式的特点是桶名在为域名的一部份,假设主机名为rustfs.com,桶名为test,那么Virtual Host Style拼接下来的路径为:
4543

4644
~~~
45+
4746
http://test.rustfs.com/
47+
4848
~~~
4949

5050

5151
设置Virtual Host Style的步骤如下:
5252

53-
1. 将你的域名泛解析至指定的服务器。 假设域名为rustfs.com,则可以将*.rustfs.com解析至指定的服务器
53+
1. 将你的域名泛解析至指定的服务器。 假设域名为rustfs.com,则可以将 *.rustfs.com 解析至指定的服务器
5454
2. 如果是Linux修改 `/etc/default/rustfs` 文件,如果是Docker 或者 Kubernetes则修改yaml或者启动配置参数;
55-
3. 在配置文件中加入:`RUSTFS_SERVER_DOMAINS`, 将这个参数设置为 RUSTFS_SERVER_DOMAINS = "rustfs.com" ;
55+
3. 在配置文件中加入:`RUSTFS_SERVER_DOMAINS` , 将这个参数设置为 `RUSTFS_SERVER_DOMAINS = "rustfs.com"`
5656
4. 保存配置文件,然后使用 `systemctl restart rustfs` 重启服务。

0 commit comments

Comments
 (0)