@@ -6,17 +6,17 @@ description: "使用 Linux 操作系统安装 RustFS 的快速指导"
66# Linux 安装 RustFS
77
88
9- ## 一、 安装前必读
9+ ## 一、安装前必读
1010
1111本页面包含了 RustFS 的三种安装模式的全部文档和说明。其中,多机多盘的模式包含了企业级可用的性能、安全性和扩展性。并且,提供了生产工作负载需要的架构图。
1212请装前请阅读,我们的启动模式与检查清单,如下:
1313
14- 1 . 启动模式, 前明确您的 Linux 启动模式;
14+ 1 . 启动模式,前明确您的 Linux 启动模式;
1515
16- 2 . 检查清单, 检查各项指标是否符合生产指导特征,若不需要生产标准可不阅读此指导;
16+ 2 . 检查清单,检查各项指标是否符合生产指导特征,若不需要生产标准可不阅读此指导;
1717
1818
19- ## 二、 先决条件
19+ ## 二、先决条件
2020
21211 . 操作系统版本;
2222
@@ -113,7 +113,7 @@ timedatectl status
113113
114114RustFS 启动,我们建议您配置一个专门的无登录权限的用户进行启动 RustFS 的服务。在 rustfs.service 启动控制脚本中,默认的用户和用户组是 ` rustfs-user ` 和 ` rustfs-user ` 。
115115
116- 您可以使用 groupadd 和 useradd 命令创建用户和组. 以下示例创建用户、组并设置权限以访问 RustFS 指定的数据目录。
116+ 您可以使用 groupadd 和 useradd 命令创建用户和组。 以下示例创建用户、组并设置权限以访问 RustFS 指定的数据目录。
117117
118118## 四、下载安装包
119119
@@ -137,11 +137,11 @@ sudo tee /etc/default/rustfs <<EOF
137137RUSTFS_ROOT_USER=rustfsadmin
138138RUSTFS_ROOT_PASSWORD=rustfsadmin
139139RUSTFS_VOLUMES="/data/rustfs{0...3}"
140- RUSTFS_ADDRESS=":7000 "
141- #RUSTFS_SERVER_DOMAINS="play.rustfs.com:7000 "
140+ RUSTFS_ADDRESS=":9000 "
141+ #RUSTFS_SERVER_DOMAINS="play.rustfs.com:9000 "
142142RUSTFS_CONSOLE_ENABLE=true
143- RUSTFS_CONSOLE_ADDRESS=":7001 "
144- RUSTFS_OBS_CONFIG="/etc/default/obs.toml "
143+ RUSTFS_CONSOLE_ADDRESS=":9001 "
144+ RUSTFS_OBS_ENDPOINT=" "
145145RUSTFS_TLS_PATH="/opt/tls"
146146EOF
147147```
@@ -154,43 +154,26 @@ sudo chmod -R 750 /data/rustfs* /var/logs/rustfs
154154
155155### 六、配置可观测性系统
1561561 . 创建观测配置文件
157- ``` bash
158- sudo tee /etc/default/obs.toml << EOF
159- [observability]
160- endpoint = "http://localhost:4317"
161- use_stdout = false
162- sample_ratio = 2.0
163- meter_interval = 30
164- service_name = "rustfs"
165- service_version = "0.1.0"
166- environments = "production"
167- logger_level = "debug"
168- local_logging_enabled = true
169-
170- [sinks]
171- [sinks.kafka]
172- enabled = false
173- bootstrap_servers = "localhost:9092"
174- topic = "logs"
175- batch_size = 100
176- batch_timeout_ms = 1000
177-
178- [sinks.webhook]
179- enabled = false
180- endpoint = "http://localhost:8080/webhook"
181- auth_token = ""
182- batch_size = 100
183- batch_timeout_ms = 1000
184-
185- [sinks.file]
186- enabled = true
187- path = "/var/logs/rustfs/app.log"
188- batch_size = 10
189- batch_timeout_ms = 1000
190-
191- [logger]
192- queue_capacity = 10
193- EOF
157+ ```
158+ export RUSTFS_OBS_ENDPOINT=http://localhost:4317 # OpenTelemetry Collector 的地址
159+ export RUSTFS_OBS_USE_STDOUT=false # 是否使用标准输出
160+ export RUSTFS_OBS_SAMPLE_RATIO=2.0 # 采样率,0.0-1.0之间,0.0表示不采样,1.0表示全部采样
161+ export RUSTFS_OBS_METER_INTERVAL=1 # 采样间隔,单位为秒
162+ export RUSTFS_OBS_SERVICE_NAME=rustfs # 服务名称
163+ export RUSTFS_OBS_SERVICE_VERSION=0.1.0 # 服务版本
164+ export RUSTFS_OBS_ENVIRONMENT=develop # 环境名称
165+ export RUSTFS_OBS_LOGGER_LEVEL=debug # 日志级别,支持 trace, debug, info, warn, error
166+ export RUSTFS_OBS_LOCAL_LOGGING_ENABLED=true # 是否启用本地日志记录
167+ # 日志目录 当 `RUSTFS_OBS_ENDPOINT` 值为空时,默认执行下面的日志处理规则
168+ export RUSTFS_OBS_LOG_DIRECTORY="$current_dir/deploy/logs" # Log directory
169+ export RUSTFS_OBS_LOG_ROTATION_TIME="minute" # Log rotation time unit, can be "second", "minute", "hour", "day"
170+ export RUSTFS_OBS_LOG_ROTATION_SIZE_MB=1 # Log rotation size in MB
171+
172+ # 配置日志记录
173+ export RUSTFS_SINKS_FILE_PATH="$current_dir/deploy/logs/rustfs.log"
174+ export RUSTFS_SINKS_FILE_BUFFER_SIZE=12
175+ export RUSTFS_SINKS_FILE_FLUSH_INTERVAL_MS=1000
176+ export RUSTFS_SINKS_FILE_FLUSH_THRESHOLD=100
194177```
195178
1961792 . 设置日志轮转
@@ -229,7 +212,7 @@ Group=root
229212
230213WorkingDirectory=/usr/local
231214EnvironmentFile=-/etc/default/rustfs
232- ExecStart=/usr/local/bin/rustfs \$ RUSTFS_VOLUMES \$ RUSTFS_OPTS
215+ ExecStart=/usr/local/bin/rustfs \$ RUSTFS_VOLUMES
233216
234217LimitNOFILE=1048576
235218LimitNPROC=32768
@@ -256,6 +239,10 @@ ProtectControlGroups=true
256239RestrictSUIDSGID=true
257240RestrictRealtime=true
258241
242+ # service log configuration
243+ StandardOutput=append:/var/logs/rustfs/rustfs.log
244+ StandardError=append:/var/logs/rustfs/rustfs-err.log
245+
259246[Install]
260247WantedBy=multi-user.target
261248EOF
@@ -279,12 +266,12 @@ systemctl status rustfs
279266
2802673 . 检查服务端口
281268``` bash
282- ss -tunlp | grep -E ' 7000|7001 '
269+ ss -tunlp | grep -E ' 9000|9001 '
283270```
284271
2852724 . 验证控制台访问
286273``` bash
287- curl -u rustfsadmin:rustfsadmin http://localhost:7001 /metrics
274+ curl -u rustfsadmin:rustfsadmin http://localhost:9001 /metrics
288275```
289276
2902775 . 查看日志文件
@@ -297,7 +284,7 @@ tail -f /var/logs/rustfs/app.log
297284curl -X PUT -u rustfsadmin:rustfsadmin \
298285-H " Content-Type: application/octet-stream" \
299286--data-binary @testfile \
300- http://localhost:7000 /bucket1/object1
287+ http://localhost:9000 /bucket1/object1
301288```
302289
303290
0 commit comments