[Subtask]: update website documentation install guide
Parent Issue
Update server commands on MacOS: https://ragflow.io/docs/dev/
Documented commands do not work on Mac.
/etc/sysctl.conf folder/path do not exist on newer mac systems. To fix the same job, using the /Library/LaunchDaemons directory is needed.
Describe implementation you've considered
Change vm.max_map_count:
docker run --rm --privileged --pid=host alpine sysctl -w vm.max_map_count=262144
The above command is not persistent and will reset at each reboot. To make it persistent, add new file with proper setting.
First create the file:
sudo nano /Library/LaunchDaemons/com.user.vmmaxmap.plist
Open file to add settings:
sudo launchctl load /Library/LaunchDaemons/com.user.vmmaxmap.plist
Adding XML configuration into file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.vmmaxmap</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/sysctl</string>
<string>-w</string>
<string>vm.max_map_count=262144</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
After saving the file, load the new daemon with the following command:
sudo launchctl load /Library/LaunchDaemons/com.user.vmmaxmap.plist
In case it's useful, I found here another solution to use a container. I haven't tried it yet, but might be a nice way to implement without having to manually edit Mac system settings (if it works).
fixsysctl:
restart: "no"
privileged: true
deploy:
replicas: 1
resources:
limits:
memory: 25m
image: centos:7
command: "sysctl -w vm.max_map_count=262144"
Issue fixed in PR #2041