You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[1. Recommended: Use environment variables (as mentioned above).](#1-recommended-use-environment-variables-as-mentioned-above)
13
+
-[2. Modify the automation script:](#2-modify-the-automation-script)
14
+
-[3. Modify the `config.yaml` and `.env` files (but note that reusing `make init` to generate configurations will overwrite them).](#3-modify-the-configyaml-and-env-files-but-note-that-reusing-make-init-to-generate-configurations-will-overwrite-them)
15
+
-[OpenIM Data Storage Architecture Guide](#openim-data-storage-architecture-guide)
16
+
-[**II. OpenIM Default Data Storage Structure**](#ii-openim-default-data-storage-structure)
17
+
-[III. Customizing OpenIM's Data Storage](#iii-customizing-openims-data-storage)
18
+
-[IV. Docker Volume Storage: An Advanced Approach](#iv-docker-volume-storage-an-advanced-approach)
19
+
-[Custom Startup](#custom-startup)
20
+
-[3. Tips](#3-tips)
21
+
-[Contribution](#contribution)
22
+
-[Conclusion](#conclusion)
23
+
-[License](#license)
24
+
25
+
3
26
OpenIM Docker offers a stable solution for building and deploying OpenIM. There are many deployment options available, and the process is simplified using Docker and Docker Compose.
4
27
5
28
<palign="center"> <ahref="./README.md"><b> English </b></a> • <ahref="./README_zh-CN.md"><b> 简体中文 </b></a> </p>
@@ -80,41 +103,42 @@ export SERVER_BRANCH="main" # Set server version, default is release-v3.3 (unsta
80
103
# MINIO_ENDPOINT: Set MinIO service address
81
104
# API_URL: In a local network environment, set OpenIM Server API address
82
105
export API_URL="http://127.0.0.1:10002"
106
+
# DOCKER_BRIDGE_SUBNET: Set Docker bridge network address, default is 172.28.0.0/16
107
+
export DOCKER_BRIDGE_SUBNET=172.28.0.0/16
83
108
```
84
109
85
110
These are just a few common configuration options. If you don't need them, you can read through our [config center instructions](https://github.com/openimsdk/open-im-server/blob/main/docs/contrib/environment.md).
86
111
87
112
Render the required configuration via './scripts/init-config.sh 'or' make init '. It can be modified directly https://github.com/openimsdk/openim-docker/blob/main/scripts/install/environment.sh or set linux environment variables. For example, above `PASSWORD` and `USER`. The latter method works only on the current terminal
Common issues are documented in [FAQ.md](https://github.com/OpenIMSDK/openim-docker/blob/main/FAQ.md). If you encounter any issues, you can refer to this document.
100
124
101
125
It's also possible to find [issues](https://github.com/OpenIMSDK/openim-docker/issues) that have been encountered before, if not, please provide us with an [issue description](https://github.com/openimsdk/openim-docker/issues/new/choose)
102
126
103
127
104
128
105
-
**Modify Configuration Files:**
129
+
#### Modify Configuration Files:
106
130
107
131
There are three ways to modify the configuration files:
108
132
109
-
1. Recommended: Use environment variables (as mentioned above).
133
+
##### 1. Recommended: Use environment variables (as mentioned above).
110
134
111
135
**For updating configurations:**
112
136
113
137
```bash
114
138
make init
115
139
```
116
140
117
-
1. Modify the automation script:
141
+
##### 2. Modify the automation script:
118
142
119
143
```bash
120
144
scripts/install/environment.sh
@@ -126,7 +150,7 @@ To update the configuration:
126
150
make init
127
151
```
128
152
129
-
1. Modify the `config.yaml` and `.env` files (but note that reusing `make init` to generate configurations will overwrite them).
153
+
##### 3. Modify the `config.yaml` and `.env` files (but note that reusing `make init` to generate configurations will overwrite them).
At the heart of OpenIM's data storage are the essential components: Kafka, MNT, MongoDB, MySQL, and Redis. Each serves a distinct purpose and requires specific configuration and data directories for optimal performance.
177
+
178
+
**B. Directory Structure**
179
+
180
+
```bash
181
+
$ tree components/ -d -L 2
182
+
components/
183
+
├── kafka
184
+
│ ├── config
185
+
│ └── data
186
+
├── mnt
187
+
│ ├── config
188
+
│ └── data
189
+
├── mongodb
190
+
│ └── data
191
+
├── mysql
192
+
│ └── data
193
+
└── redis
194
+
├── config
195
+
└── data
196
+
```
197
+
198
+
199
+
### III. Customizing OpenIM's Data Storage
200
+
201
+
**A. Setting a Custom Directory**
202
+
203
+
For organizations with specific storage directory requirements, OpenIM offers the flexibility to specify a custom directory. Follow these steps:
204
+
205
+
1. Define your custom directory path by setting the `DATA_DIR` environment variable:
206
+
207
+
```bash
208
+
$ export DATA_DIR="/path/to/your/directory"
209
+
```
210
+
211
+
1. Refresh OpenIM's configuration to reflect this change:
212
+
213
+
```bash
214
+
$ make init
215
+
```
216
+
217
+
**Note:** This action will update the configuration to point to the directory you've specified.
218
+
219
+
220
+
### IV. Docker Volume Storage: An Advanced Approach
221
+
222
+
**A. Why Docker Volumes?**
223
+
224
+
Docker volumes offer isolated storage solutions, optimizing data persistence and performance. When scaling services in Docker, using volumes ensures that data remains consistent and protected.
225
+
226
+
**B. Using Docker Volumes with OpenIM**
227
+
228
+
To launch OpenIM with Docker volume support, execute:
229
+
230
+
```bash
231
+
$ docker compose -f example/volume-all-server.yml up -d
232
+
```
233
+
234
+
With this setup, your OpenIM data is securely mounted onto Docker's volumes, providing added resilience and scalability.
235
+
236
+
**C. Managing Docker Volumes**
237
+
238
+
1.**Listing OpenIM Docker Volumes**
239
+
240
+
Retrieve a list of Docker volumes associated with OpenIM using:
241
+
242
+
```bash
243
+
$ docker volume ls | grep open-im-server
244
+
```
245
+
246
+
1.**Removing Data**
247
+
248
+
- For **locally mapped data**: Simply navigate to the appropriate directory and delete the desired files or folders.
249
+
- For **Docker volume data**: If you wish to clear data from Docker volumes, employ the command below:
**Warning:** This action will permanently erase the data. Always ensure you have backups before proceeding.
256
+
257
+
145
258
### Custom Startup
146
259
147
260
Based on your requirements, choose the appropriate Docker-compose file to start:
@@ -237,6 +350,12 @@ Ensure your Docker and Docker Compose are up-to-date to guarantee the best compa
237
350
238
351
We encourage community contributions and improvements to this project. For the specific contribution process, please refer to [CONTRIBUTING.md](https://chat.openai.com/CONTRIBUTING.md).
239
352
353
+
### Conclusion
354
+
355
+
OpenIM's flexible storage solutions empower organizations to configure their infrastructure in alignment with their specific needs. Whether through default directories, custom paths, or Docker volumes, OpenIM guarantees efficient and secure data management.
356
+
357
+
For further assistance or advanced configurations, please consult our technical support team or refer to OpenIM's comprehensive documentation.
358
+
240
359
## License
241
360
242
361
This project uses the MIT license. For details, please refer to [LICENSE](https://chat.openai.com/LICENSE).
0 commit comments