fix: remove docker compose mysql (#1523)

* fix: remove docker compose mysql

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>

* fix: remove docker compose mysql

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>

* fix: set openim scripts

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>

* fix: add openim scripts

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>

---------

Signed-off-by: Xinwei Xiong(cubxxw) <3293172751nss@gmail.com>
pull/1521/head
Xinwei Xiong 1 year ago committed by GitHub
parent 119e8dbb2f
commit 4cd2713fd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -154,8 +154,6 @@ GO111MODULE=on go get github.com/roboll/helmfile@latest
```
```bash
export MYSQL_ADDRESS=im-mysql
export MYSQL_PORT=3306
export MONGO_ADDRESS=im-mongo
export MONGO_PORT=27017
export REDIS_ADDRESS=im-redis-master

@ -53,19 +53,6 @@ rpcRegisterName:
openImAdminName: ${OPENIM_ADMIN_NAME}
openImChatName: ${OPENIM_CHAT_NAME}
###################### MySQL ######################
mysql:
# address: [ 127.0.0.1:13306 ] #目前仅支持单机
# username: root #用户名
# password: openIM123 #密码
# database: openIM_v2 #不建议修改
# maxOpenConn: 1000 #最大连接数
# maxIdleConn: 100 #最大空闲连接数
# maxLifeTime: 60 #连接可以重复使用的最长时间(秒)
# logLevel: 4 #日志级别 1=slient 2=error 3=warn 4=info
# slowThreshold: 500 #慢语句阈值 (毫秒)
database: openim_enterprise
###################### Log ######################
log:
storageLocation: ../logs/ #存放目录

@ -55,9 +55,6 @@ DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET}
# Default: DOCKER_BRIDGE_GATEWAY=172.28.0.1
DOCKER_BRIDGE_GATEWAY=${DOCKER_BRIDGE_GATEWAY}
# Address or hostname for the MySQL network.
# Default: MYSQL_NETWORK_ADDRESS=172.28.0.2
MYSQL_NETWORK_ADDRESS=${MYSQL_NETWORK_ADDRESS}
MONGO_NETWORK_ADDRESS=${MONGO_NETWORK_ADDRESS}
REDIS_NETWORK_ADDRESS=${REDIS_NETWORK_ADDRESS}
KAFKA_NETWORK_ADDRESS=${KAFKA_NETWORK_ADDRESS}
@ -86,20 +83,6 @@ ZOOKEEPER_ADDRESS=${ZOOKEEPER_NETWORK_ADDRESS}
# Default: ZOOKEEPER_PORT=12181
ZOOKEEPER_PORT=${ZOOKEEPER_PORT}
# ----- MySQL Configuration -----
# Address or hostname for the MySQL service.
# Default: MYSQL_ADDRESS=172.28.0.1
MYSQL_ADDRESS=${MYSQL_NETWORK_ADDRESS}
# Port on which MySQL database service is running.
# Default: MYSQL_PORT=13306
MYSQL_PORT=${MYSQL_PORT}
# Password to authenticate with the MySQL database service.
# Default: MYSQL_PASSWORD=openIM123
MYSQL_PASSWORD=${MYSQL_PASSWORD}
# ----- MongoDB Configuration -----
# Address or hostname for the MongoDB service.
# Default: MONGO_ADDRESS=172.28.0.1

@ -35,26 +35,6 @@ zookeeper:
username: ${ZOOKEEPER_USERNAME}
password: ${ZOOKEEPER_PASSWORD}
###################### Mysql ######################
# MySQL configuration
# Currently, only single machine setup is supported
#
# Maximum number of open connections
# Maximum number of idle connections
# Maximum lifetime in seconds a connection can be reused
# Log level: 1=slient, 2=error, 3=warn, 4=info
# Slow query threshold in milliseconds
mysql:
address: [ ${MYSQL_ADDRESS}:${MYSQL_PORT} ]
username: ${MYSQL_USERNAME}
password: ${MYSQL_PASSWORD}
database: ${MYSQL_DATABASE}
maxOpenConn: ${MYSQL_MAX_OPEN_CONN}
maxIdleConn: ${MYSQL_MAX_IDLE_CONN}
maxLifeTime: ${MYSQL_MAX_LIFETIME}
logLevel: ${MYSQL_LOG_LEVEL}
slowThreshold: ${MYSQL_SLOW_THRESHOLD}
###################### Mongo ######################
# MongoDB configuration
# If uri is not empty, it will be used directly

@ -296,19 +296,6 @@ Feel free to explore the MinIO documentation for more advanced configurations an
| `ZOOKEEPER_USERNAME` | `""` | Username for Zookeeper. |
| `ZOOKEEPER_PASSWORD` | `""` | Password for Zookeeper. |
### 2.6. <a name='MySQLConfiguration'></a>MySQL Configuration
**Description**: Configuration for MySQL, including port, address, and credentials.
| Parameter | Example Value | Description |
| ---------------- | ------------------------ | ------------------- |
| `MYSQL_PORT` | `"13306"` | Port for MySQL. |
| `MYSQL_ADDRESS` | Docker Bridge Gateway IP | Address for MySQL. |
| `MYSQL_USERNAME` | User-defined | Username for MySQL. |
| `MYSQL_PASSWORD` | User-defined | Password for MySQL. |
Note: The configurations for other services (e.g., MONGO, REDIS, KAFKA, etc.) follow a similar pattern to MySQL and can be documented in a similar manner.
### 2.7. <a name='MongoDBConfiguration'></a>MongoDB Configuration
This section involves setting up MongoDB, including its port, address, and credentials.

@ -40,11 +40,11 @@ else
DOCKER_COMPOSE_COMMAND="docker-compose"
fi
"${OPENIM_ROOT}"/scripts/init-config.sh
pushd "${OPENIM_ROOT}"
${DOCKER_COMPOSE_COMMAND} stop
curl https://gitee.com/openimsdk/openim-docker/raw/main/example/full-openim-server-and-chat.yml -o docker-compose.yml
"${OPENIM_ROOT}"/scripts/init-config.sh
${DOCKER_COMPOSE_COMMAND} up --remove-orphans -d
${DOCKER_COMPOSE_COMMAND} up -d
sleep 60
${DOCKER_COMPOSE_COMMAND} logs openim-server
${DOCKER_COMPOSE_COMMAND} ps

@ -101,7 +101,6 @@ readonly OPENIM_SERVER_PORT_LISTARIES=("${OPENIM_SERVER_PORT_TARGETS[@]##*/}")
openim::common::dependency_name() {
local targets=(
mysql
redis
zookeeper
kafka
@ -117,13 +116,11 @@ readonly OPENIM_DEPENDENCY_TARGETS
# This function returns a list of ports for various services
# - zookeeper
# - kafka
# - mysql
# - mongodb
# - redis
# - minio
openim::common::dependency_port() {
local targets=(
${MYSQL_PORT} # MySQL port
${REDIS_PORT} # Redis port
${ZOOKEEPER_PORT} # Zookeeper port
${KAFKA_PORT} # Kafka port

@ -22,17 +22,6 @@ set -o pipefail
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P)
[[ -z ${COMMON_SOURCED} ]] && source "${OPENIM_ROOT}"/scripts/install/common.sh
# Start MySQL service
docker run -d \
--name mysql \
-p 13306:3306 \
-p 23306:33060 \
-v "${DATA_DIR}/components/mysql/data:/var/lib/mysql" \
-v "/etc/localtime:/etc/localtime" \
-e MYSQL_ROOT_PASSWORD=${PASSWORD} \
--restart always \
mysql:5.7
# Start MongoDB service
docker run -d \
--name mongo \

@ -95,8 +95,6 @@ generate_ip() {
LAST_OCTET=$((LAST_OCTET + 1))
DOCKER_BRIDGE_GATEWAY=$(generate_ip)
LAST_OCTET=$((LAST_OCTET + 1))
MYSQL_NETWORK_ADDRESS=$(generate_ip)
LAST_OCTET=$((LAST_OCTET + 1))
MONGO_NETWORK_ADDRESS=$(generate_ip)
LAST_OCTET=$((LAST_OCTET + 1))
REDIS_NETWORK_ADDRESS=$(generate_ip)
@ -168,19 +166,6 @@ def "ZOOKEEPER_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # Zookeeper的地址
def "ZOOKEEPER_USERNAME" "" # Zookeeper的用户名
def "ZOOKEEPER_PASSWORD" "" # Zookeeper的密码
###################### MySQL 配置信息 ######################
def "MYSQL_PORT" "13306" # MySQL的端口
def "MYSQL_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # MySQL的地址
def "MYSQL_USERNAME" "${OPENIM_USER}" # MySQL的用户名
# MySQL的密码
readonly MYSQL_PASSWORD=${MYSQL_PASSWORD:-"${PASSWORD}"}
def "MYSQL_DATABASE" "${DATABASE_NAME}" # MySQL的数据库名
def "MYSQL_MAX_OPEN_CONN" "1000" # 最大打开的连接数
def "MYSQL_MAX_IDLE_CONN" "100" # 最大空闲连接数
def "MYSQL_MAX_LIFETIME" "60" # 连接可以重用的最大生命周期(秒)
def "MYSQL_LOG_LEVEL" "4" # 日志级别
def "MYSQL_SLOW_THRESHOLD" "500" # 慢查询阈值(毫秒)
###################### MongoDB 配置信息 ######################
def "MONGO_URI" # MongoDB的URI
def "MONGO_PORT" "37017" # MongoDB的端口

Loading…
Cancel
Save