Files
2026-04-04 08:52:59 +08:00

90 lines
2.2 KiB
Markdown
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# mongo安装
```
mkdir /www/dc
mkdir /www/dc/mongo
mkdir /www/dc/mongo/configdb
mkdir /www/dc/mongo/data
mkdir /www/dc/mysql
mkdir /www/dc/mysql/conf
mkdir /www/dc/redis
mkdir /www/dc/redis/data
touch /www/dc/redis/redis.conf
echo "appendonly yes
requirepass "n1e5a6s6m7"
appendfilename "appendonly.aof"
">>/www/dc/redis/redis.conf
docker run -d --name redis \
--restart unless-stopped \
-p 6379:6379\
-v /www/dc/redis/data:/data\
-v /www/dc/redis/redis.conf:/etc/redis/redis.conf \
redis:8.2.1 \
redis-server /etc/redis/redis.conf
````
```
docker run --name=mongo \
--volume /www/dc/mongo/configdb:/data/configdb \
--volume /www/dc/mongo/data:/data/db \
--env=GLIBC_TUNABLES=glibc.pthread.rseq \
--env=MONGO_INITDB_ROOT_USERNAME=commie \
--env=MONGO_INITDB_ROOT_PASSWORD=n1e5a6s6m7 \
--network=bridge \
-p 27017:27017 \
--runtime=runc \
--detach=true \
mongo:8.0.9 \
mongod --auth
```
# redis
```
docker run -d --name redis \
--restart unless-stopped \
-p 6379:6379 \
-v /www/dc/redis/data:/data \
-v /www/dc/redis/redis.conf:/etc/redis/redis.conf \
redis:8.2.1 \
--requirepass "n1e5a6s6m7" \
redis-server /etc/redis/redis.conf \
appendonly yes
```
# mysql
```
docker run -p 3306:3306 \
--name mysql \
-v /www/dc/mysql/conf:/etc/mysql/conf.d \
-e MYSQL_ROOT_PASSWORD=n1e5a6s6m7 \
-d mysql:8.0
```
# remark
```
/www/server/mysql/bin/mysql -u root -p questionnaire;
7b0fa3686a4f0adf
SELECT * FROM information_schema.`INNODB_TRX`;
```
docker compose up -d
docker compose --profile m up -d
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct
bash bootstrap.sh
mage
mage start
docker exec -it mongo mongorestore --uri="mongodb://openIM:n1e5a6s6m7@172.18.0.1:37017/openim_v3" /data/backup/3/openim_v3
docker exec -it mongo mongorestore --uri="mongodb://openIM:n1e5a6s6m7@localhost:27017/openim_v3" /data/backup/0/openim_v3
修复未读<0的问题
cd /www/wwwroot/im/server
go run tools/fix-conversation-maxseq/main.go --config config --dry-run
清理15天以前的消息
cd /www/wwwroot/im/server
go run tools/clean-old-messages/main.go --config config --days 15