fix: docker file path (#495)

* fix: docker file path

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

* fix: docker file path

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

* fix: fix scripts

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

---------

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

@ -100,8 +100,8 @@ services:
openim_server:
image: openim/open_im_server:v3.0.1
container_name: open_im_server
image: ghcr.io/openimsdk/openim-server:v3.0.0
container_name: openim-server
volumes:
- ./logs:/Open-IM-Server/logs
- ./config/config.yaml:/Open-IM-Server/config/config.yaml

@ -84,6 +84,7 @@ func (r *RootCmd) GetPrometheusPortFlag() int {
func (r *RootCmd) getConfFromCmdAndInit(cmdLines *cobra.Command) error {
configFolderPath, _ := cmdLines.Flags().GetString(constant.FlagConf)
fmt.Println("configFolderPath:", configFolderPath)
return config.InitConfig(configFolderPath)
}

@ -57,10 +57,11 @@ for i in ${service_port_name[*]}; do
done
#Check launched service process
check=$(ps aux | grep -w ./${openim-msgtransfer} | grep -v grep | wc -l)
check=$(ps aux | grep -w ./${openim_msgtransfer} | grep -v grep | wc -l)
if [ $check -eq ${msg_transfer_service_num} ]; then
echo -e ${GREEN_PREFIX}"none port has been listening,belongs service is openImMsgTransfer"${COLOR_SUFFIX}
else
echo $check ${msg_transfer_service_num}
echo -e ${RED_PREFIX}"openImMsgTransfer service does not start normally, num err"${COLOR_SUFFIX}
echo -e ${RED_PREFIX}"please check $OPENIM_ROOT/logs/openIM.log "${COLOR_SUFFIX}
exit -1

@ -16,6 +16,10 @@
#fixme This scripts is the total startup scripts
#fixme The full name of the shell scripts that needs to be started is placed in the need_to_start_server_shell array
#Include shell font styles and some basic information
SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
#fixme Put the shell scripts name here
need_to_start_server_shell=(
start_rpc_service.sh

@ -61,7 +61,7 @@ sleep 1
cd ${msg_gateway_binary_root}
for ((i = 0; i < ${#ws_ports[@]}; i++)); do
echo "==========================start msg_gateway server===========================">>$OPENIM_ROOT/logs/openIM.log
nohup ./${openim_msggateway} --port ${rpc_ports[$i]} --ws_port ${ws_ports[$i]} --prometheus_port ${prome_ports[$i]} >>$OPENIM_ROOT/logs/openIM.log 2>&1 &
nohup ./${openim_msggateway} --port ${rpc_ports[$i]} --ws_port ${ws_ports[$i]} --prometheus_port ${prome_ports[$i]} --config_folder_path ${configfile_path} >>$OPENIM_ROOT/logs/openIM.log 2>&1 &
done
#Check launched service process

@ -52,9 +52,9 @@ sleep 1
cd ${msg_transfer_binary_root}
for ((i = 0; i < ${msg_transfer_service_num}; i++)); do
prome_port=${prome_ports[$i]}
cmd="nohup ./${openim_msgtransfer}"
cmd="nohup ./${openim_msgtransfer} --config_folder_path ${configfile_path}"
if [ $prome_port != "" ]; then
cmd="$cmd --prometheus_port $prome_port"
cmd="$cmd --prometheus_port $prome_port --config_folder_path ${configfile_path}"
fi
echo "==========================start msg_transfer server===========================">>$OPENIM_ROOT/logs/openIM.log
$cmd >>$OPENIM_ROOT/logs/openIM.log 2>&1 &

@ -65,8 +65,12 @@ cmd_utils_name="openim-cmdutils"
cmd_utils_binary_root="$OPENIM_ROOT/$BIN_DIR"
cmd_utils_source_root="$OPENIM_ROOT/cmd/openim-cmdutils/"
echo "debug========> config_path=$config_path"
# Global configuration file default dir
config_path="$OPENIM_ROOT/config/config.yaml"
configfile_path="$OPENIM_ROOT/config"
echo "BUG: debug========> config_path=$config_path"
# servicefile dir path
service_source_root=(
@ -104,4 +108,4 @@ service_names=(
"${msg_name}"
"${push_name}"
# "${sdk_server_name}"
)
)

@ -50,6 +50,8 @@ echo -e "${BOLD_PREFIX}${CYAN_PREFIX}Server Start Time: ${time}${COLOR_SUFFIX}"
# Print section separator
echo -e "${PURPLE_PREFIX}==========================================================${COLOR_SUFFIX}"
cd $SCRIPTS_ROOT
# FIXME Put the shell script names here
need_to_start_server_shell=(
start_rpc_service.sh
@ -82,4 +84,4 @@ done
echo -e "${PURPLE_PREFIX}==========================================================${COLOR_SUFFIX}"
# Print completion message
echo -e "${GREEN_PREFIX}${BOLD_PREFIX}OpenIM Server has been started successfully!${COLOR_SUFFIX}"
echo -e "${GREEN_PREFIX}${BOLD_PREFIX}OpenIM Server has been started successfully!${COLOR_SUFFIX}"

@ -95,21 +95,24 @@ for ((i = 0; i < ${#service_filename[*]}; i++)); do
portList2=$(cat $config_path | grep ${service_prometheus_port_name[$i]} | awk -F '[:]' '{print $NF}')
list_to_string $portList2
echo -e "debug========>cmd=$cmd AAAAA"
prome_ports=($ports_array)
#Start related rpc services based on the number of ports
for ((j = 0; j < ${#service_ports[*]}; j++)); do
#Start the service in the background
if [ -z "${prome_ports[$j]}" ]; then
cmd="./${service_filename[$i]} --port ${service_ports[$j]}"
cmd="./${service_filename[$i]} --port ${service_ports[$j]} --config_folder_path ${configfile_path}"
else
cmd="./${service_filename[$i]} --port ${service_ports[$j]} --prometheus_port ${prome_ports[$j]}"
cmd="./${service_filename[$i]} --port ${service_ports[$j]} --prometheus_port ${prome_ports[$j]} --config_folder_path ${configfile_path}"
fi
if [ $i -eq 0 -o $i -eq 1 ]; then
cmd="./${service_filename[$i]} --port ${service_ports[$j]}"
fi
echo $cmd
echo -e "debug========>cmd=$cmd"
echo "=====================start ${service_filename[$i]}======================">>$OPENIM_ROOT/logs/openIM.log
nohup $cmd >>$OPENIM_ROOT/logs/openIM.log 2>&1 &
echo -e "debug========>OpenIMROOT=$OPENIM_ROOT"
sleep 1
pid="netstat -ntlp|grep $j |awk '{printf \$7}'|cut -d/ -f1"
echo -e "${GREEN_PREFIX}${service_filename[$i]} start success,port number:${service_ports[$j]} pid:$(eval $pid)$COLOR_SUFFIX"

@ -14,6 +14,7 @@
# limitations under the License.
#Include shell font styles and some basic information
SCRIPTS_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
#Include shell font styles and some basic information
@ -25,7 +26,7 @@ bin_dir="$BIN_DIR"
logs_dir="$OPENIM_ROOT/logs"
sdk_db_dir="$OPENIM_ROOT/sdk/db/"
cd "$OPENIM_ROOT/scripts/"
cd "$SCRIPTS_ROOT"
for i in ${service_names[*]}; do
#Check whether the service exists

Loading…
Cancel
Save