Skip to content

Commit

Permalink
add some error detail info for situation when bundlePathClasspath is …
Browse files Browse the repository at this point in the history
…null
  • Loading branch information
baisui1981 committed Mar 19, 2024
1 parent f98750c commit 3596b3a
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ public class Config extends BasicConfig {

public static final String PLUGIN_LIB_DIR = "WEB-INF/lib";


public static void main(String[] args) {
System.out.println(Config.class.getResource("/"));
}

public static File getPluginLibDir(String pluginName, boolean validateExist) {
File libDir = new File(Config.getDataDir(), Config.LIB_PLUGINS_PATH + "/" + pluginName + "/" + PLUGIN_LIB_DIR);
if (validateExist && (!libDir.exists() || libDir.isFile())) {
Expand Down Expand Up @@ -489,7 +494,14 @@ protected String getProp(String key) {
return new P() {
@Override
protected InputStream getOriginSource() {
return Config.class.getResourceAsStream(bundlePathClasspath);

InputStream source = Config.class.getResourceAsStream(bundlePathClasspath);
if (source == null) {
throw new NullPointerException("bundlePathClasspath:"
+ bundlePathClasspath + " relevant inputStream can not be null,classpath root:"
+ Config.class.getResource("/"));
}
return source;
}

@Override
Expand Down
83 changes: 62 additions & 21 deletions tis-console.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,80 @@ spec:
type: LoadBalancer
---

#apiVersion: v1
#kind: PersistentVolume
#metadata:
# name: pv-oss
#spec:
# capacity:
# storage: 5Gi
# accessModes:
# - ReadWriteMany
# storageClassName: oss
# flexVolume:
# driver: "alicloud/oss"
# options:
# bucket: "incr-log"
# url: "oss-cn-hangzhou.aliyuncs.com"
# path: "/tis-pv"
# akId: ""
# akSecret: ""
# otherOpts: "-o max_stat_cache_size=0 -o allow_other"
#---
#kind: PersistentVolumeClaim
#apiVersion: v1
#metadata:
# name: tis-console-pvc-oss
#spec:
# storageClassName: oss
# accessModes:
# - ReadWriteMany
# resources:
# requests:
# storage: 5Gi

apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-oss
name: csi-pv
labels:
alicloud-pvname: disk-pv
spec:
capacity:
storage: 5Gi
storage: 20Gi
accessModes:
- ReadWriteMany
storageClassName: oss
flexVolume:
driver: "alicloud/oss"
options:
bucket: "incr-log"
url: "oss-cn-hangzhou.aliyuncs.com"
path: "/tis-pv"
akId: ""
akSecret: ""
otherOpts: "-o max_stat_cache_size=0 -o allow_other"
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
csi:
driver: diskplugin.csi.alibabacloud.com
volumeHandle: "d-bp15tdr3q90sxxz2l0dz"
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: topology.diskplugin.csi.alibabacloud.com/zone
operator: In
values:
- "cn-hangzhou-k"
---
kind: PersistentVolumeClaim

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tis-console-pvc-oss
name: disk-pvc
spec:
storageClassName: oss
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storage: 20Gi
selector:
matchLabels:
alicloud-pvname: disk-pv

---
# how to use aliyun pv: https://help.aliyun.com/zh/ack/ack-managed-and-ack-dedicated/user-guide/mount-a-statically-provisioned-oss-volume?spm=a2c4g.11186623.0.0.39145057wGt7rB
# 使用 云盘:https://help.aliyun.com/zh/ack/ack-managed-and-ack-dedicated/user-guide/use-a-statically-provisioned-disk-volume?spm=a2c4g.11186623.0.i5
apiVersion: v1
kind: ReplicationController
metadata:
Expand All @@ -62,15 +103,15 @@ spec:
containers:
- name: tis-console
volumeMounts:
- name: tis-console-pvc-oss
- name: tis-console-pvc
mountPath: "/opt/data"
image: registry.cn-hangzhou.aliyuncs.com/tis/tis-console:4.0.0
ports:
- name: tis-8080
containerPort: 8080
volumes:
- name: tis-console-pvc-oss
- name: tis-console-pvc
persistentVolumeClaim:
claimName: tis-console-pvc-oss
claimName: disk-pvc
---

Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ private static List<String> convert2BatchSql(TISDataSourceFactory.SystemDBInit d


void copyDataTarToLocal() throws IOException {
final String dataPkgName = "tis-data2.tar.gz";
final String dataPkgName = "tis-data.tar.gz";
URL dataPkg = UpdateCenterResource.getTISTarPkg(dataPkgName);
File tmpDataDir = FileUtils.getTempDirectory();// Config.getDataDir();
HttpUtils.get(dataPkg, new StreamProcess<Void>() {
Expand Down

0 comments on commit 3596b3a

Please sign in to comment.