mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 09:05:59 +08:00
fix: scripts fix
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
# Wait for Kafka to be ready
|
||||
until /opt/bitnami/kafka/bin/kafka-topics.sh --list --bootstrap-server localhost:9092; do
|
||||
echo "Waiting for Kafka to be ready..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
# Create topics
|
||||
/opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 8 --topic latestMsgToRedis
|
||||
/opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 8 --topic msgToPush
|
||||
/opt/bitnami/kafka/bin/kafka-topics.sh --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 8 --topic offlineMsgToMongoMysql
|
||||
|
||||
echo "Topics created."
|
||||
@@ -38,7 +38,6 @@
|
||||
# Note: Before executing this script, ensure that the necessary permissions are granted and relevant environmental variables are set.
|
||||
#
|
||||
|
||||
|
||||
set -o errexit
|
||||
set +o nounset
|
||||
set -o pipefail
|
||||
@@ -122,7 +121,8 @@ function openim::rpc::start() {
|
||||
|
||||
# start all rpc services
|
||||
for ((i = 0; i < ${#OPENIM_RPC_SERVICE_LISTARIES[*]}; i++)); do
|
||||
openim::util::stop_services_with_name ${OPENIM_RPC_SERVICE_LISTARIES[$i]}
|
||||
# openim::util::stop_services_with_name ${OPENIM_RPC_SERVICE_LISTARIES
|
||||
openim::util::stop_services_on_ports {OPENIM_RPC_PORT_LISTARIES[$i]}
|
||||
openim::log::info "OpenIM ${OPENIM_RPC_SERVICE_LISTARIES[$i]} config path: ${OPENIM_RPC_CONFIG}"
|
||||
|
||||
# Get the service and Prometheus ports.
|
||||
|
||||
+6
-1
@@ -281,7 +281,12 @@ openim::util::check_ports() {
|
||||
local fd=$(echo $details | awk '{print $3}')
|
||||
|
||||
# Get the start time of the process using the PID
|
||||
local start_time=$(ps -p $pid -o lstart=)
|
||||
if [[ -z $pid ]]; then
|
||||
local start_time="N/A"
|
||||
else
|
||||
# Get the start time of the process using the PID
|
||||
local start_time=$(ps -p $pid -o lstart=)
|
||||
fi
|
||||
|
||||
started+=("Port $port - Command: $command, PID: $pid, FD: $fd, Started: $start_time")
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user