Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ public class HdfsStorageConfig {
private String user = "";
private String url;
private String baseDir = "/user";
// the service config path
private String serviceConfigPath = System.getProperty("serviceConfigPath");

private Boolean enableKrb5Auth = false;
private String krb5ConfigPath = "./krb5.conf";
private String krb5ConfigPath = "krb5.conf";
// the auth principal, e.g.: [email protected]
private String krb5Principal = "";
// the keytab path
private String krb5KeytabPath = "./hdfs-wedpr.keytab";
private String krb5KeytabPath = "hdfs-wedpr.keytab";

public String getAbsPathInHdfs(String path) {
return getBaseDir() + File.separator + path;
Expand All @@ -32,6 +34,24 @@ public void setEnableKrb5Auth(Boolean enableKrb5Auth) {
this.enableKrb5Auth = enableKrb5Auth;
}

public String getServiceConfigPath() {
return serviceConfigPath;
}

public String getKrb5ConfigPath() {
if (krb5ConfigPath.startsWith("/") || serviceConfigPath == null) {
return krb5ConfigPath;
}
return serviceConfigPath + File.separator + krb5ConfigPath;
}

public String getKrb5KeytabPath() {
if (krb5KeytabPath.startsWith("/") || serviceConfigPath == null) {
return krb5KeytabPath;
}
return serviceConfigPath + File.separator + krb5KeytabPath;
}

public void check() {
// the user should non-empty
Common.requireNonEmpty("wedpr.storage.hdfs.user", user);
Expand All @@ -43,4 +63,30 @@ public void check() {
Common.requireNonEmpty("wedpr.storage.hdfs.krb5Principal", krb5Principal);
Common.requireNonEmpty("wedpr.storage.hdfs.krb5KeytabPath", krb5KeytabPath);
}

@Override
public String toString() {
return "HdfsStorageConfig{"
+ "user='"
+ user
+ '\''
+ ", url='"
+ url
+ '\''
+ ", baseDir='"
+ baseDir
+ '\''
+ ", enableKrb5Auth="
+ enableKrb5Auth
+ ", krb5ConfigPath='"
+ getKrb5ConfigPath()
+ '\''
+ ", krb5Principal='"
+ krb5Principal
+ '\''
+ ", krb5KeytabPath='"
+ getKrb5KeytabPath()
+ '\''
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,13 @@ public FsHandlerArgs(HdfsStorageConfig hdfsConfig) {
hadoopConf.set(StorageConstant.FS_URI_CONFIG_KEY, hdfsConfig.getUrl());
// enable the kerberos auth
if (hdfsConfig.getEnableKrb5Auth()) {

hadoopConf.set(
StorageConstant.FS_AUTH_CONFIG_KEY, StorageConstant.FS_Krb5_AUTH);
// specify the jaas configuration
hadoopConf.set(StorageConstant.Krb5_CONFIG_KEY, hdfsConfig.getKrb5ConfigPath());
System.setProperty(
StorageConstant.Krb5_CONFIG_KEY, hdfsConfig.getKrb5ConfigPath());
// specify the user-group-information
UserGroupInformation.setConfiguration(hadoopConf);
UserGroupInformation.loginUserFromKeytab(
Expand Down
3 changes: 3 additions & 0 deletions wedpr-pir/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ APP_MAIN=com.webank.wedpr.pir.main.PirApplication
LOG_DIR=.
SERVER_NAME="PPCS-PIR"
CLASSPATH='conf/:apps/*:lib/*'
CONFIG_PATH=${SHELL_FOLDER}/conf


STATUS_STARTING="Starting"
Expand Down Expand Up @@ -41,6 +42,8 @@ JAVA_OPTS+=" -Xmx256m -Xms256m -Xmn128m -Xss512k -XX:MetaspaceSize=128m -XX:MaxM
JAVA_OPTS+=" -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${SHELL_FOLDER}/heap_error.log"
#JAVA_OPTS+=" -XX:+UseG1GC -Xloggc:${LOG_DIR}/logs/${SERVER_NAME}-gc.log -XX:+PrintGCDateStamps"
JAVA_OPTS+=" -DserviceName=${SERVER_NAME}"
JAVA_OPTS+=" -DserviceConfigPath=${CONFIG_PATH}"

run_app()
{
nohup $JAVA_CMD $JAVA_OPTS -cp $CLASSPATH $APP_MAIN > start.out 2>&1 &
Expand Down
8 changes: 4 additions & 4 deletions wedpr-pir/conf/application-wedpr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ wedpr.storage.hdfs.url=hdfs://wedpr-0001:9900

# the auth information for hdfs
# enable krb5 auth or not
wedpr.storage.hdfs.enableKrb5Auth = false
wedpr.storage.hdfs.enableKrb5Auth=false
# the krb5 config file, only required when enableKrb5Auth
wedpr.storage.hdfs.krb5ConfigPath = ./krb5.conf
wedpr.storage.hdfs.krb5ConfigPath=./krb5.conf
# the krb5 principal, only required when enableKrb5Auth
wedpr.storage.hdfs.krb5Principal =
wedpr.storage.hdfs.krb5Principal=
# the keytab path, only required when enableKrb5Auth
wedpr.storage.hdfs.krb5KeytabPath = ./hdfs-wedpr.keytab
wedpr.storage.hdfs.krb5KeytabPath=./hdfs-wedpr.keytab

springfox.documentation.enabled=true
spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER
3 changes: 2 additions & 1 deletion wedpr-site/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ APP_MAIN=com.webank.wedpr.site.main.SiteServiceApplication
LOG_DIR=.
SERVER_NAME="WEDPR-SITE"
CLASSPATH='conf/:apps/*:lib/*'

CONFIG_PATH=${SHELL_FOLDER}/conf

STATUS_STARTING="Starting"
STATUS_RUNNING="Running"
Expand Down Expand Up @@ -41,6 +41,7 @@ JAVA_OPTS+=" -Xmx256m -Xms256m -Xmn128m -Xss512k -XX:MetaspaceSize=128m -XX:MaxM
JAVA_OPTS+=" -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${SHELL_FOLDER}/heap_error.log"
#JAVA_OPTS+=" -XX:+UseG1GC -Xloggc:${LOG_DIR}/logs/${SERVER_NAME}-gc.log -XX:+PrintGCDateStamps"
JAVA_OPTS+=" -DserviceName=${SERVER_NAME}"
JAVA_OPTS+=" -DserviceConfigPath=${CONFIG_PATH}"
run_app()
{
nohup ${JAVA_CMD} $JAVA_OPTS -cp $CLASSPATH $APP_MAIN > start.out 2>&1 &
Expand Down
8 changes: 4 additions & 4 deletions wedpr-site/conf/application-wedpr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@ wedpr.storage.hdfs.url=hdfs://wedpr-0001:9900

# the auth information for hdfs
# enable krb5 auth or not
wedpr.storage.hdfs.enableKrb5Auth = false
wedpr.storage.hdfs.enableKrb5Auth=false
# the krb5 config file, only required when enableKrb5Auth
wedpr.storage.hdfs.krb5ConfigPath = ./krb5.conf
wedpr.storage.hdfs.krb5ConfigPath=./krb5.conf
# the krb5 principal, only required when enableKrb5Auth
wedpr.storage.hdfs.krb5Principal =
wedpr.storage.hdfs.krb5Principal=
# the keytab path, only required when enableKrb5Auth
wedpr.storage.hdfs.krb5KeytabPath = ./hdfs-wedpr.keytab
wedpr.storage.hdfs.krb5KeytabPath=./hdfs-wedpr.keytab

# HIVE
wedpr.hive.user=
Expand Down
15 changes: 4 additions & 11 deletions wedpr-site/conf/wedpr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ wedpr.user.jwt.sessionKey=
### the mybatis related configuration

#wedpr.mybatis.config.path=mybatis-config.xml
# wedpr.mybatis.url=jdbc:mysql://127.0.0.1/wedpr3?characterEncoding=UTF-8&allowMultiQueries=true
# wedpr.mybatis.username=
# wedpr.mybatis.password=
# wedpr.mybatis.driverClassName=com.mysql.cj.jdbc.Driver
wedpr.mybatis.url=jdbc:mysql://127.0.0.1/wedpr?characterEncoding=UTF-8&allowMultiQueries=true
wedpr.mybatis.username=
wedpr.mybatis.password=
wedpr.mybatis.driverClassName=com.mysql.cj.jdbc.Driver

wedpr.mybatis.mapperLocations=classpath*:mapper/*Mapper.xml
# Note: the basePackage can't set to com.webank.wedpr simply for the mybatis will scan the Service
Expand All @@ -46,7 +46,6 @@ wedpr.leader.election.expire.seconds=60

### the sync module related configuration
wedpr.agency=WeBank
wedpr.admin_agency=ADMIN
wedpr.sync.recorder.factory.contract_address=0x4721d1a77e0e76851d460073e64ea06d9c104194
wedpr.sync.sequencer.contract_address=0x6849f21d1e455e9f0712b1e99fa4fcd23758e8f1
wedpr.sync.recorder.contract_version=1
Expand Down Expand Up @@ -99,12 +98,6 @@ wedpr.transport.host_ip=
wedpr.transport.listen_ip=0.0.0.0
wedpr.transport.listen_port=6001



### the admin configuration
#wedpr.admin_agency=
###

### the service configuration
wedpr.service.debugMode=false
# only used when debugMode is true
Expand Down
3 changes: 2 additions & 1 deletion wedpr-worker/bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ APP_MAIN=com.webank.wedpr.worker.main.WorkerApplication
LOG_DIR=.
SERVER_NAME="WEDPR-WORKER"
CLASSPATH='conf/:apps/*:lib/*'

CONFIG_PATH=${SHELL_FOLDER}/conf

STATUS_STARTING="Starting"
STATUS_RUNNING="Running"
Expand Down Expand Up @@ -47,6 +47,7 @@ JAVA_OPTS+=" -Xmx256m -Xms256m -Xmn128m -Xss512k -XX:MetaspaceSize=128m -XX:MaxM
JAVA_OPTS+=" -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${SHELL_FOLDER}/heap_error.log"
#JAVA_OPTS+=" -XX:+UseG1GC -Xloggc:${LOG_DIR}/logs/${SERVER_NAME}-gc.log -XX:+PrintGCDateStamps"
JAVA_OPTS+=" -DserviceName=${SERVER_NAME}"
JAVA_OPTS+=" -DserviceConfigPath=${CONFIG_PATH}"
run_app()
{
if [ "$ENABLE_DOCKER_MODE" = "true" ]; then
Expand Down
Loading