mirror of https://github.com/milvus-io/milvus.git
[skip e2e]Update export log script (#21654)
Signed-off-by: zhuwenxing <wenxing.zhu@zilliz.com>pull/21664/head
parent
49f53003e9
commit
76c0292bca
|
@ -64,7 +64,7 @@ body:
|
|||
- type: textarea
|
||||
attributes:
|
||||
label: Milvus Log
|
||||
description: Detailed error log information is helpful for finding Milvus problems. You can use this <a href="https://github.com/milvus-io/milvus/tree/master/deployments/export-log" target="_blank">script</a> to export Milvus logs.
|
||||
description: Detailed error log information is helpful for finding Milvus problems. **You can use this <a href="https://github.com/milvus-io/milvus/tree/master/deployments/export-log" target="_blank">script</a> to export Milvus logs.**
|
||||
validations:
|
||||
required: false
|
||||
- type: textarea
|
||||
|
@ -73,4 +73,4 @@ body:
|
|||
description: |
|
||||
Links? References? Anything that will give us more context about the issue you are encountering!
|
||||
validations:
|
||||
required: false
|
||||
required: false
|
|
@ -20,9 +20,9 @@ For better tracking and debugging Milvus, the script `export-milvus-log.sh` is p
|
|||
| e | Export etcd logs | false |
|
||||
| m | Export Minio logs | false |
|
||||
| p | Export pulsar logs | false |
|
||||
| k | Export Kafka logs | False |
|
||||
| k | Export Kafka logs | false |
|
||||
| s | Only return logs newer than a relative duration like 5s, 2m,or 3h. Defaults to all logs | all |
|
||||
|o |If milvus installed by milvus-operator |false |
|
||||
| o | If milvus installed by milvus-operator | false |
|
||||
> By default, the script only exports the logs of the Milvus component.
|
||||
>
|
||||
> If you need to export the logs of etcd, minio, and pulsar components, you need to add the parameters -e, -m, -p.
|
||||
|
|
|
@ -28,8 +28,8 @@ do
|
|||
m) minio="true";;
|
||||
p) pulsar="true";;
|
||||
k) kafka="true";;
|
||||
o) operator="true";;
|
||||
s) since=$OPTARG;;
|
||||
o) operator="true";;
|
||||
s) since=$OPTARG;;
|
||||
*) echo "Unkonwen parameters";;
|
||||
esac
|
||||
done
|
||||
|
@ -40,9 +40,11 @@ then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d $log_path ];
|
||||
if [ ! -d $log_path/pod_log ] || [ ! -d $log_dir/pod_log_previous ] || [ ! -d $log_dir/pod_describe ];
|
||||
then
|
||||
mkdir -p $log_path
|
||||
mkdir -p $log_path/pod_log
|
||||
mkdir -p $log_path/pod_log_previous
|
||||
mkdir -p $log_path/pod_describe
|
||||
fi
|
||||
|
||||
if [ $since ];
|
||||
|
@ -61,12 +63,14 @@ function export_log(){
|
|||
if [ $(kubectl get pod $pod -n $namespace --output=jsonpath={.status.containerStatuses[0].restartCount}) == 0 ];
|
||||
then
|
||||
echo "Export log of $pod"
|
||||
kubectl logs $pod -n $namespace ${since_args}> $log_path/$pod.log
|
||||
kubectl logs $pod -n $namespace ${since_args}> $log_path/pod_log/$pod.log
|
||||
else
|
||||
echo "Export log of $pod"
|
||||
kubectl logs $pod -n $namespace -p ${since_args}> $log_path/$pod-pre.log
|
||||
kubectl logs $pod -n $namespace ${since_args}> $log_path/$pod.log
|
||||
kubectl logs $pod -n $namespace -p ${since_args}> $log_path/pod_log_previous/$pod.log
|
||||
kubectl logs $pod -n $namespace ${since_args}> $log_path/pod_log/$pod.log
|
||||
fi
|
||||
echo "Export describe of $pod"
|
||||
kubectl describe pod $pod -n $namespace > $log_path/pod_describe/$pod.log
|
||||
done
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue