writinwaters commited on
Commit
6e795a0
·
1 Parent(s): 35ced66

How to make your changes to vm.max_map_count persistent on macOS (#2041)

Browse files

### What problem does this PR solve?

#1919

### Type of change
- [x] Documentation Update

Files changed (1) hide show
  1. docs/quickstart.mdx +48 -3
docs/quickstart.mdx CHANGED
@@ -67,16 +67,61 @@ This section provides instructions on setting up the RAGFlow server on Linux. If
67
  ```
68
  </TabItem>
69
  <TabItem value="macos">
70
- If you are on macOS with Docker Desktop, then you *must* use docker-machine to update `vm.max_map_count`:
71
 
72
  ```bash
73
- $ docker-machine ssh
74
- $ sudo sysctl -w vm.max_map_count=262144
75
  ```
76
 
77
  :::caution WARNING
78
  This change will be reset after a system reboot. If you forget to update the value the next time you start up the server, you may get a `Can't connect to ES cluster` exception.
79
  :::
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
  </TabItem>
81
  <TabItem value="windows">
82
 
 
67
  ```
68
  </TabItem>
69
  <TabItem value="macos">
70
+ If you are on macOS with Docker Desktop, run the following command to update `vm.max_map_count`:
71
 
72
  ```bash
73
+ docker run --rm --privileged --pid=host alpine sysctl -w vm.max_map_count=262144
 
74
  ```
75
 
76
  :::caution WARNING
77
  This change will be reset after a system reboot. If you forget to update the value the next time you start up the server, you may get a `Can't connect to ES cluster` exception.
78
  :::
79
+
80
+ To make your change persistent, create a file with proper settings:
81
+
82
+ 1.1. Create a file:
83
+
84
+ ```shell
85
+ sudo nano /Library/LaunchDaemons/com.user.vmmaxmap.plist
86
+ ```
87
+
88
+ 1.2. Open the file:
89
+
90
+ ```shell
91
+ sudo launchctl load /Library/LaunchDaemons/com.user.vmmaxmap.plist
92
+ ```
93
+
94
+ 1.3. Add settings:
95
+
96
+ ```xml
97
+ <?xml version="1.0" encoding="UTF-8"?>
98
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
99
+ <plist version="1.0">
100
+ <dict>
101
+ <key>Label</key>
102
+ <string>com.user.vmmaxmap</string>
103
+ <key>ProgramArguments</key>
104
+ <array>
105
+ <string>/usr/sbin/sysctl</string>
106
+ <string>-w</string>
107
+ <string>vm.max_map_count=262144</string>
108
+ </array>
109
+ <key>RunAtLoad</key>
110
+ <true/>
111
+ </dict>
112
+ </plist>
113
+ ```
114
+
115
+ 1.4. After saving the file, load the new daemon:
116
+
117
+ ```shell
118
+ sudo launchctl load /Library/LaunchDaemons/com.user.vmmaxmap.plist
119
+ ```
120
+
121
+ :::note
122
+ If the above steps does not work, consider using [this workaround](https://github.com/docker/for-mac/issues/7047#issuecomment-1791912053), which employs a container and does not require manual editing of the macOS settings.
123
+ :::
124
+
125
  </TabItem>
126
  <TabItem value="windows">
127