mirror of
https://github.com/rustfs/rustfs.git
synced 2026-05-06 22:28:16 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user