nebula graph传统使用Docker进行项目发版

nebula graph传统使用Docker进行项目发版

  • 1. nebula graph服务
  • 2. 搭建ES集群
  • 3. 注意事项
    • 3.1 图数据库的启动顺序
    • 3.2 模糊查询失效

1. nebula graph服务

1.在测试服务器中执行如下命令

docker commit 85b6e2b8xxx xxx_nebula_es:1.0.0.2执行docker images之后能看到新的镜像 xxx_nebula_es:1.0.0.2

这里将测试服务器中的容器打包成镜像。85b6e2b8xxx就是某个服务的容器ID(CONTAINER ID)

在这里插入图片描述

然后将新的镜像保存成tar包存到测试服务器中

docker save -o ./xxx_nebula_es.tar  xxx_nebula_es:1.0.0.2

容器打包后的image包导入到服务器中,这里使用其他电脑模拟服务器
在这里插入图片描述

导入到镜像中

(base) ➜  Documents docker load -i xxx_nebula_es.tar
174f56854903: Loading layer [==================================================>]  211.7MB/211.7MB
fff8cc8b80b2: Loading layer [==================================================>]  249.3MB/249.3MB
cf0ef10a32ea: Loading layer [==================================================>]  65.41MB/65.41MB
2119c420d03d: Loading layer [==================================================>]  6.687GB/6.687GB
4e15763e63e9: Loading layer [==================================================>]  4.249GB/4.249GB
1d7f86007746: Loading layer [==================================================>]  12.49GB/12.49GB
27e6368f9369: Loading layer [==================================================>]  7.737GB/7.737GB
Loaded image: xxx_nebula_es:1.0.0.2
(base) ➜  Documents docker images
REPOSITORY                                                   TAG            IMAGE ID       CREATED             SIZE
xxx_nebula_es                                                1.0.0.2        3a10a2c46591   About an hour ago   31.7GB
docker-test                                                  dev            249cb83092ff   2 months ago        229MB
docker-test                                                  prod           249cb83092ff   2 months ago        229MB
nginx                                                        latest         5e0fa356e6f4   3 months ago        197MB
weygu/nebulagraph-jupyter                                    v0             621540960f3a   7 months ago        1.74GB
weygu/nebulagraph-gephi-exchange                             v0.1           46adca927168   9 months ago        643MB
weygu/nebulagraph-dd-ext                                     0.4.21         019e494cfd0f   10 months ago       9.17MB
vesoft/nebula-metad                                          v3.8.0         ed1af2e7d732   10 months ago       382MB
vesoft/nebula-storaged                                       v3.8.0         5dc54c63c7ab   10 months ago       383MB
vesoft/nebula-graphd                                         v3.8.0         7738d42b9445   10 months ago       377MB
vesoft/nebula-graph-studio                                   latest         ef5c7a587b3f   10 months ago       85.2MB
vesoft/nebula-graph-studio                                   v3             ef5c7a587b3f   10 months ago       85.2MB
harbor1.vm.example.lan/dockerio/vesoft/nebula-graph-studio   v3.10.0        52eb2ad53a4c   10 months ago       85.8MB
weygu/nebula-webconsole                                      latest         457e03b2bf04   18 months ago       34.2MB
openjdk                                                      8-jre-slim     252e7e45ba12   2 years ago         187MB
openjdk                                                      8-jdk-alpine   e4105db9d469   5 years ago         103MB

运行images

docker run -itd -p 9200:9200 -p 9300:9300 -p 59647:9669 --name xxx_nebula_es --privaleged
xxx_nebula_es:1.0.0.2/bin/bash

解释这个命令

  • docker run 是用于创建并运行一个新的容器的命令

  • -itd
    -i (interactive):保持容器的标准输入打开,即使没有连接。
    -t (tty):为容器分配一个伪终端,方便交互。
    -d (detached):后台运行容器,而不是附加到终端。

  • -p 9200:9200 -p 9300:9300 -p 59647:9669
    端口映射,将宿主机端口映射到容器内部的端口:
    9200:9200:宿主机的 9200 端口映射到容器的 9200 端口(通常用于 Elasticsearch)。
    9300:9300:宿主机的 9300 端口映射到容器的 9300 端口(用于 Elasticsearch 集群通信)。
    59647:9669:宿主机的 59647 端口映射到容器的 9669 端口(用于 Nebula Graph)。

  • --name xxx_nebula_es
    指定容器名称为 xxx_nebula_es,方便后续管理。

  • --privileged
    赋予容器 特权模式,允许容器访问宿主机的所有设备,适用于需要高权限的应用(例如运行 Docker 内嵌 Docker,或者访问宿主机硬件)。

  • xxx_nebula_es:1.0.0.2
    这是镜像的名称和标签:
    xxx_nebula_es 是镜像名。
    1.0.0.2 是镜像的版本号。
    /bin/bash 在容器内执行 /bin/bash,通常用于保持容器运行,或者提供交互式 shell 访问。

注意:nebula graph的镜像会带着nebulagraph的全部数据,如果要替换,先把服务器中原来的nebulagraph容器停止与删除,原来的镜像也可以干掉

2. 搭建ES集群

配置一个单主机3个ES服务的集群,3台集群的yml配置如下

进入nebula graph命令
docker exec -it xxx_nebula_es /bin/bash在解压ES之后可以通过cp扩展另两个es
cp -r elasticsearch-7.15.0 elasticsearch-7.15.0-9201
cp -r elasticsearch-7.15.0 elasticsearch-7.15.0-9202第一台
# cluster name
cluster.name: my-application
#data save path
path.data: ./data
#log path
path.logs: /usr/local/es/elasticsearch-7.15.0/logs
node.name: node-1
# allow all node request
network.host: 0.0.0.0
# port
http.port: 9200
transport.tcp.port: 9300
discovery.zen.ping.unicast.hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]
discovery.zen.minimum_master_nodes: 2
node.master: true
node.data: true
cluster.initial_master_nodes: ["node-1", "node-2","node-3"]
#discovery.type: single-node
#discovery.seed_hosts: ["172.17.0.20"]
#Disable GeoIP data download
ingest.geoip.downloader.enabled: false
xpack.security.enabled: false
#cluster.max_shards_per_node: 2000
http.cors.enabled: true
http.cors.allow-origin: "*"
node.max_local_storage_nodes: 3第二台
cluster.name: my-application
path.data: /usr/local/es/elasticsearch-7.15.0-9201/data
path.logs: /usr/local/es/elasticsearch-7.15.0-9201/logs
node.name: node-2
network.host: 0.0.0.0
http.port: 9201
transport.tcp.port: 9301
discovery.zen.ping.unicast.hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]
# discovery.zen.ping.unicast.hosts: ["172.17.0.8:9300","172.17.0.8:9301",172.17.0.8:9302"]
discovery.zen.minimum_master_nodes: 2
node.master: false
node.data: true
cluster.initial_master_nodes: ["node-1", "node-2","node-3"]
#discovery.type: single-node
#discovery.seed_hosts: ["172.17.0.20"]
#Disable GeoIP data download
ingest.geoip.downloader.enabled: false
xpack.security.enabled: false
#cluster.max_shards_per_node: 2000
http.cors.enabled: true
http.cors.allow-origin: "*"
node.max_local_storage_nodes: 3第三台
cluster.name: my-application
path.data: /usr/local/es/elasticsearch-7.15.0-9202/data
path.logs: /usr/local/es/elasticsearch-7.15.0-9202/logs
node.name: node-3
network.host: 0.0.0.0
http.port: 9202
transport.tcp.port: 9302
discovery.zen.ping.unicast.hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"]
# discovery.zen.ping.unicast.hosts: ["172.17.0.8:9300","172.17.0.8:9301",172.17.0.8:9302"]
discovery.zen.minimum_master_nodes: 2
node.master: false
node.data: true
cluster.initial_master_nodes: ["node-1", "node-2","node-3"]
#discovery.type: single-node
#discovery.seed_hosts: ["172.17.0.20"]
#Disable GeoIP data download
ingest.geoip.downloader.enabled: false
xpack.security.enabled: false
#cluster.max_shards_per_node: 2000
http.cors.enabled: true
http.cors.allow-origin: "*"
node.max_local_storage_nodes: 3

因为es启动要使用非root用户,所以在root用户时记得修改文件的权限,不然es不能启动

rm -rf /usr/local/es/elasticsearch-7.15.0-9202/data/*
rm -rf /usr/local/es/elasticsearch-7.15.0-9201/data/*chown -R es:es /usr/local/es/elasticsearch-7.15.0-9201/logs
chmod -R 755 /usr/local/es/elasticsearch-7.15.0-9201/logschown -R es:es /usr/local/es/elasticsearch-7.15.0-9202/logs
chmod -R 755 /usr/local/es/elasticsearch-7.15.0-9202/logs[root@c266a323c916 /]# chmod 644 /usr/local/es/elasticsearch-7.15.0-9201/config/elasticsearch.yml
[root@c266a323c916 /]# 
[root@c266a323c916 /]# chown es:es /usr/local/es/elasticsearch-7.15.0-9201/config/elasticsearch.ymlchown es:es /usr/local/es/elasticsearch-7.15.0-9201/config/elasticsearch.keystore
[root@c266a323c916 /]# chown -R es:es /usr/local/es/elasticsearch-7.15.0-9201/config/jvm.options.d
[root@c266a323c916 /]# chmod -R 755 /usr/local/es/elasticsearch-7.15.0-9201/config/jvm.options.dchmod 644 /usr/local/es/elasticsearch-7.15.0-9201/config/jvm.options
chmod 644 /usr/local/es/elasticsearch-7.15.0-9201/config/log4j2.properties
chown -R es:es /usr/local/es/elasticsearch-7.15.0-9201/config/chown -R es:es /usr/local/es/elasticsearch-7.15.0-9201/data
chmod -R 755 /usr/local/es/elasticsearch-7.15.0-9201/data
==========================================
chown -R es:es /usr/local/es/elasticsearch-7.15.0-9202/logs
chmod -R 755 /usr/local/es/elasticsearch-7.15.0-9202/logschown -R es:es /usr/local/es/elasticsearch-7.15.0-9202/logs
chmod -R 755 /usr/local/es/elasticsearch-7.15.0-9202/logs[root@c266a323c916 /]# chmod 644 /usr/local/es/elasticsearch-7.15.0-9202/config/elasticsearch.yml
[root@c266a323c916 /]# 
[root@c266a323c916 /]# chown es:es /usr/local/es/elasticsearch-7.15.0-9202/config/elasticsearch.ymlchown es:es /usr/local/es/elasticsearch-7.15.0-9202/config/elasticsearch.keystore
[root@c266a323c916 /]# chown -R es:es /usr/local/es/elasticsearch-7.15.0-9202/config/jvm.options.d
[root@c266a323c916 /]# chmod -R 755 /usr/local/es/elasticsearch-7.15.0-9202/config/jvm.options.dchmod 644 /usr/local/es/elasticsearch-7.15.0-9202/config/jvm.options
chmod 644 /usr/local/es/elasticsearch-7.15.0-9202/config/log4j2.properties
chown -R es:es /usr/local/es/elasticsearch-7.15.0-9202/config/chown -R es:es /usr/local/es/elasticsearch-7.15.0-9202/data
chmod -R 755 /usr/local/es/elasticsearch-7.15.0-9202/data

最后按顺序启动es

su - es/usr/local/es/elasticsearch-7.15.0/bin/elasticsearch &
/usr/local/es/elasticsearch-7.15.0-9201/bin/elasticsearch &
/usr/local/es/elasticsearch-7.15.0-9202/bin/elasticsearch &

查看结果

[abc@localhost ~]$ curl -X GET "http://localhost:9200/_cat/nodes?v"
ip         heap.percent ram.percent cpu load_1m load_5m load_15m node.role   master name
172.17.0.8           30          94   7    8.77    6.43     5.66 cdfhilmrstw *      node-1
172.17.0.8           25          94   7    8.77    6.43     5.66 cdfhilrstw  -      node-2
172.17.0.8           29          94   7    8.77    6.43     5.66 cdfhilrstw  -      node-3

其他一些命令

查看全部索引curl -X GET "localhost:9200/_cat/indices?v"查询全文索引
show fulltext indexesSHOW TEXT SEARCH CLIENTS;查看所有索引
curl -X GET "http://localhost:9200/_cat/indices?v"查看指定索引
curl -X GET "http://localhost:9200/fulltext_index_1"图数据库新建索引
CREATE FULLTEXT TAG INDEX `fulltext_index_1` ON `人物`(`名字`) ANALYZER="standard"图数据库中的命令重建索引
Rebuild fulltext index删除索引
curl -X DELETE "localhost:9200/fulltext_index_2"图数据库中删除全文索引
drop fulltext index fulltext_index_1

3. 注意事项

3.1 图数据库的启动顺序

1.启动图数据库
cd /opt/scripts/
./nebula.service start all2.启动es集群3.将es挂载到nebula-storaged上,用于创建全文索引,进行模糊查找
PS:一定要在nebula、es启动完成后操作
exit(退出es账户,用root账户)
cd /opt
./bin/nebula-storaged --flagfile etc/nebula-storaged-listener.conf

3.2 模糊查询失效

1.查看日志

cd /opt/logs
vim nebula-storaged.ERROR
vim nebula-graphd.ERROR
vim nebula-meta.ERROR

2.常见问题

1. access elasticsearch failed
2. shards not enough
3. 全文索引创建完成,但是模糊查询依旧失败排查步骤:
1. 在nebula-studio中查询 
show listener
PartId	Type	Host	Host Status
1	ELASTICSEARCH	"127.0.0.1":9789	ONLINE
2	ELASTICSEARCH	"127.0.0.1":9789	ONLINE若是结果中查询 Status为 Offline,则Es连接异常2. 若ES正常,在nebula-studio中查询 
show fulltext indexes3.若查询全文索引存在,则执行
Rebuild fulltext index若ES异常,一般问题为 ES的内存不够、Shards不够,解决办法如下配置少副本,减少shards的使用量
curl -X PUT "http://127.0.0.1:9200/_settings" -H 'Content-Type: application/json' -d'
{"index": {"number_of_replicas": 0}
}'清理indexes
curl -X DELETE "localhost:9200/index1,index2,index3"
curl -X DELETE "localhost:9200/*"

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/41492.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

0322-数据库与前后端的连接、数据库表的增删改查

前端 <!DOCTYPE html> <html> <head> <meta charset"UTF-8"> <title>Insert title here</title> <script srcjs/jquery-3.7.1.min.js></script> <script> //jquaryajax发起请求 //传参形式不同 post用data{}…

matlab打开两个工程

1、问题描述 写代码时&#xff0c;需要实时参考别人的代码&#xff0c;需要同时打开2个模型&#xff0c;当模型在同一个工程内时&#xff0c;这是可以直接打开的&#xff0c;如图所示 2、解决方案 再打开一个MATLAB主窗口 这个时候就可以同时打开多个模型了 3、正确的打开方…

深度剖析HTTP协议—GET/PUT请求方法的使用-构造请求的方法

活动发起人小虚竹 想对你说&#xff1a; 这是一个以写作博客为目的的创作活动&#xff0c;旨在鼓励大学生博主们挖掘自己的创作潜能&#xff0c;展现自己的写作才华。如果你是一位热爱写作的、想要展现自己创作才华的小伙伴&#xff0c;那么&#xff0c;快来参加吧&#xff01…

SQL中体会多对多

我们可以根据学生与课程多对多关系的数据库模型&#xff0c;给出实际的表数据以及对应的查询结果示例&#xff0c;会用到JOINLEFT JOIN两种连接 1. 学生表&#xff08;students&#xff09; student_idstudent_name1张三2李四3王五 2. 课程表&#xff08;courses&#xff09…

【android】补充

3.3 常用布局 本节介绍常见的几种布局用法&#xff0c;包括在某个方向上顺序排列的线性布局&#xff0c;参照其他视图的位置相对排列的相对布局&#xff0c;像表格那样分行分列显示的网格布局&#xff0c;以及支持通过滑动操作拉出更多内容的滚动视图。 3.3.1 线性布局Linea…

uv:Rust 驱动的 Python 包管理新时代

在 Python 包管理工具层出不穷的今天&#xff0c;pip、pip-tools、poetry、conda 等各有千秋。而今天要介绍的 uv&#xff0c;则是一款由 Astral 团队推出、采用 Rust 编写的全新工具&#xff0c;目标直指成为 “Python 的 Cargo”。它不仅在性能上表现优异&#xff0c;而且在功…

package.json版本前缀

前言 执行 npm i 下载依赖后&#xff0c;element-plus出现bug&#xff08;单页面多个date-picker同时开启&#xff09;&#xff0c;这是 v2.9.0 的问题&#xff0c;但是项目 package.json 中版本如下&#xff1a; "element-plus": "^2.7.6",乍一看并不是…

CSS+JS 堆叠图片动态交互切换

结合DeepSeek提供的代码&#xff0c;终于实现了堆叠两张图片动态循环切换&#xff0c;以下是代码&#xff1a; 通过绝对定位放了两张图片 <div class"col-lg-5" style"z-index: 40; position: relative;"><img src"images/banner_1.png&quo…

SpringCould微服务架构之Docker(2)

Docker和虚拟机的差别&#xff1a; 虚拟机是在操作系统中模拟硬件设备&#xff0c;然后运行另外一个操作系统。

好用的Markdown阅读编辑器Typora破解记录

Typora破解 一、下载Typora二、安装Typora三、破解Typora &#x1f600; 记录一下Typora破解记录&#xff0c;怕不常用忘记咯&#xff0c;感觉自己现在的脑子就像我的肠子一样&#xff0c;刚装进去就么得了。。。&#x1f614; Typroa算是用起来很舒服的Markdown阅读器了吧&am…

UI前端与数字孪生:打造智慧城市的双引擎

hello宝子们...我们是艾斯视觉擅长ui设计和前端数字孪生、大数据、三维建模、三维动画10年经验!希望我的分享能帮助到您!如需帮助可以评论关注私信我们一起探讨!致敬感谢感恩! 随着信息技术的飞速发展&#xff0c;智慧城市的概念逐渐从理论走向实践。智慧城市旨在通过运用物联网…

“征服HTML引号恶魔:“完全解析手册”!!!(quot;表示双引号)

&#x1f6a8;&#x1f4e2; "征服HTML引号恶魔&#xff1a;“完全解析手册” &#x1f4e2;&#x1f6a8; &#x1f3af; 博客引言&#xff1a;当引号变成"恶魔" &#x1f631; 是否遇到过这种情况&#xff1a; 写HTML时满心欢喜输入<div title"他…

k8s高可用集群安装

一、安装负载均衡器 k8s负载均衡器 官方指南 1、准备三台机器 节点名称IPmaster-1192.168.1.11master-2192.168.1.12master-3192.168.1.13 2、在这三台机器分别安装haproxy和keepalived作为负载均衡器 # 安装haproxy sudo dnf install haproxy -y# 安装Keepalived sudo yum …

node.js笔记

1. Node.js基本概念 1.1 什么是Node.js Node.js是一个开源、跨平台的JavaScript运行环境&#xff0c;广泛应用于各类项目。它基于Google Chrome的V8 JavaScript引擎&#xff0c;性能卓越。 Node.js在单个进程中运行&#xff0c;利用异步I/O操作避免阻塞&#xff0c;能高效处…

关于在vscode中的Linux 0.11 应用程序项目的生成和运行

首先我们需要需要查看镜像文件 查看软盘镜像文件 floppyb.img 中的内容 在 VSCode 的“Terminal”菜单中选择“Run Build Task...”&#xff0c;会在 VSCode 的顶部中间位置弹出一个 可以执行的 Task 列表&#xff0c;选择其中的“打开 floppyb.img”后会使用 Floppy Editor …

【JavaScript 简明入门教程】为了Screeps服务的纯JS入门教程

0 前言 0-1 Screeps: World 众所不周知&#xff0c;​Screeps: World是一款面向编程爱好者的开源大型多人在线即时战略&#xff08;MMORTS&#xff09;沙盒游戏&#xff0c;其核心机制是通过编写JavaScript代码来控制游戏中的单位&#xff08;称为“Creep”&#xff09;&#…

【CSS文字渐变动画】

CSS文字渐变动画 HTML代码CSS代码效果图 HTML代码 <div class"title"><h1>今天是春分</h1><p>正是春天到来的日子&#xff0c;花都开了&#xff0c;小鸟也飞回来了&#xff0c;大山也绿了起来&#xff0c;空气也有点嫩嫩的气息了</p>…

【论文阅读】基于思维链提示的大语言模型软件漏洞发现与修复方法研究

这篇文章来自于 Chain-of-Thought Prompting of Large Language Models for Discovering and Fixing Software Vulnerabilities 摘要 软件安全漏洞在现代系统中呈现泛在化趋势&#xff0c;其引发的社会影响日益显著。尽管已有多种防御技术被提出&#xff0c;基于深度学习&…

SpringMVC_day02

一、SSM 整合 核心步骤 依赖管理 包含 SpringMVC、Spring JDBC、MyBatis、Druid 数据源、Jackson 等依赖。注意点&#xff1a;确保版本兼容性&#xff08;如 Spring 5.x 与 MyBatis 3.5.x&#xff09;。 配置类 SpringConfig&#xff1a;扫描 Service 层、启用事务管理、导入…