mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-26 21:22:16 +08:00
fix: scripts fix
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
parent
9c4517ac05
commit
bf67a56fe1
@ -13,80 +13,86 @@
|
||||
# limitations under the License.
|
||||
|
||||
# ================= Basic Configuration ===================
|
||||
# User for authentication or system operations
|
||||
USER=${USER}
|
||||
|
||||
# Password associated with the specified user for authentication
|
||||
PASSWORD=${PASSWORD}
|
||||
|
||||
# Endpoint for the MinIO object storage service
|
||||
MINIO_ENDPOINT=${MINIO_ENDPOINT}
|
||||
|
||||
# Base URL for the application programming interface (API)
|
||||
API_URL=${API_URL}
|
||||
|
||||
# Directory path for storing data files or related information
|
||||
DATA_DIR=${DATA_DIR}
|
||||
USER=${USER} # User for authentication or system operations
|
||||
PASSWORD=${PASSWORD} # Password associated with the specified user for authentication
|
||||
MINIO_ENDPOINT=${MINIO_ENDPOINT} # Endpoint for the MinIO object storage service
|
||||
API_URL=${API_URL} # Base URL for the application programming interface (API)
|
||||
DATA_DIR=${DATA_DIR} # Directory path for storing data files or related information
|
||||
|
||||
# ================= Network Configuration =================
|
||||
DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET} # Subnet for the Docker network
|
||||
DOCKER_BRIDGE_GATEWAY=${DOCKER_BRIDGE_GATEWAY} # Gateway for the Docker network
|
||||
MYSQL_NETWORK_ADDRESS=${MYSQL_NETWORK_ADDRESS} # Address or hostname for the MySQL network
|
||||
MONGO_NETWORK_ADDRESS=${MONGO_NETWORK_ADDRESS} # Address or hostname for the MongoDB network
|
||||
REDIS_NETWORK_ADDRESS=${REDIS_NETWORK_ADDRESS} # Address or hostname for the Redis network
|
||||
KAFKA_NETWORK_ADDRESS=${KAFKA_NETWORK_ADDRESS} # Address or hostname for the Kafka network
|
||||
ZOOKEEPER_NETWORK_ADDRESS=${ZOOKEEPER_NETWORK_ADDRESS} # Address or hostname for the ZooKeeper network
|
||||
MINIO_NETWORK_ADDRESS=${MINIO_NETWORK_ADDRESS} # Address or hostname for the MinIO network
|
||||
OPENIM_WEB_NETWORK_ADDRESS=${OPENIM_WEB_NETWORK_ADDRESS} # Address or hostname for the OpenIM web network
|
||||
OPENIM_SERVER_NETWORK_ADDRESS=${OPENIM_SERVER_NETWORK_ADDRESS} # Address or hostname for the OpenIM server network
|
||||
OPENIM_CHAT_NETWORK_ADDRESS=${OPENIM_CHAT_NETWORK_ADDRESS} # Address or hostname for the OpenIM chat network
|
||||
PROMETHEUS_NETWORK_ADDRESS=${PROMETHEUS_NETWORK_ADDRESS} # Address or hostname for the Prometheus network
|
||||
GRAFANA_NETWORK_ADDRESS=${GRAFANA_NETWORK_ADDRESS} # Address or hostname for the Grafana network
|
||||
|
||||
# ============ Component Extension Configuration ==========
|
||||
# Address or hostname for the ZooKeeper service (often used in distributed systems for maintaining configuration information)
|
||||
ZOOKEEPER_ADDRESS=${ZOOKEEPER_ADDRESS}
|
||||
ZOOKEEPER_PORT=${ZOOKEEPER_PORT}
|
||||
# ----- ZooKeeper Configuration -----
|
||||
ZOOKEEPER_ADDRESS=${ZOOKEEPER_ADDRESS} # Address or hostname for the ZooKeeper service
|
||||
ZOOKEEPER_PORT=${ZOOKEEPER_PORT} # Port for ZooKeeper service
|
||||
|
||||
# Port on which MySQL database service is running
|
||||
MYSQL_PORT=${MYSQL_PORT}
|
||||
# ----- MySQL Configuration -----
|
||||
MYSQL_ADDRESS=${MYSQL_ADDRESS} # Address or hostname for the MySQL service
|
||||
MYSQL_PORT=${MYSQL_PORT} # Port on which MySQL database service is running
|
||||
MYSQL_PASSWORD=${MYSQL_PASSWORD} # Password to authenticate with the MySQL database service
|
||||
|
||||
# Password to authenticate with the MySQL database service
|
||||
MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||
# ----- MongoDB Configuration -----
|
||||
MONGO_ADDRESS=${MONGO_ADDRESS} # Address or hostname for the MongoDB service
|
||||
MONGO_PORT=${MONGO_PORT} # Port on which MongoDB service is running
|
||||
MONGO_USERNAME=${MONGO_USERNAME} # Username to authenticate with the MongoDB service
|
||||
MONGO_PASSWORD=${MONGO_PASSWORD} # Password to authenticate with the MongoDB service
|
||||
MONGO_DATABASE=${MONGO_DATABASE} # Name of the database in MongoDB to be used
|
||||
|
||||
# Port on which MongoDB service is running
|
||||
MONGO_PORT=${MONGO_PORT}
|
||||
# ----- Redis Configuration -----
|
||||
REDIS_ADDRESS=${REDIS_ADDRESS} # Address or hostname for the Redis service
|
||||
REDIS_PORT=${REDIS_PORT} # Port on which Redis in-memory data structure store is running
|
||||
REDIS_PASSWORD=${REDIS_PASSWORD} # Password to authenticate with the Redis service
|
||||
|
||||
# Username to authenticate with the MongoDB service
|
||||
MONGO_USERNAME=${MONGO_USERNAME}
|
||||
# ----- Kafka Configuration -----
|
||||
KAFKA_ADDRESS=${KAFKA_ADDRESS} # Address or hostname for the Kafka service
|
||||
KAFKA_PORT=${KAFKA_PORT} # Port on which Kafka distributed streaming platform is running
|
||||
KAFKA_LATESTMSG_REDIS_TOPIC=${KAFKA_LATESTMSG_REDIS_TOPIC} # Topic in Kafka for storing the latest messages in Redis
|
||||
KAFKA_MSG_PUSH_TOPIC=${KAFKA_MSG_PUSH_TOPIC} # Topic in Kafka for pushing messages (e.g. notifications or updates)
|
||||
KAFKA_OFFLINEMSG_MONGO_TOPIC=${KAFKA_OFFLINEMSG_MONGO_TOPIC} # Topic in Kafka for storing offline messages in MongoDB
|
||||
|
||||
# Password to authenticate with the MongoDB service
|
||||
MONGO_PASSWORD=${MONGO_PASSWORD}
|
||||
# ----- MinIO Configuration -----
|
||||
MINIO_ADDRESS=${MINIO_ADDRESS} # Address or hostname for the MinIO object storage service
|
||||
MINIO_PORT=${MINIO_PORT} # Port on which MinIO object storage service is running
|
||||
MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY} # Access key to authenticate with the MinIO service
|
||||
MINIO_SECRET_KEY=${MINIO_SECRET_KEY} # Secret key corresponding to the access key for MinIO authentication
|
||||
|
||||
# Name of the database in MongoDB to be used
|
||||
MONGO_DATABASE=${MONGO_DATABASE}
|
||||
# ----- Prometheus Configuration -----
|
||||
PROMETHEUS_ADDRESS=${PROMETHEUS_ADDRESS} # Address or hostname for the Prometheus service
|
||||
PROMETHEUS_PORT=${PROMETHEUS_PORT} # Port on which Prometheus service is running
|
||||
|
||||
# Port on which Redis in-memory data structure store is running
|
||||
REDIS_PORT=${REDIS_PORT}
|
||||
|
||||
# Password to authenticate with the Redis service
|
||||
REDIS_PASSWORD=${REDIS_PASSWORD}
|
||||
|
||||
# Port on which Kafka distributed streaming platform is running
|
||||
KAFKA_PORT=${KAFKA_PORT}
|
||||
|
||||
# Address or hostname for the Kafka service
|
||||
KAFKA_ADDR=${KAFKA_ADDR}
|
||||
|
||||
# Topic in Kafka for storing the latest messages in Redis
|
||||
KAFKA_LATESTMSG_REDIS_TOPIC=${KAFKA_LATESTMSG_REDIS_TOPIC}
|
||||
|
||||
# Topic in Kafka for pushing messages (e.g. notifications or updates)
|
||||
KAFKA_MSG_PUSH_TOPIC=${KAFKA_MSG_PUSH_TOPIC}
|
||||
|
||||
# Topic in Kafka for storing offline messages in MongoDB
|
||||
KAFKA_OFFLINEMSG_MONGO_TOPIC=${KAFKA_OFFLINEMSG_MONGO_TOPIC}
|
||||
|
||||
# Port on which MinIO object storage service is running
|
||||
MINIO_PORT=${MINIO_PORT}
|
||||
|
||||
# Access key to authenticate with the MinIO service
|
||||
MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY}
|
||||
|
||||
# Secret key corresponding to the access key for MinIO authentication
|
||||
MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
||||
# ----- Grafana Configuration -----
|
||||
GRAFANA_ADDRESS=${GRAFANA_ADDRESS} # Address or hostname for the Grafana service
|
||||
GRAFANA_PORT=${GRAFANA_PORT} # Port on which Grafana service is running
|
||||
|
||||
# ================== OpenIM Web ===========================
|
||||
OPENIM_WEB_DIST_PATH=${OPENIM_WEB_DIST_PATH}
|
||||
OPENIM_WEB_PPRT=${OPENIM_WEB_PPRT}
|
||||
OPENIM_WEB_DIST_PATH=${OPENIM_WEB_DIST_PATH} # Path to the OpenIM web distribution
|
||||
OPENIM_WEB_PORT=${OPENIM_WEB_PORT} # Port on which OpenIM web service is running
|
||||
OPENIM_WEB_ADDRESS=${OPENIM_WEB_ADDRESS} # Address or hostname for the OpenIM web service
|
||||
|
||||
# =================== OpenIM Server =========================
|
||||
OPENIM_SERVER_ADDRESS=${OPENIM_SERVER_ADDRESS} # Address or hostname for the OpenIM server
|
||||
OPENIM_WS_PORT=${OPENIM_WS_PORT} # Port for the OpenIM WebSockets
|
||||
API_OPENIM_PORT=${API_OPENIM_PORT} # Port for the OpenIM API
|
||||
|
||||
# =================== BRANCH NAME =========================
|
||||
CHAT_BRANCH=${CHAT_BRANCH}
|
||||
SERVER_BRANCH=${SERVER_BRANCH}
|
||||
# =================== OpenIM Chat ===========================
|
||||
CHAT_BRANCH=${CHAT_BRANCH} # Branch name for OpenIM chat
|
||||
OPENIM_CHAT_ADDRESS=${OPENIM_CHAT_ADDRESS} # Address or hostname for the OpenIM chat service
|
||||
OPENIM_CHAT_API_PORT=${OPENIM_CHAT_API_PORT} # Port for the OpenIM chat API
|
||||
OPENIM_CHAT_DATA_DIR=${OPENIM_CHAT_DATA_DIR} # Directory path for storing data files or related information
|
||||
|
||||
# =================== OpenIM Admin ==========================
|
||||
SERVER_BRANCH=${SERVER_BRANCH} # Branch name for OpenIM server
|
||||
OPENIM_ADMIN_API_PORT=${OPENIM_ADMIN_API_PORT} # Port for the OpenIM admin API
|
||||
|
||||
@ -86,7 +86,7 @@ redis:
|
||||
kafka:
|
||||
username: ${KAFKA_USERNAME}
|
||||
password: ${KAFKA_PASSWORD}
|
||||
addr: [ ${KAFKA_ADDR}:${KAFKA_PORT} ]
|
||||
addr: [ ${KAFKA_ADDRESS}:${KAFKA_PORT} ]
|
||||
latestMsgToRedis:
|
||||
topic: "${KAFKA_LATESTMSG_REDIS_TOPIC}"
|
||||
offlineMsgToMongo:
|
||||
|
||||
@ -24,12 +24,17 @@ OPENIM_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd -P)"
|
||||
LOCAL_OUTPUT_ROOT=""${OPENIM_ROOT}"/${OUT_DIR:-_output}"
|
||||
source "${OPENIM_ROOT}/scripts/lib/init.sh"
|
||||
|
||||
#TODO
|
||||
#TODO: Access to the IP networks outside, or you want to use the IP network
|
||||
# IP=http://127.0.0.1
|
||||
if [ -z "${IP}" ]; then
|
||||
IP=$(openim::util::get_server_ip)
|
||||
fi
|
||||
|
||||
# config.gateway custom bridge modes
|
||||
# if [ -z "{IP_GATEWAY}" ] then
|
||||
# IP_GATEWAY=$(openim::util::get_local_ip)
|
||||
# fi
|
||||
|
||||
function def() {
|
||||
local var_name="$1"
|
||||
local default_value="${2:-}"
|
||||
@ -66,6 +71,43 @@ def "ENV_FILE" ""${OPENIM_ROOT}"/scripts/install/environment.sh"
|
||||
def "CHAT_BRANCH" "main"
|
||||
def "SERVER_BRANCH" "main"
|
||||
|
||||
###################### OpenIM Docker Network ######################
|
||||
# 设置 Docker 网络的网段
|
||||
readonly DOCKER_BRIDGE_SUBNET=${DOCKER_BRIDGE_SUBNET:-'172.28.0.0/16'}
|
||||
|
||||
IP_PREFIX=$(echo $DOCKER_BRIDGE_SUBNET | cut -d '/' -f 1)
|
||||
SUBNET=$(echo $DOCKER_BRIDGE_SUBNET | cut -d '/' -f 2)
|
||||
LAST_OCTET=$(echo $IP_PREFIX | cut -d '.' -f 4)
|
||||
|
||||
generate_ip() {
|
||||
local NEW_IP="$(echo $IP_PREFIX | cut -d '.' -f 1-3).$((LAST_OCTET++))"
|
||||
echo $NEW_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)
|
||||
LAST_OCTET=$((LAST_OCTET + 1))
|
||||
KAFKA_NETWORK_ADDRESS=$(generate_ip)
|
||||
LAST_OCTET=$((LAST_OCTET + 1))
|
||||
ZOOKEEPER_NETWORK_ADDRESS=$(generate_ip)
|
||||
LAST_OCTET=$((LAST_OCTET + 1))
|
||||
MINIO_NETWORK_ADDRESS=$(generate_ip)
|
||||
LAST_OCTET=$((LAST_OCTET + 1))
|
||||
OPENIM_WEB_NETWORK_ADDRESS=$(generate_ip)
|
||||
LAST_OCTET=$((LAST_OCTET + 1))
|
||||
OPENIM_SERVER_NETWORK_ADDRESS=$(generate_ip)
|
||||
LAST_OCTET=$((LAST_OCTET + 1))
|
||||
OPENIM_CHAT_NETWORK_ADDRESS=$(generate_ip)
|
||||
LAST_OCTET=$((LAST_OCTET + 1))
|
||||
PROMETHEUS_NETWORK_ADDRESS=$(generate_ip)
|
||||
LAST_OCTET=$((LAST_OCTET + 1))
|
||||
GRAFANA_NETWORK_ADDRESS=$(generate_ip)
|
||||
|
||||
###################### openim 配置 ######################
|
||||
# read: https://github.com/OpenIMSDK/Open-IM-Server/blob/main/deployment/init/README.md
|
||||
def "OPENIM_DATA_DIR" "/data/openim"
|
||||
@ -75,10 +117,20 @@ def "OPENIM_LOG_DIR" "/var/log/openim"
|
||||
def "CA_FILE" "${OPENIM_CONFIG_DIR}/cert/ca.pem"
|
||||
|
||||
def "OPNEIM_CONFIG" ""${OPENIM_ROOT}"/config"
|
||||
def "OPENIM_SERVER_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # OpenIM服务地址
|
||||
|
||||
# OpenIM Web
|
||||
def "OPENIM_WEB_DIST_PATH" "/app/dist"
|
||||
def "OPENIM_WEB_PPRT" "11001"
|
||||
# OpenIM Websocket端口
|
||||
readonly OPENIM_WS_PORT=${OPENIM_WS_PORT:-'10001'}
|
||||
|
||||
# OpenIM API端口
|
||||
readonly API_OPENIM_PORT=${API_OPENIM_PORT:-'10002'}
|
||||
def "API_LISTEN_IP" "0.0.0.0" # API的监听IP
|
||||
|
||||
###################### openim-chat 配置信息 ######################
|
||||
def "OPENIM_CHAT_DATA_DIR" "./openim-chat/${CHAT_BRANCH}"
|
||||
def "OPENIM_CHAT_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # OpenIM服务地址
|
||||
def "OPENIM_CHAT_API_PORT" "10008" # OpenIM API端口
|
||||
def "OPENIM_ADMIN_API_PORT" "10009" # OpenIM Admin API端口
|
||||
|
||||
# TODO 注意: 一般的配置都可以使用 def 函数来定义,如果是包含特殊字符,比如说:
|
||||
# TODO readonly MSG_DESTRUCT_TIME=${MSG_DESTRUCT_TIME:-'0 2 * * *'}
|
||||
@ -86,14 +138,14 @@ def "OPENIM_WEB_PPRT" "11001"
|
||||
|
||||
###################### Zookeeper 配置信息 ######################
|
||||
def "ZOOKEEPER_SCHEMA" "openim" # Zookeeper的模式
|
||||
def "ZOOKEEPER_PORT" "2181" # Zookeeper的端口
|
||||
def "ZOOKEEPER_ADDRESS" "127.0.0.1" # Zookeeper的地址
|
||||
def "ZOOKEEPER_PORT" "12181" # Zookeeper的端口
|
||||
def "ZOOKEEPER_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # Zookeeper的地址
|
||||
def "ZOOKEEPER_USERNAME" "" # Zookeeper的用户名
|
||||
def "ZOOKEEPER_PASSWORD" "" # Zookeeper的密码
|
||||
|
||||
###################### MySQL 配置信息 ######################
|
||||
def "MYSQL_PORT" "13306" # MySQL的端口
|
||||
def "MYSQL_ADDRESS" "127.0.0.1" # MySQL的地址
|
||||
def "MYSQL_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # MySQL的地址
|
||||
def "MYSQL_USERNAME" "${USER}" # MySQL的用户名
|
||||
def "MYSQL_PASSWORD" "${PASSWORD}" # MySQL的密码
|
||||
def "MYSQL_DATABASE" "${DATABASE_NAME}" # MySQL的数据库名
|
||||
@ -106,7 +158,7 @@ def "MYSQL_SLOW_THRESHOLD" "500" # 慢查询阈值(毫秒)
|
||||
###################### MongoDB 配置信息 ######################
|
||||
def "MONGO_URI" # MongoDB的URI
|
||||
def "MONGO_PORT" "37017" # MongoDB的端口
|
||||
def "MONGO_ADDRESS" "127.0.0.1" # MongoDB的地址
|
||||
def "MONGO_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # MongoDB的地址
|
||||
def "MONGO_DATABASE" "${DATABASE_NAME}" # MongoDB的数据库名
|
||||
def "MONGO_USERNAME" "${USER}" # MongoDB的用户名
|
||||
def "MONGO_PASSWORD" "${PASSWORD}" # MongoDB的密码
|
||||
@ -114,16 +166,19 @@ def "MONGO_MAX_POOL_SIZE" "100" # 最大连接池大小
|
||||
|
||||
###################### Object 配置信息 ######################
|
||||
def "OBJECT_ENABLE" "minio" # 对象是否启用
|
||||
def "OBJECT_APIURL" "http://${IP}:10002" # 对象的API地址
|
||||
# 对象的API地址
|
||||
readonly OBJECT_APIURL=${OBJECT_APIURL:-"http://${IP}:10002"}
|
||||
def "MINIO_BUCKET" "openim" # MinIO的存储桶名称
|
||||
def "MINIO_PORT" "10005" # MinIO的端口
|
||||
# MinIO的端点URL
|
||||
readonly MINIO_ENDPOINT=${MINIO_ENDPOINT:-"http://127.0.0.1:${MINIO_PORT}"}
|
||||
def MINIO_ADDRESS "${DOCKER_BRIDGE_GATEWAY}"
|
||||
readonly MINIO_ENDPOINT=${MINIO_ENDPOINT:-"http://${MINIO_ADDRESS}:${MINIO_PORT}"}
|
||||
def "MINIO_ACCESS_KEY" "${USER}" # MinIO的访问密钥ID
|
||||
def "MINIO_SECRET_KEY" "${PASSWORD}" # MinIO的密钥
|
||||
def "MINIO_SESSION_TOKEN" # MinIO的会话令牌
|
||||
readonly MINIO_SIGN_ENDPOINT=${MINIO_SIGN_ENDPOINT:-"http://${IP}:${MINIO_PORT}"} # signEndpoint为minio公网地址 # MinIO的会话令牌
|
||||
def "COS_BUCKET_URL" "https://temp-1252357374.cos.ap-chengdu.myqcloud.com" # 腾讯云COS的存储桶URL
|
||||
# 腾讯云COS的存储桶URL
|
||||
def "COS_BUCKET_URL" "https://temp-1252357374.cos.ap-chengdu.myqcloud.com"
|
||||
def "COS_SECRET_ID" # 腾讯云COS的密钥ID
|
||||
def "COS_SECRET_KEY" # 腾讯云COS的密钥
|
||||
def "COS_SESSION_TOKEN" # 腾讯云COS的会话令牌
|
||||
@ -136,15 +191,15 @@ def "OSS_SESSION_TOKEN"
|
||||
|
||||
###################### Redis 配置信息 ######################
|
||||
def "REDIS_PORT" "16379" # Redis的端口
|
||||
def "REDIS_ADDRESS" "127.0.0.1" # Redis的地址
|
||||
def "REDIS_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # Redis的地址
|
||||
def "REDIS_USERNAME" # Redis的用户名
|
||||
def "REDIS_PASSWORD" "${PASSWORD}" # Redis的密码
|
||||
|
||||
###################### Kafka 配置信息 ######################
|
||||
def "KAFKA_USERNAME" # `Kafka` 的用户名
|
||||
def "KAFKA_PASSWORD" # `Kafka` 的密码
|
||||
def "KAFKA_PORT" "9092" # `Kafka` 的端口
|
||||
def "KAFKA_ADDR" "127.0.0.1" # `Kafka` 的地址
|
||||
def "KAFKA_PORT" "19092" # `Kafka` 的端口
|
||||
def "KAFKA_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # `Kafka` 的地址
|
||||
def "KAFKA_LATESTMSG_REDIS_TOPIC" "latestMsgToRedis" # `Kafka` 的最新消息到Redis的主题
|
||||
def "KAFKA_OFFLINEMSG_MONGO_TOPIC" "offlineMsgToMongoMysql" # `Kafka` 的离线消息到Mongo的主题
|
||||
def "KAFKA_MSG_PUSH_TOPIC" "msgToPush" # `Kafka` 的消息到推送的主题
|
||||
@ -153,14 +208,22 @@ def "KAFKA_CONSUMERGROUPID_MONGO" "mongo" # `Kafka` 的消费
|
||||
def "KAFKA_CONSUMERGROUPID_MYSQL" "mysql" # `Kafka` 的消费组ID到MySql
|
||||
def "KAFKA_CONSUMERGROUPID_PUSH" "push" # `Kafka` 的消费组ID到推送
|
||||
|
||||
###################### RPC 配置信息 ######################
|
||||
def "RPC_REGISTER_IP" # RPC的注册IP
|
||||
def "RPC_LISTEN_IP" "0.0.0.0" # RPC的监听IP
|
||||
###################### openim-web 配置信息 ######################
|
||||
def "OPENIM_WEB_PORT" "11001" # openim-web的端口
|
||||
def "OPENIM_WEB_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # openim-web的地址
|
||||
def "OPENIM_WEB_DIST_PATH" "/app/dist" # openim-web的dist路径
|
||||
|
||||
###################### API 配置信息 ######################
|
||||
# API的开放端口, 只能设置一个端口
|
||||
readonly API_OPENIM_PORT=${API_OPENIM_PORT:-'10002'}
|
||||
def "API_LISTEN_IP" "0.0.0.0" # API的监听IP
|
||||
###################### RPC 配置信息 ######################
|
||||
def "RPC_REGISTER_IP" # RPC的注册IP
|
||||
def "RPC_LISTEN_IP" "0.0.0.0" # RPC的监听IP
|
||||
|
||||
###################### prometheus 配置 ######################
|
||||
def "PROMETHEUS_PORT" "19090" # Prometheus的端口
|
||||
def "PROMETHEUS_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # Prometheus的地址
|
||||
|
||||
###################### Grafana 配置信息 ######################
|
||||
def "GRAFANA_PORT" "3000" # Grafana的端口
|
||||
def "GRAFANA_ADDRESS" "${DOCKER_BRIDGE_GATEWAY}" # Grafana的地址
|
||||
|
||||
###################### RPC Port Configuration Variables ######################
|
||||
# For launching multiple programs, just fill in multiple ports separated by commas
|
||||
@ -207,8 +270,6 @@ def "LOG_IS_JSON" "false" # 日志是否为JSON格式
|
||||
def "LOG_WITH_STACK" "false" # 日志是否带有堆栈信息
|
||||
|
||||
###################### Variables definition ######################
|
||||
# OpenIM WS端口
|
||||
readonly OPENIM_WS_PORT=${OPENIM_WS_PORT:-'10001'}
|
||||
def "WEBSOCKET_MAX_CONN_NUM" "100000" # Websocket最大连接数
|
||||
def "WEBSOCKET_MAX_MSG_LEN" "4096" # Websocket最大消息长度
|
||||
def "WEBSOCKET_TIMEOUT" "10" # Websocket超时
|
||||
|
||||
@ -268,7 +268,7 @@ openim::util::check_ports() {
|
||||
# Iterate over each given port.
|
||||
for port in "$@"; do
|
||||
# Use the `ss` command to find process information related to the given port.
|
||||
local info=$(ss -ltnp | grep -w ":$port" || true)
|
||||
local info=$(ss -ltnp | grep ":$port" || true)
|
||||
|
||||
# If there's no process information, it means the process associated with the port is not running.
|
||||
if [[ -z $info ]]; then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user