dosubot[bot] commented on issue #618:
URL: 
https://github.com/apache/incubator-hugegraph-toolchain/issues/618#issuecomment-2277728316

   <!-- Greeting -->
   Hey @imbajin! 👋 I'm here to help you with any bugs, questions, or 
contributions while you wait for the human maintainer.
   
   <!-- Answer -->
   To run the HugeGraph client tests locally or in IntelliJ IDEA, follow these 
steps:
   
   1. **Clone the HugeGraph repository and checkout the specific commit:**
       ```sh
       git clone --depth 150 https://github.com/apache/hugegraph.git hugegraph
       cd hugegraph
       git checkout <COMMIT_ID>
       ```
   
   2. **Build the HugeGraph server:**
       ```sh
       mvn package -DskipTests -Dmaven.javadoc.skip=true -ntp
       ```
   
   3. **Extract the HugeGraph server package:**
       ```sh
       cd hugegraph-server
       mv apache-hugegraph-*.tar.gz ../../
       cd ../../
       rm -rf hugegraph
       tar zxf apache-hugegraph-*.tar.gz
       ```
   
   4. **Configure and start the HugeGraph server:**
       ```sh
       HTTP_SERVER_DIR=$(echo apache-hugegraph-*.*)
       HTTPS_SERVER_DIR="hugegraph_https"
   
       cp -r "${HTTP_SERVER_DIR}" "${HTTPS_SERVER_DIR}"
   
       # Config auth options just for http server (must keep '/.')
       cp -rf hugegraph-client/assembly/travis/conf/. "${HTTP_SERVER_DIR}"/conf/
   
       # Start HugeGraphServer with http protocol
       cd "${HTTP_SERVER_DIR}"
       echo -e "pa" | bin/init-store.sh
       bin/start-hugegraph.sh
       ```
   
   5. **Configure and start the HugeGraph server with HTTPS protocol:**
       ```sh
       cd ../"${HTTPS_SERVER_DIR}"
       REST_SERVER_CONFIG="conf/rest-server.properties"
       GREMLIN_SERVER_CONFIG="conf/gremlin-server.yaml"
       sed -i "s?http://127.0.0.1:8080?https://127.0.0.1:8443?g"; 
"$REST_SERVER_CONFIG"
       sed -i "s/rpc.server_port=8091/rpc.server_port=8092/g" 
"$REST_SERVER_CONFIG"
       sed -i "s/#port: 8182/port: 8282/g" "$GREMLIN_SERVER_CONFIG"
       echo "gremlinserver.url=http://127.0.0.1:8282"; >> ${REST_SERVER_CONFIG}
   
       # Start HugeGraphServer with https protocol
       bin/init-store.sh
       bin/start-hugegraph.sh
       ```
   
   6. **Run the tests in IntelliJ IDEA:**
       - Open IntelliJ IDEA and import the HugeGraph client project.
       - Ensure that the HugeGraph server is running.
       - Run the tests from the test classes or test methods in IntelliJ IDEA.
   
   Additionally, you can follow the detailed guide provided in the HugeGraph 
documentation for setting up and debugging the HugeGraph server in IntelliJ 
IDEA:
   
   1. **Copy Configuration Files:**
       ```bash
       cp -r hugegraph-dist/src/assembly/static/scripts 
hugegraph-dist/src/assembly/static/conf path-to-your-directory
       ```
   
   2. **Configure `InitStore` to initialize the graph:**
       - Configure the database backend in 
`path-to-your-directory/conf/graphs/hugegraph.properties`:
           ```properties
           backend=rocksdb
           serializer=binary
           rocksdb.data_path=.
           rocksdb.wal_path=.
           ```
       - Create a new Application configuration in IntelliJ IDEA:
           - Use `hugegraph-dist` as the classpath of the module.
           - Set the Main class to `org.apache.hugegraph.cmd.InitStore`.
           - Set the program arguments to `conf/rest-server.properties`.
   
   3. **Running `HugeGraphServer`:**
       - Create a new Application configuration in IntelliJ IDEA:
           - Use `hugegraph-dist` as the classpath of the module.
           - Set the Main class to `org.apache.hugegraph.dist.HugeGraphServer`.
           - Set the program arguments to `conf/gremlin-server.yaml 
conf/rest-server.properties`.
   
   4. **Debugging `HugeGraphServer` (optional):**
       - Set breakpoints and use the RESTful API to request `HugeGraphServer`.
   
   5. **Log4j2 Configuration:**
       - Modify the Log4j2 configuration file path in IntelliJ IDEA to 
`conf/log4j2.xml`.
   
   By following these steps and the detailed guide, you can manually set up the 
HugeGraph server and run the client tests locally or in IntelliJ IDEA 
<sup>[[1]](https://github.com/apache/incubator-hugegraph-toolchain/blob/master/hugegraph-client/assembly/travis/install-hugegraph-from-source.sh)</sup><sup>[[2]](https://github.com/apache/incubator-hugegraph-toolchain/blob/master/hugegraph-loader/assembly/travis/install-hugegraph-from-source.sh)</sup><sup>[[3]](https://github.com/apache/incubator-hugegraph-doc/blob/master/content/en/docs/contribution-guidelines/hugegraph-server-idea-setup.md)</sup>.
   
   
   <!-- Dosu Comment Footer -->
   *To continue talking to [Dosu](https://dosu.dev), mention @dosu.*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to