apkipa 2 hónapja
szülő
commit
519a60af76

+ 2 - 2
main.go

@@ -5,7 +5,7 @@ import (
 	"context"
 	"encoding/binary"
 	"encoding/json"
-	"example/minio-into-ck/util"
+	"example/minio-into-stck/util"
 	"fmt"
 	"log"
 	"math"
@@ -28,7 +28,7 @@ import (
 var MYSQL_USER = "root"
 var MYSQL_PASSWORD = ""
 var MYSQL_HOST = "localhost:3306"
-var MYSQL_DATABASE = "minio-into-ck-db"
+var MYSQL_DATABASE = "minio-into-stck-db"
 var MINIO_ACCESS_KEY = "25cSXPqzdHrPwJkSIRkM"
 var MINIO_SECRET = "FN3AhQaVo7z1wgvce3IWiI1CI68T02OVeSUKCeRf"
 var MINIO_BUCKET = "bucket"

+ 0 - 26
minio-into-ck-installer/install.sh

@@ -1,26 +0,0 @@
-#! /bin/bash
-if [ $UID -ne 0 ]; then
-    echo "请用root用户运行当前脚本 (su root)" && exit 1
-fi
-if [ -r /opt/minio-into-ck/minio-into-ck  ];then
-      echo "/opt/minio-into-ck/minio-into-ck文件夹已存在,请重命名旧版本文件后再尝试"
-      exit
-fi
-root_dir=/opt/minio-into-ck
-
-if [ ! -d "$root_dir" ]; then
-        mkdir -p $root_dir
-fi
-
-tar zxf ./minio-into-ck.tar.gz -C $root_dir
-cp -f minio-into-ck.service /usr/lib/systemd/system/
-if [ ! -r /opt/minio-into-ck/minio-into-ck  ];then
-      echo "安装失败!"
-      exit
- else
-      echo "安装成功!"
-  fi
-chmod +x /opt/minio-into-ck/minio-into-ck/*.sh
-chmod +x /opt/minio-into-ck/minio-into-ck/minio-into-ck
-
-systemctl daemon-reload

+ 0 - 15
minio-into-ck-installer/minio-into-ck.service

@@ -1,15 +0,0 @@
-[Unit]
-Description=minio-into-ck
-After=minio-into-ck.service
-  
-[Service]
-Type=forking
-User=root
-Group=root
-ExecStart=/opt/minio-into-ck/minio-into-ck/run.sh
-ExecReload=/opt/minio-into-ck/minio-into-ck/restart.sh
-ExecStop=/opt/minio-into-ck/minio-into-ck/stop.sh
-PrivateTmp=true
-  
-[Install]
-WantedBy=multi-user.target

+ 0 - 13
minio-into-ck-installer/安装说明.txt

@@ -1,13 +0,0 @@
-version: v1.0.0
-install.sh脚本用于自动将minio-into-ck时序数据库安装在/opt/minio-into-ck/minio-into-ck下
-如存在旧版本文件需要重新命名
-(以下操作均需通过root用户执行)
-1. chmod +x *.sh给脚本可执行权限
-2. 执行./install.sh安装minio-into-ck
-3. 进入/opt/minio-into-ck/minio-into-ck路径下,完成授权操作
-4. 至此minio-into-ck可作为minio-into-ck服务运行
-启动:systemctl start minio-into-ck
-停止:systemctl stop minio-into-ck
-重启: systemctl restart minio-into-ck
-查看状态:systemctl status minio-into-ck
-开机自启:systemctl enable minio-into-ck

+ 26 - 0
minio-into-stck-installer/install.sh

@@ -0,0 +1,26 @@
+#! /bin/bash
+if [ $UID -ne 0 ]; then
+    echo "请用root用户运行当前脚本 (su root)" && exit 1
+fi
+if [ -r /opt/minio-into-stck/minio-into-stck  ];then
+      echo "/opt/minio-into-stck/minio-into-stck文件夹已存在,请重命名旧版本文件后再尝试"
+      exit
+fi
+root_dir=/opt/minio-into-stck
+
+if [ ! -d "$root_dir" ]; then
+        mkdir -p $root_dir
+fi
+
+tar zxf ./minio-into-stck.tar.gz -C $root_dir
+cp -f minio-into-stck.service /usr/lib/systemd/system/
+if [ ! -r /opt/minio-into-stck/minio-into-stck  ];then
+      echo "安装失败!"
+      exit
+ else
+      echo "安装成功!"
+  fi
+chmod +x /opt/minio-into-stck/minio-into-stck/*.sh
+chmod +x /opt/minio-into-stck/minio-into-stck/minio-into-stck
+
+systemctl daemon-reload

+ 15 - 0
minio-into-stck-installer/minio-into-ck.service

@@ -0,0 +1,15 @@
+[Unit]
+Description=minio-into-stck
+After=minio-into-stck.service
+  
+[Service]
+Type=forking
+User=root
+Group=root
+ExecStart=/opt/minio-into-stck/minio-into-stck/run.sh
+ExecReload=/opt/minio-into-stck/minio-into-stck/restart.sh
+ExecStop=/opt/minio-into-stck/minio-into-stck/stop.sh
+PrivateTmp=true
+  
+[Install]
+WantedBy=multi-user.target

+ 3 - 3
minio-into-ck-installer/uninstall.sh

@@ -2,7 +2,7 @@
 if [ $UID -ne 0 ]; then
     echo "请用root用户运行当前脚本 (su root)" && exit 1
 fi
-root_dir=/opt/minio-into-ck
+root_dir=/opt/minio-into-stck
 
 if [ ! -d "$root_dir" ]; then
         mkdir -p $root_dir
@@ -14,10 +14,10 @@ if [[ $root_dir == "/" ]]; then
     exit 1
 fi
 
-systemctl stop minio-into-ck
+systemctl stop minio-into-stck
 
 rm -rf $root_dir
-rm -f /usr/lib/systemd/system/minio-into-ck.service
+rm -f /usr/lib/systemd/system/minio-into-stck.service
 
 echo "卸载成功!"
 

+ 13 - 0
minio-into-stck-installer/安装说明.txt

@@ -0,0 +1,13 @@
+version: v1.0.0
+install.sh脚本用于自动将minio-into-stck时序数据库安装在/opt/minio-into-stck/minio-into-stck下
+如存在旧版本文件需要重新命名
+(以下操作均需通过root用户执行)
+1. chmod +x *.sh给脚本可执行权限
+2. 执行./install.sh安装minio-into-stck
+3. 进入/opt/minio-into-stck/minio-into-stck路径下,完成授权操作
+4. 至此minio-into-stck可作为minio-into-stck服务运行
+启动:systemctl start minio-into-stck
+停止:systemctl stop minio-into-stck
+重启: systemctl restart minio-into-stck
+查看状态:systemctl status minio-into-stck
+开机自启:systemctl enable minio-into-stck

minio-into-ck/minio-into-ck → minio-into-stck/minio-into-ck


minio-into-ck/restart.sh → minio-into-stck/restart.sh


+ 9 - 9
minio-into-ck/run.sh

@@ -43,7 +43,7 @@ else
 fi
 
 # parameter set
-log_path="./log/minio-into-ck/"
+log_path="./log/minio-into-stck/"
 
 # extra function
 if [[ ! -d "$base_dir/log" ]]; then
@@ -55,12 +55,12 @@ if [[ ! -d "$base_dir/lib" ]]; then
     log_err "缺少lib文件夹,请查证后重新运行此脚本" && exit 1
 fi
 
-if [[ ! -f "$base_dir/minio-into-ck" ]]; then
-    log_err "文件夹中缺少minio-into-ck(主程序),无法运行" && exit 1
+if [[ ! -f "$base_dir/minio-into-stck" ]]; then
+    log_err "文件夹中缺少minio-into-stck(主程序),无法运行" && exit 1
 fi
 
-if [[ ! -x "$base_dir/minio-into-ck" ]]; then
-    log_err "minio-into-ck无可执行权限,无法运行。请使用chmod" && exit 1
+if [[ ! -x "$base_dir/minio-into-stck" ]]; then
+    log_err "minio-into-stck无可执行权限,无法运行。请使用chmod" && exit 1
 fi
 
 if [[ ! -f "$base_dir/license/license_key.json" ]]; then
@@ -70,13 +70,13 @@ fi
 
 
 ###################################################################################################
-if ps -auxc | grep "minio-into-ck" | grep -v grep > /dev/null; then
-    log_info "minio-into-ck已在运行"
+if ps -auxc | grep "minio-into-stck" | grep -v grep > /dev/null; then
+    log_info "minio-into-stck已在运行"
 else
     if [[ ! -d $log_path ]]; then
         mkdir "$log_path"
     fi
-    log_file="minio-into-ck_$(date "+%Y-%m-%d-%H:%M:%S").log"
-    ./minio-into-ck server --config-file=$base_dir/config/config.xml &> "${log_path}${log_file}" &
+    log_file="minio-into-stck_$(date "+%Y-%m-%d-%H:%M:%S").log"
+    ./minio-into-stck server --config-file=$base_dir/config/config.xml &> "${log_path}${log_file}" &
     ./status.sh
 fi

+ 4 - 4
minio-into-ck/status.sh

@@ -8,14 +8,14 @@ base_dir=$(
     pwd
 )
 cd $base_dir
-server_pid=$(ps -auxc | grep minio-into-ck | grep -vE "grep|-Xmx700m" | awk '{print $2}')
+server_pid=$(ps -auxc | grep minio-into-stck | grep -vE "grep|-Xmx700m" | awk '{print $2}')
 if [[ $server_pid == "" ]]; then
-    echo "minio-into-ck 未在运行"
+    echo "minio-into-stck 未在运行"
 else
     running_time=$(ps -o etime= -p "$server_pid")
-    ports=$(ss -tnlp | grep minio-into-ck | awk '{print $4}')
+    ports=$(ss -tnlp | grep minio-into-stck | awk '{print $4}')
 
-    echo "minio-into-ck 当前PID: $server_pid"
+    echo "minio-into-stck 当前PID: $server_pid"
     echo "当前运行时间: $running_time" | tr -s " "
     echo "当前运行端口:"
     for i in "$ports"; do

+ 1 - 1
minio-into-ck/stop.sh

@@ -48,6 +48,6 @@ function stop_process() {
 }
 
 if [[ -z $1 ]]; then
-    stop_process "minio-into-ck"
+    stop_process "minio-into-stck"
     log_info "服务停止脚本运行完成"
 fi

+ 8 - 8
package.sh

@@ -9,19 +9,19 @@ mkdir -p $ROOT/tmp
 rm -rf $ROOT/tmp/*
 
 # ----- Start build -----
-go build -o $ROOT/minio-into-ck/minio-into-ck $ROOT/
+go build -o $ROOT/minio-into-stck/minio-into-stck $ROOT/
 
-cp -rf $ROOT/config $ROOT/minio-into-ck/
+cp -rf $ROOT/config $ROOT/minio-into-stck/
 # ----- End build -----
 
-cp -rf $ROOT/minio-into-ck $ROOT/tmp/
-cp -rf $ROOT/minio-into-ck-installer $ROOT/tmp/
+cp -rf $ROOT/minio-into-stck $ROOT/tmp/
+cp -rf $ROOT/minio-into-stck-installer $ROOT/tmp/
 
-mkdir -p $ROOT/tmp/minio-into-ck/lib
-mkdir -p $ROOT/tmp/minio-into-ck/log
+mkdir -p $ROOT/tmp/minio-into-stck/lib
+mkdir -p $ROOT/tmp/minio-into-stck/log
 
 cd $ROOT/tmp
-tar -zcf $ROOT/tmp/minio-into-ck-installer/minio-into-ck.tar.gz minio-into-ck
+tar -zcf $ROOT/tmp/minio-into-stck-installer/minio-into-stck.tar.gz minio-into-stck
 
 cd $ROOT
 if [ ! -d "release" ]; then
@@ -29,7 +29,7 @@ if [ ! -d "release" ]; then
 fi
 
 cd $ROOT/tmp
-tar -zcf $ROOT/release/minio-into-ck-installer-v${cur_date}.tar.gz minio-into-ck-installer
+tar -zcf $ROOT/release/minio-into-stck-installer-v${cur_date}.tar.gz minio-into-stck-installer
 
 rm -rf $ROOT/tmp/*
 rmdir $ROOT/tmp