Skip to content

Commit

Permalink
default dont use auth, and fix raft unit startup error
Browse files Browse the repository at this point in the history
  • Loading branch information
zyxxoo committed Jan 24, 2022
1 parent 6a3fb25 commit c85880e
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 23 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
# BACKEND: [memory, cassandra, scylladb, hbase, rocksdb, mysql, postgresql]
BACKEND: [memory, cassandra, scylladb, hbase, rocksdb, postgresql]
# JAVA_VERSION: ['8', '11']
BACKEND: [memory, cassandra, scylladb, hbase, rocksdb, mysql, postgresql]
JAVA_VERSION: ['11']

steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public class HugeSecurityManager extends SecurityManager {
private static final Set<String> ACCEPT_CLASS_LOADERS = ImmutableSet.of(
"groovy.lang.GroovyClassLoader",
"sun.reflect.DelegatingClassLoader",
"jdk.internal.reflect.DelegatingClassLoader",
"org.codehaus.groovy.reflection.SunClassLoader",
"org.codehaus.groovy.runtime.callsite.CallSiteClassLoader",
"org.apache.hadoop.hbase.util.DynamicClassLoader",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public static void writeToFile(String dir, String graphName,
LOG.info("Write HugeConfig to file: '{}'", fileName);
} catch (ConfigurationException e) {
throw new HugeException("Failed to write HugeConfig to file '%s'",
e, fileName);
e, fileName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Arrays;

public class Reflection {

Expand Down Expand Up @@ -90,15 +91,17 @@ public static void registerFieldsToFilter(Class<?> containingClass,
reflectionClazz, containingClass, fieldNames);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new HugeException(
"invoke 'registerFieldsToFilter' failed", e);
"Register class '{}' filter fields '{}' is failed",
containingClass, Arrays.toString(fieldNames));
}
}

public static void registerMethodsToFilter(Class<?> containingClass,
String ... methodNames) {
if (registerMethodsToFilterMethod == null) {
throw new NotSupportException(
"No support this method 'registerMethodsToFilterMethod'");
"Currently Java version no support " +
"the method 'registerMethodsToFilterMethod'");
}

try {
Expand All @@ -107,7 +110,8 @@ public static void registerMethodsToFilter(Class<?> containingClass,
reflectionClazz, containingClass, methodNames);
} catch (IllegalAccessException | InvocationTargetException e) {
throw new HugeException(
"invoke 'registerMethodsToFilter' failed", e);
"Register class '{}' filter method '{}' is failed",
containingClass, Arrays.toString(methodNames));
}
}
}
16 changes: 8 additions & 8 deletions hugegraph-dist/src/assembly/static/bin/hugegraph-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@ if [[ $? -ne 0 || $JAVA_VERSION < $EXPECT_JDK_VERSION ]]; then
exit 1
fi

DEFAULT_JAVA_OPTIONS=""
if [[ $JAVA_VERSION > "1.9" ]]; then
DEFAULT_JAVA_OPTIONS=" --add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED \
--add-modules=jdk.unsupported \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED"
fi

# Set Java options
if [ "$JAVA_OPTIONS" = "" ]; then
XMX=$(calc_xmx $MIN_MEM $MAX_MEM)
Expand All @@ -109,6 +102,13 @@ if [ "$JAVA_OPTIONS" = "" ]; then
# -Xloggc:./logs/gc.log -XX:+PrintHeapAtGC -XX:+PrintGCDetails -XX:+PrintGCDateStamps"
fi

JAVA_OPTIONS=""
if [[ $JAVA_VERSION > "1.9" ]]; then
JAVA_OPTIONS="${JAVA_OPTIONS} --add-exports=java.base/jdk.internal.reflect=ALL-UNNAMED \
--add-modules=jdk.unsupported \
--add-exports=java.base/sun.nio.ch=ALL-UNNAMED "
fi

# Using G1GC as the default garbage collector (Recommended for large memory machines)
case "$GC_OPTION" in
g1)
Expand All @@ -128,6 +128,6 @@ if [[ ${OPEN_SECURITY_CHECK} == "true" ]]; then
fi

# Turn on security check
exec ${JAVA} -Dname="HugeGraphServer" ${DEFAULT_JAVA_OPTIONS} ${JVM_OPTIONS} ${JAVA_OPTIONS} \
exec ${JAVA} -Dname="HugeGraphServer" ${JVM_OPTIONS} ${JAVA_OPTIONS} \
-cp ${CLASSPATH}: com.baidu.hugegraph.dist.HugeGraphServer ${GREMLIN_SERVER_CONF} ${REST_SERVER_CONF} \
>> ${OUTPUT} 2>&1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gremlin entrance to create graph
gremlin.graph=com.baidu.hugegraph.auth.HugeFactoryAuthProxy
#gremlin.graph=com.baidu.hugegraph.HugeFactory
# auth config: com.baidu.hugegraph.auth.HugeFactoryAuthProxy
gremlin.graph=com.baidu.hugegraph.HugeFactory

# cache config
#schema.cache_capacity=100000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ batch.max_write_threads=0

# authentication configs
# choose 'com.baidu.hugegraph.auth.StandardAuthenticator' or 'com.baidu.hugegraph.auth.ConfigAuthenticator'
auth.authenticator=com.baidu.hugegraph.auth.StandardAuthenticator
#auth.authenticator=

# for StandardAuthenticator mode
auth.graph_store=hugegraph
#auth.graph_store=hugegraph
# auth client config
#auth.remote_url=127.0.0.1:8899,127.0.0.1:8898,127.0.0.1:8897

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
port: 8181

# timeout in ms of gremlin query
scriptEvaluationTimeout: 30000
evaluationTimeout: 30000

channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
# don't set graph at here, this happens after support for dynamically adding graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
port: 8182

# timeout in ms of gremlin query
scriptEvaluationTimeout: 30000
evaluationTimeout: 30000

channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
# don't set graph at here, this happens after support for dynamically adding graph
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
port: 8183

# timeout in ms of gremlin query
scriptEvaluationTimeout: 30000
evaluationTimeout: 30000

channelizer: org.apache.tinkerpop.gremlin.server.channel.WsAndHttpChannelizer
# don't set graph at here, this happens after support for dynamically adding graph
Expand Down
2 changes: 1 addition & 1 deletion hugegraph-dist/src/assembly/travis/start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fi
if [ "$BACKEND" == "hbase" ]; then
sed -i '$arestserver.request_timeout=200' $REST_CONF
sed -i '$agremlinserver.timeout=200' $REST_CONF
sed -i 's/scriptEvaluationTimeout.*/scriptEvaluationTimeout: 200000/' $GREMLIN_CONF
sed -i 's/evaluationTimeout.*/evaluationTimeout: 200000/' $GREMLIN_CONF
fi

# Append schema.sync_deletion=true to config file
Expand Down

0 comments on commit c85880e

Please sign in to comment.