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
|
- type: textarea
|
||||||
attributes:
|
attributes:
|
||||||
label: Milvus Log
|
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:
|
validations:
|
||||||
required: false
|
required: false
|
||||||
- type: textarea
|
- type: textarea
|
||||||
|
@ -73,4 +73,4 @@ body:
|
||||||
description: |
|
description: |
|
||||||
Links? References? Anything that will give us more context about the issue you are encountering!
|
Links? References? Anything that will give us more context about the issue you are encountering!
|
||||||
validations:
|
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 |
|
| e | Export etcd logs | false |
|
||||||
| m | Export Minio logs | false |
|
| m | Export Minio logs | false |
|
||||||
| p | Export pulsar 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 |
|
| 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.
|
> 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.
|
> 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";;
|
m) minio="true";;
|
||||||
p) pulsar="true";;
|
p) pulsar="true";;
|
||||||
k) kafka="true";;
|
k) kafka="true";;
|
||||||
o) operator="true";;
|
o) operator="true";;
|
||||||
s) since=$OPTARG;;
|
s) since=$OPTARG;;
|
||||||
*) echo "Unkonwen parameters";;
|
*) echo "Unkonwen parameters";;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
@ -40,9 +40,11 @@ then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d $log_path ];
|
if [ ! -d $log_path/pod_log ] || [ ! -d $log_dir/pod_log_previous ] || [ ! -d $log_dir/pod_describe ];
|
||||||
then
|
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
|
fi
|
||||||
|
|
||||||
if [ $since ];
|
if [ $since ];
|
||||||
|
@ -61,12 +63,14 @@ function export_log(){
|
||||||
if [ $(kubectl get pod $pod -n $namespace --output=jsonpath={.status.containerStatuses[0].restartCount}) == 0 ];
|
if [ $(kubectl get pod $pod -n $namespace --output=jsonpath={.status.containerStatuses[0].restartCount}) == 0 ];
|
||||||
then
|
then
|
||||||
echo "Export log of $pod"
|
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
|
else
|
||||||
echo "Export log of $pod"
|
echo "Export log of $pod"
|
||||||
kubectl logs $pod -n $namespace -p ${since_args}> $log_path/$pod-pre.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
|
kubectl logs $pod -n $namespace ${since_args}> $log_path/pod_log/$pod.log
|
||||||
fi
|
fi
|
||||||
|
echo "Export describe of $pod"
|
||||||
|
kubectl describe pod $pod -n $namespace > $log_path/pod_describe/$pod.log
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue