TigerGraph集群说明

TigerGraph集群说明

1.使用前准备

  • 修改本地时间,关闭自动同步,因为授权码过期
  • 准备tigerGraph企业版

官方文档地址:http://docs.tigergraph.com.cn/admin/admin-guide/installation-and-configuration/installation-guide

2.Tigergraph集群搭建

​ 安装步骤只要在主节点执行,副节点不需要执行以下操作,也不需要Tigergraph安装包。tigergraph会自动同步过去。

2.1 修改ccluster_config.json文件

  1. 解压安装包
# 解压 压缩包
tar -zxvf tigergraph-*.tar.tar
  1. 主要需要修改license.keynode.ipnodes.loginHA.option四个配置

**license.key:**配置授权秘钥。

  "license.key": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1.....",

**node.ip:**集群中的每一台机器都被定义为键值对,键就是服务器被代指为m1,m2,m3等,可以添加任意多的键值对,在值的位置填写上服务器的ip地址。安装程序将自动检测本地网络来配置网络。如果本地IP地址不止一个,安装程序将会询问选择哪一个来配置。

  "nodes.ip": {
    "m1": "192.168.2.24",
    "m2": "192.168.2.21",
    "m3": "192.168.2.27"
  },

**nodes.login:**对于SSH密码登录,必须要输入居然具有超级用户权限的用户名称和密码。对于SSH密匙文件登录方式,需要配置免密登陆。如果什么都没有提供,安装程序会用默认的ssh密匙文件比如~/.ssh/id_rsa

  "nodes.login": {
    "supported.methods (this is a comment)": "P. SSH with password; K. SSH with key file (e.g. ec2_key.pem)",
    "notes (this is a comment)": "All nodes must use the same ssh port, same sudo user, same password, or same key file",
    "ssh.port": "22",
    "chosen.method": "P",
    "P": {
        "sudo.user.name": "cldev",
        "sudo.user.password": "qwedsazxc963.cl"
    },
    "K": {
      "sudo.user.name": "sudoUserName",
      "ssh.key.file": "/path/to/my_key.pem (if empty, the installer will use default ssh key file such as ~/.ssh/id_rsa)"
    }
  },

**HA.option:**开启HA高可用集群。

  "HA.option": {
    "Notes of HA.option (this is a comment)": "option to install high-availability cluster (with at least 3 nodes), default value false",
    "enable.HA": "true"
  }

2.2 安装

执行install.sh安装脚本

# 执行bash install.sh(root权限)
sudo bash install.sh -cn

客户端输入:http://192.168.2.24:14240 可以访问TigerGraph的界面,需要更新前端界面的秘钥。

3.LOAD图

  1. 切换到tigergraph用户,启动TigerGraph,刚安装完成是启动状态的。
# 切换到tigergraph 账号
su tigergraph
# 启动
gadmin start ; gadmin restart ; gadmin stop ;
  1. 编写load的gsql,1400w图load示例。
drop all
CREATE VERTEX ve (PRIMARY_ID id STRING,name STRING, sex STRING,age INT,country STRING)
CREATE DIRECTED EDGE ed (FROM ve, TO ve , guanzhu INT )
CREATE GRAPH data2 (ve, ed)
USE GRAPH data2
BEGIN
CREATE LOADING JOB load_data2 FOR GRAPH data2 {
DEFINE FILENAME file1="/data6/htigergraph/1400w/Vertex.csv";
DEFINE FILENAME file2="/data6/htigergraph/1400w/Edge.csv";
LOAD file1 TO VERTEX ve VALUES ($0 , $1,$2,$3,$4) USING header="true", separator=",";
LOAD file2 TO EDGE ed VALUES ($0, $1 ,$2) USING header="true", separator=",";
}
END
RUN LOADING JOB load_data2
  1. 执行gsql
1.命令行方式执行
gsql

2. 执行gsql <gsql文件>
gsql /home/tigergraph/graph.gsql

4.seconds 请求问题

gadmin --configure timeout_seconds
// 输入等待时间(单位:秒)
...

// 保存配置并重启
gadmin config-apply
gadmin restart

5.查看tiger loading 状态

每次运行tiger的job时 会有下述日志,记录jobid

Finish restarting services in 30.527 seconds!
The graph data2 is created.
Using graph 'data2'
The job load_data2 is created.
[Tip: Use "CTRL + C" to stop displaying the loading status update, then use "SHOW LOADING STATUS jobid" to track the loading progress again]
[Tip: Manage loading jobs with "ABORT/RESUME LOADING JOB jobid"]
Starting the following job, i.e.
  JobName: load_data2, jobid: data2.load_data2.file.m1.1576173967324
  Loading log: '/home/tigergraph/tigergraph/logs/restpp/restpp_loader_logs/data2/data2.load_data2.file.m1.1576173967324.log'

具体命令

# 示例 进入gsql界面
USE GRAPH data2
SHOW LOADING STATUS data2.load_data2.file.m1.1576173967324
---------本文结束感谢您的阅读---------

评论

 热烈欢迎各位大佬专家莅临玖涯博客指导检查!

 交换友链的朋友请前往友情链接

 热烈欢迎各位大佬专家莅临玖涯博客指导检查!

 交换友链的朋友请前往友情链接

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×