fix(deploy): use standard rustfs log directory (#2491)

Signed-off-by: 80347547 <jianglong@oppo.com>
Co-authored-by: 80347547 <jianglong@oppo.com>
This commit is contained in:
John
2026-04-11 21:48:05 +08:00
committed by GitHub
parent b0b7f56281
commit 11552eb722
3 changed files with 12 additions and 9 deletions

View File

@@ -21,9 +21,12 @@ sudo mkdir -p /data/rustfs/{vol1,vol2}
# Create configuration directory
sudo mkdir -p /etc/rustfs
# Create log directory
sudo mkdir -p /var/log/rustfs
# Set directory permissions
sudo chown -R rustfs:rustfs /opt/rustfs /data/rustfs
sudo chmod 755 /opt/rustfs /data/rustfs
sudo chown -R rustfs:rustfs /opt/rustfs /data/rustfs /var/log/rustfs
sudo chmod 755 /opt/rustfs /data/rustfs /var/log/rustfs
```
## 2. Install RustFS

View File

@@ -30,8 +30,8 @@ EnvironmentFile=-/etc/default/rustfs
ExecStart=/usr/local/bin/rustfs $RUSTFS_VOLUMES $RUSTFS_OPTS
# service log configuration
StandardOutput=append:/data/deploy/rust/logs/rustfs.log
StandardError=append:/data/deploy/rust/logs/rustfs-err.log
StandardOutput=append:/var/log/rustfs/rustfs.log
StandardError=append:/var/log/rustfs/rustfs-err.log
# resource constraints
LimitNOFILE=1048576
@@ -58,7 +58,7 @@ ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
RestrictRealtime=true
ReadWritePaths=/data/rustfs
ReadWritePaths=/data/rustfs /var/log/rustfs
[Install]
WantedBy=multi-user.target
WantedBy=multi-user.target

View File

@@ -147,8 +147,8 @@ add_ssh_key() {
monitor_logs() {
for SERVER in "${SERVER_LIST[@]}"; do
echo "Monitoring $SERVER:/var/logs/rustfs/rustfs.log ..."
ssh "$SERVER" "tail -F /var/logs/rustfs/rustfs.log" |
echo "Monitoring $SERVER:/var/log/rustfs/rustfs.log ..."
ssh "$SERVER" "tail -F /var/log/rustfs/rustfs.log" |
sed "s/^/[$SERVER] /" &
done
wait
@@ -210,4 +210,4 @@ case "$1" in
*)
echo "Usage: $0 {deploy|clear|stop|start|restart|addkey <pubkey_file>|monitor_logs|setenv <env_file>}"
;;
esac
esac