diff --git a/hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh b/hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh index d0e247b10b..46023b5e3f 100644 --- a/hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh +++ b/hugegraph-dist/src/assembly/static/bin/start-hugegraph.sh @@ -38,23 +38,27 @@ function abs_path() { echo "$( cd -P "$( dirname "$SOURCE" )" && pwd )" } -BIN=`abs_path` -TOP="$(cd $BIN/../ && pwd)" +BIN=$(abs_path) +TOP="$(cd "$BIN"/../ && pwd)" CONF="$TOP/conf" LOGS="$TOP/logs" PID_FILE="$BIN/pid" -. $BIN/util.sh +. "$BIN"/util.sh -GREMLIN_SERVER_URL=`read_property "$CONF/rest-server.properties" "gremlinserver.url"` +GREMLIN_SERVER_URL=$(read_property "$CONF/rest-server.properties" "gremlinserver.url") if [ -z "$GREMLIN_SERVER_URL" ]; then GREMLIN_SERVER_URL="http://127.0.0.1:8182" fi -REST_SERVER_URL=`read_property "$CONF/rest-server.properties" "restserver.url"` +REST_SERVER_URL=$(read_property "$CONF/rest-server.properties" "restserver.url") check_port "$GREMLIN_SERVER_URL" check_port "$REST_SERVER_URL" +if [ ! -d "$LOGS" ]; then + mkdir -p "$LOGS" +fi + echo "Starting HugeGraphServer..." "$BIN"/hugegraph-server.sh "$CONF"/gremlin-server.yaml "$CONF"/rest-server.properties \ @@ -62,7 +66,7 @@ echo "Starting HugeGraphServer..." PID="$!" # Write pid to file -echo "$PID" > $PID_FILE +echo "$PID" > "$PID_FILE" trap 'kill $PID; exit' SIGHUP SIGINT SIGQUIT SIGTERM @@ -73,7 +77,7 @@ wait_for_startup ${PID} 'HugeGraphServer' "$REST_SERVER_URL/graphs" ${SERVER_STA disown if [ "$OPEN_MONITOR" == "true" ]; then - $BIN/start-monitor.sh + "$BIN"/start-monitor.sh if [ $? -ne 0 ]; then echo "Failed to open monitor, please start it manually" fi diff --git a/hugegraph-dist/src/assembly/static/conf/hugegraph.properties b/hugegraph-dist/src/assembly/static/conf/hugegraph.properties index ba72118c2a..24ce42e64c 100644 --- a/hugegraph-dist/src/assembly/static/conf/hugegraph.properties +++ b/hugegraph-dist/src/assembly/static/conf/hugegraph.properties @@ -1,4 +1,5 @@ -# gremlin entrence to create graph +# gremlin entrance to create graph +# auth config: com.baidu.hugegraph.auth.HugeFactoryAuthProxy gremlin.graph=com.baidu.hugegraph.HugeFactory # cache config diff --git a/hugegraph-dist/src/assembly/static/conf/log4j2.xml b/hugegraph-dist/src/assembly/static/conf/log4j2.xml index 83e0598e1c..2749973473 100644 --- a/hugegraph-dist/src/assembly/static/conf/log4j2.xml +++ b/hugegraph-dist/src/assembly/static/conf/log4j2.xml @@ -1,29 +1,65 @@ - + + + + logs + hugegraph-server + + - + - - - + + + + + + + + + + + + + + + + + - - + - + + + + + + + + + + + + + + + + diff --git a/hugegraph-dist/src/assembly/static/conf/rest-server.properties b/hugegraph-dist/src/assembly/static/conf/rest-server.properties index 3b439a33af..4cb6c19f7c 100644 --- a/hugegraph-dist/src/assembly/static/conf/rest-server.properties +++ b/hugegraph-dist/src/assembly/static/conf/rest-server.properties @@ -10,21 +10,33 @@ graphs=[hugegraph:conf/hugegraph.properties] batch.max_write_ratio=80 batch.max_write_threads=0 -# authentication +# authentication configs +# choose 'com.baidu.hugegraph.auth.StandardAuthenticator' or 'com.baidu.hugegraph.auth.ConfigAuthenticator' #auth.authenticator= -#auth.admin_token= -#auth.user_tokens=[] + +# for StandardAuthenticator mode +#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 -server.id=server-1 -server.role=master +# for ConfigAuthenticator mode +#auth.admin_token= +#auth.user_tokens=[] +# rpc group configs of multi graph servers +# rpc server configs rpc.server_host=127.0.0.1 rpc.server_port=8090 #rpc.server_timeout=30 + +# rpc client configs (like enable to keep cache consistency) rpc.remote_url=127.0.0.1:8090 #rpc.client_connect_timeout=20 #rpc.client_reconnect_period=10 #rpc.client_read_timeout=40 #rpc.client_retries=3 #rpc.client_load_balancer=consistentHash + +# lightweight load balancing (beta) +server.id=server-1 +server.role=master diff --git a/hugegraph-dist/src/main/resources/log4j2.xml b/hugegraph-dist/src/main/resources/log4j2.xml index 39971f2f0a..76ddd747e4 100644 --- a/hugegraph-dist/src/main/resources/log4j2.xml +++ b/hugegraph-dist/src/main/resources/log4j2.xml @@ -1,29 +1,65 @@ - + + + + logs + hugegraph-server + + - + - - - + + + + + + + + + + + + + + + + + - - + - + + + + + + + + + + + + + + + + diff --git a/hugegraph-example/src/main/resources/log4j2.xml b/hugegraph-example/src/main/resources/log4j2.xml index 84511f69c4..6f482714e5 100644 --- a/hugegraph-example/src/main/resources/log4j2.xml +++ b/hugegraph-example/src/main/resources/log4j2.xml @@ -1,29 +1,65 @@ - + + + + logs + hugegraph-example + + - + - - - + + + + + + + + + + + + + + + + + - - + - + + + + + + + + + + + + + + + + diff --git a/hugegraph-test/src/main/resources/log4j2.xml b/hugegraph-test/src/main/resources/log4j2.xml index 64fb5180b1..5f4128daa8 100644 --- a/hugegraph-test/src/main/resources/log4j2.xml +++ b/hugegraph-test/src/main/resources/log4j2.xml @@ -1,29 +1,65 @@ - + + + + logs + hugegraph-test + + - + - - - + + + + + + + + + + + + + + + + + - - + - + + + + + + + + + + + + + + + +