前端技术
HTML
CSS
Javascript
前端框架和UI库
VUE
ReactJS
AngularJS
JQuery
NodeJS
JSON
Element-UI
Bootstrap
Material UI
服务端和客户端
Java
Python
PHP
Golang
Scala
Kotlin
Groovy
Ruby
Lua
.net
c#
c++
后端WEB和工程框架
SpringBoot
SpringCloud
Struts2
MyBatis
Hibernate
Tornado
Beego
Go-Spring
Go Gin
Go Iris
Dubbo
HessianRPC
Maven
Gradle
数据库
MySQL
Oracle
Mongo
中间件与web容器
Redis
MemCache
Etcd
Cassandra
Kafka
RabbitMQ
RocketMQ
ActiveMQ
Nacos
Consul
Tomcat
Nginx
Netty
大数据技术
Hive
Impala
ClickHouse
DorisDB
Greenplum
PostgreSQL
HBase
Kylin
Hadoop
Apache Pig
ZooKeeper
SeaTunnel
Sqoop
Datax
Flink
Spark
Mahout
数据搜索与日志
ElasticSearch
Apache Lucene
Apache Solr
Kibana
Logstash
数据可视化与OLAP
Apache Atlas
Superset
Saiku
Tesseract
系统与容器
Linux
Shell
Docker
Kubernetes
[Windows Defender防火墙开...]的搜索结果
这里是文章列表。热门标签的颜色随机变换,标签颜色没有特殊含义。
点击某个标签可搜索标签相关的文章。
点击某个标签可搜索标签相关的文章。
Saiku
...t,再加上指定的那个端口数字,嗖一下,就能打开Saiku酷炫的界面啦! (2) 配置数据源 - 虽然不能给出具体代码示例,但在此环节,你需在Saiku的配置文件中添加你的数据库连接信息,就像人类在面对新环境时需要找到“水源”一样重要。例如,为MySQL配置数据源时,需要填写诸如URL、用户名、密码以及数据立方体名称等详细参数。 4. 在云端服务器配置和使用Saiku (1) 远程部署 - 当Saiku需要在云端服务器上运行时,我们需要考虑网络延迟、安全性和资源分配等问题。首先,你可以通过SSH这类工具,把Saiku服务像打包行李一样上传到服务器上。接着,就像启动一台新电脑那样,在服务器上输入神秘的启动命令,确保这个服务能够在云端畅快地跑起来。 (2) 跨域访问与安全配置 - 如果你的应用跨越了不同网络环境,可能会遇到跨域问题。这时,你可以在Nginx或Apache等反向代理服务器上做相应配置,允许外部网络访问Saiku服务。同时,别忘了加强安全性,比如启用HTTPS,配置防火墙规则等。 5. 针对复杂网络环境的高级配置技巧 - 在复杂的网络环境下,可能涉及多个子网、VPC或者混合云架构,这就需要更精细的路由规划和网络策略设定。比如说,假如Saiku服务藏在一个私有子网里头,而用户又在另一个不同的网络环境里玩,这时候可能就需要捣鼓一下NAT网关啦,或者搞个VPC对等连接什么的,目的就是为了确保大家能既安全又准确地“摸”到Saiku服务。 6. 结语 配置和使用Saiku的过程,就像是在迷宫中寻找出路,需要我们不断地尝试、理解并解决问题。尽管没有具体的代码片段,但每个步骤背后都蕴含着丰富的技术细节和实践经验。只有彻底搞懂每一步操作背后的门道和原理,你才能在任何网络环境里都像老司机那样,轻松玩转这款强大的数据分析神器。 以上内容虽未包含实际代码,但在实践中,每一项配置和设置都会转化为对配置文件或系统参数的具体操作。希望这篇指南能像一位贴心的朋友,手把手带你掌握在各种网络环境下配置和使用Saiku的大招秘籍,而且读完之后,你还能兴奋地想要去解锁更多关于它的新技能呢!
2023-08-17 15:07:18
166
百转千回
转载文章
...果您的服务器正在侦听端口80上的连接,它是否在谈论http? 因为如果没有,不要在端口80上侦听:端口80已经建立为携带http流量。 下一步 - ipaddress和端口一起是端点的唯一标识符。 如果远程客户端通过端口80连接到您的服务器,而不是目标IP和端口,则没有其他信息表明网络层必须识别哪个应用程序(在端口80上侦听)应该获得该数据包。 鉴于配置多个IP地址非常困难 - 在NAT上是不可能的 - 将数据包路由到正确的侦听器的唯一信息就是端口。 所以你不能让两个应用程序在同一个端口上侦听。 ... 您无法通过直接在浏览器中打开它来连接到WebSocket。 您应该使用某个HTML页面创建HTTP服务器和响应。 在此HTML页面中,您应该包含连接到WebSocket服务器的javascript: var socket = new WebSocket("ws://localhost:8080"); You can't connect to WebSocket by open it directly in a browser. You should crea ... 所以我通过握手解决了我的特殊问题,而且非常无聊。 我需要两套“\ r \ n”才能完成握手。 所以为了解决我上面描述的握手问题(Javascript WebSocket没有进入OPEN状态)我需要对我的服务器端PHP进行以下更改(注意最后的\ r \ n \ r \ n,doh) : function dohandshake($user,$buffer){ // getheaders and calcKey are confirmed working, can provide source ... 是。 独立的WebSocket服务器通常可以在任何端口上运行。 浏览器客户端打开与非HTTP(S)端口上的服务器的WebSocket连接没有问题。 默认端口为80/443的主要原因是它们是最可靠的大规模使用端口,因为它们能够遍历阻止所有其他端口上所有流量的许多企业防火墙。 如果这对您的受众来说不是问题(或者您有基于HTTP的回退),那么为WebSocket服务器使用备用端口是完全合理的(并且更容易)。 另一种选择是使用80/443端口,但使用单独的IP地址/主机名。 Yes. A standalo ... Tyrus抱怨Connection: keep-alive, Upgrade header。 Firefox在这里没有做错任何事。 关于如何处理Connection标头,Tyrus过于严格,没有遵循WebSocket规范( RFC-6455 )。 RFC 4.1中的RFC规定: 6. The request MUST contain a |Connection| header field whose value MUST include the "Upgrade" tok ... 说实话,我不能100%确定地说这是什么,但我有一个非常强烈的怀疑。 我的代码中包含了太多的命名空间,我相信在编译器等实际运行时会出现一些混乱。 显然,Microsoft.Web.Websockets和SignalR的命名空间都包含WebSocketHandler。 虽然我不知道SignalR的所有细节,但看起来THAT命名空间中的WebSocketHandler并不意味着在SignalR之外使用。 我相信这个类正在被引用,而不是Microsoft.Web.Websockets中的那个,因为它现在起 ... 您应该使用websocket处理程序,而不是请求处理程序,尝试使用此示例 You should use the websocket handler, not the request handler, try with this example 本篇文章为转载内容。原文链接:https://blog.csdn.net/weixin_34862561/article/details/119512220。 该文由互联网用户投稿提供,文中观点代表作者本人意见,并不代表本站的立场。 作为信息平台,本站仅提供文章转载服务,并不拥有其所有权,也不对文章内容的真实性、准确性和合法性承担责任。 如发现本文存在侵权、违法、违规或事实不符的情况,请及时联系我们,我们将第一时间进行核实并删除相应内容。
2023-03-19 12:00:21
52
转载
Dubbo
... 如果看不到监听的端口,那肯定是服务端没启动成功。 然后,检查服务注册中心是否正常工作。Dubbo支持多种注册中心,比如Zookeeper、Nacos等。如果你用的是Zookeeper,可以试试进入Zookeeper的客户端,看看服务是否已经注册: bash zkCli.sh -server 127.0.0.1:2181 ls /dubbo/com.example.UserService 如果这里看不到服务,那就说明服务注册中心可能有问题。 最后,别忘了检查客户端的配置。客户端的配置文件通常是dubbo-consumer.xml,里面需要填写服务提供者的地址。例如: xml 如果地址写错了,当然就会报错了。 --- 四、代码示例与实际案例分析 下面我给大家举几个具体的例子,让大家更直观地了解Dubbo的报错排查过程。 示例1:服务启动失败 假设你在本地启动服务端时,发现服务一直无法启动,报错如下: Failed to bind URL: dubbo://192.168.1.100:20880/com.example.UserService?anyhost=true&application=demo-provider&dubbo=2.7.8&interface=com.example.UserService&methods=sayHello&pid=12345&side=provider×tamp=123456789 经过检查,你会发现是因为服务端的application.name配置错了。修改后,重新启动服务端,问题就解决了。 示例2:服务找不到 假设你在客户端调用服务时,发现服务找不到,报错如下: No provider available for the service com.example.UserService on the consumer 192.168.1.100 use dubbo version 2.7.8 经过排查,你发现服务注册中心的地址配置错了。正确的配置应该是: xml 示例3:网络不通 假设你在生产环境中,发现客户端和服务端之间的网络不通,报错如下: ConnectException: Connection refused 这时候,你需要检查防火墙设置,确保服务端的端口是开放的。同时,也要检查客户端的网络配置,确保能够访问服务端。 --- 五、总结与感悟 总的来说,Dubbo的报错信息确实有时候让人摸不着头脑,但它并不是不可战胜的。只要你细心排查,结合具体的环境和配置,总能找到问题的根源。 在这个过程中,我学到的东西太多了。比如说啊,别啥都相信默认设置,每一步最好自己动手试一遍,心里才踏实。再比如说,碰到问题的时候,先别忙着去找同事求助,自己多琢磨琢磨,说不定就能找到解决办法了呢!毕竟,编程的乐趣就在于不断解决问题的过程嘛! 最后,我想说的是,Dubbo虽然复杂,但它真的很棒。希望大家都能掌握它,让它成为我们技术生涯中的一把利器!
2025-03-20 16:29:46
63
雪落无痕
Nacos
...瞧瞧服务端的那个监听端口,嘿,8848端口不仅开着呢,而且服务还稳稳地在跑着,一点问题没有! “难道是客户端的网络问题?”我心中一动,赶紧查看了服务端的防火墙规则,确认没有阻断任何请求。接着我又尝试ping了一下Nacos服务端的IP地址,结果发现网络连通性很好。 “网络应该没问题啊,那会不会是超时时间设置得太短了?”我灵机一动,想到之前在其他项目中遇到过类似的问题,可能是客户端等待响应的时间太短,导致请求超时。 于是我修改了Nacos客户端的配置,增加了超时时间: java Properties properties = new Properties(); properties.put(PropertyKeyConst.SERVER_ADDR, "localhost:8848"); properties.put(PropertyKeyConst.CONNECT_TIMEOUT_MS, "5000"); // 增加到5秒 NacosConfigService configService = NacosFactory.createConfigService(properties); 重新启动服务后,问题依然存在。看来超时时间也不是主要原因。 “真是搞不懂啊,难道是Nacos本身的问题?”我有些泄气,但还是决定继续深挖下去。 --- 四、终极排查 代码逻辑与异常处理 最后,我决定从代码逻辑入手,看看是不是程序内部的某些逻辑出了问题。于是我打开了Nacos客户端的源码,开始逐行分析。 在Nacos客户端的实现中,有一个方法是用来获取配置的: java String content = configService.getConfig(dataId, group, timeoutMs); 我仔细检查了这个方法的调用点,发现它是在服务启动时被调用的。你瞧,服务一启动呢,就会加载一堆东西,像数据库连接池啦,缓存配置啦,各种各样的“装备”都得准备好,这样它才能顺利开工干活呀! “会不会是某个配置项的加载顺序影响了Nacos的读取?”我突然想到这一点。我琢磨着这事儿,干脆把所有的配置加载顺序仔仔细细捋了一遍,就为了确保Nacos的配置能在服务刚启动的时候就给安排上,别拖到后面出了幺蛾子。 同时,我还加强了异常处理逻辑,给Nacos的读取操作加上了try-catch块,以便捕获具体的异常信息: java try { String content = configService.getConfig(dataId, group, timeoutMs); System.out.println("Config loaded successfully: " + content); } catch (NacosException e) { System.err.println("Failed to load config: " + e.getMessage()); } 经过一番调整后,我再次启动服务,终于看到了一条令人振奋的消息:“Config loaded successfully”。 “太好了!”我长舒一口气,“原来问题就出在这里啊。” --- 五、总结与感悟 经过这次折腾,我对Nacos有了更深的理解。Nacos这东西确实挺牛的,是个超棒的配置管理工具,但用着用着你会发现,它也不是完美无缺的,各种小问题啊、坑啊,时不时就冒出来折腾你一下。其实吧,这些问题真不一定是Nacos自己惹的祸,八成是咱们的代码写得有点问题,或者是环境配错了,带偏了Nacos。 “其实啊,调试的过程就像侦探破案一样,需要耐心和细心。我坐在电脑前忍不住感慨:“哎,有时候觉得这问题看起来平平无奇的,可谁知道背后可能藏着啥惊天大秘密呢!”” 总之,这次经历让我明白了一个道理:遇到问题不要慌,要冷静分析,逐步排查。只有这样,才能找到问题的根本原因,解决问题。希望我的经验能对大家有所帮助,如果有类似的问题,不妨按照这个思路试试看!
2025-04-06 15:56:57
67
清风徐来
转载文章
...保护你的OS(如打开防火墙) – 用强壮的角色来控制权限(RBAC) 判断AWS和用户分担的安全中的标志是,哪些是AWS可以控制的,那些不能,能的就是AWS负责,否则就是用户(举个例子:安全组的功能由AWS负责—是否生效,但是如何使用是用户负责—自己开放所有端口跟AWS无关) AWS可以保障的 用户需要保障的 工具与服务 操作系统 物理内部流程安全 应用程序 物理基础设施 安全组 网络设施 虚拟化设施 OS防火墙 网络规则 管理账号 8 故障排除 问题经常包括的类型: - EC2实例的连接性问题 - 恢复EC2实例或EBS卷上的数据 - 服务使用限制问题 8.1 EC2实例的连接性问题 经常会有多个原因造成无法连接 外部VPC到内部VPC的实例 – 网关(IGW–internet网关、VPG–虚拟私有网关)的添加问题 – 公司网络到VPC的路由规则设置问题 – VPC各个子网间的路由表问题 – 弹性IP和公有IP的问题 – NACLs(网络访问规则) – 安全组 – OS层面的防火墙 8.2 恢复EC2实例或EBS卷上的数据 注意EBS或EC2没有任何强绑定关系 – EBS是可以从旧实例上分离的 – 如有必要尽快做 将EBS卷挂载到新的、健康的实例上 执行流程可以针对恢复没有工作的启动卷(boot volume) – 将root卷分离出来 – 像数据一样挂载到其他实例 – 修复文件 – 重新挂载到原来的实例中重新启动 8.3 服务使用限制问题 AWS有很多软性限制 – 例如AWS初始化的时候,每个类型的EBS实例最多启动20个 还有一些硬性限制例如 – 每个账号最多拥有100个S3的bucket – …… 别的服务限制了当前服务 – 例如无法启动新EC2实例,原因可能是EBS卷达到上限 – Trusted Advisor这个工具可以根据服务水平的不同给出你一些限制的参考(从免费试用,到商业试用,和企业试用的建议) 常见的软性限制 公共的限制 – 每个用户最多创建20个实例,或更少的实例类型 – 每个区域最多5个弹性ip – 每个vpc最多100个安全组 – 最多20个负载均衡 – 最多20个自动伸缩组 – 5000个EBS卷、10000个快照,4w的IOPS和总共20TB的磁盘 – …更多则需要申请了 你不需要记住限制 – 知道限制,并保持数值敏感度就好 – 日后遇到问题时可以排除掉软限制的相关的问题 9. 总结 9.1 认证的主要目标是: 确认架构师能否搜集需求,并且使用最佳实践,在AWS中构建出这个系统 是否能为应用的整个生命周期给出指导意见 9.2 希望架构师(助理或专家级)考试前的准备: 深度掌握至少1门高级别语言(c,c++,java等) 掌握AWS的三份白皮书 – aws概览 – aws安全流程 – aws风险和应对 – 云中的存储选项 – aws的架构最佳实践 按照客户需求,使用AWS组件来部署混合系统的经验 使用AWS架构中心网站了解更多信息 9.3 经验方面的建议 助理架构师 – 至少6个月的实际操作经验、在AWS中管理生产系统的经验 – 学习过AWS的基本课程 专家架构师 – 至少2年的实际操作经验、在AWS中管理多种不同种类的复杂生产系统的经验(多种服务、动态伸缩、高可用、重构或容错) – 在AWS中执行构建的能力,架构的高级概念能力 9.4 相关资源 认证学习的资源地址 - 可以自己练习,模拟考试需要付费的 接下来就去网上报名参加考试 本篇文章为转载内容。原文链接:https://blog.csdn.net/QXK2001/article/details/51292402。 该文由互联网用户投稿提供,文中观点代表作者本人意见,并不代表本站的立场。 作为信息平台,本站仅提供文章转载服务,并不拥有其所有权,也不对文章内容的真实性、准确性和合法性承担责任。 如发现本文存在侵权、违法、违规或事实不符的情况,请及时联系我们,我们将第一时间进行核实并删除相应内容。
2023-11-29 22:08:40
270
转载
转载文章
...更多在于公有云服务在防火墙内的延伸,其初衷是“将数据迁移到中心云上”,这同样不适合,更难以匹配中国企业希望“将云移动到数据上”的最终目标。 正是源于这些客户“痛点”和市场现状,让华云数据产生了打造一款通用型云操作系统的想法。今年3月1日,华云数据宣布对超融合软件厂商Maxta全部资产完成了合法合规收购。至此,华云数据将独家拥有Maxta的包括产品技术、专利软著、品牌、市场在内的全球范围的资产所有权。 在此基础上,华云数据又把Maxta与华云自身的优势产品相融合,正式推出了安超OS国产通用型云操作系统,并在国产化与通用型方向做了三个方面的重要演进: 首先,兼容国产服务器、CPU、操作系统。安超OS对代码进行了全新的架构扩展,创建并维护新的一套代码分支,从源码级完成众多底层的对国产服务器、CPU、操作系统的支持。 其次,扩展通用型云操作系统的易用性。安超OS以VM为核心做为管理理念,以业务应用的视觉管理基础设施,为云操作系统开发了生命周期管理系统(LCM),提供像服务器操作系统的光盘ISO安装方式,可以30分钟完成云操作系统的搭建,并具备一键集群启停、一键日志收集、一键运维巡检业务等通用型云操作系统所必备的易用性功能。 最后,增强国内行业、企业所需的安全性。安超OS的所有源代码都通过了相关部门的安全检查,确保没有“后门”等漏洞,杜绝安全隐患,并且通过了由中国数据中心联盟、云计算开源产业联盟组织,中国信息通信研究院(工信部电信研究院)测试评估的可信云认证。 不难看出,安超OS不仅具有全球领先的技术,同时又充分满足中国市场和中国客户的需求。正如华云数据集团董事长、总裁许广彬所言:“唯改革者进,唯创新者强,华云数据愿意用全球视野推动中国云计算发展,用云创新驱动数字经济挺进新纵深,植根中国,奉献中国,引领中国,腾飞中国。” 五大维度解读安超OS 那么,什么是云操作系统?安超OS通用型云操作系统又有什么与众不同之处呢? 华云数据集团联席总裁、首席技术官谭瑞忠 在华云数据集团联席总裁、首席技术官谭瑞忠看来,云操作系统是基于服务器操作系统,高度的融合了基础设施的资源,实现了资源弹性伸缩扩展,以及具备运维自动化智能化等云计算的特点。同时,云操作系统具有和计算机操作系统一样的高稳定性,高性能,高易用性等特征。 但是,相比计算机操作系统,云计算的操作系统会更为复杂,属于云计算后台数据中心的整体管理运营系统,是构架于服务器、存储、网络等基础硬件资源和PC操作系统、中间件、数据库等基础软件之上的、管理海量的基础硬件、软件资源的云平台综合管理系统。 更为关键的是,和国内外很多基础设备厂商基于自已的产品与理解推出了云操作系统不同,安超OS走的是通用型云操作系统的技术路线,它不是采用软硬件一体的封闭或半封闭的云操作系统平台,所以这也让安超OS拥有安全稳定、广泛兼容、业务优化、简洁运维、高性价比方面的特性,具体而言: 一是,在安全稳定方面,安超OS采用全容错架构设计,从数据一致性校验到磁盘损坏,从节点故障到区域性灾难,提供端到端的容错和灾备方案,为企业构筑高可用的通用型云环境,为企业的业务运营提供坚实与安全可靠的基础平台。 二是,在广泛兼容方面,安超OS所有产品技术、专利软著、品牌都拥有国内自主权,符合国家相关安全自主可信的规范要求,无服务器硬件锁定,支持国内外主流品牌服务器,同时适配大多数芯片、操作系统和中间件,支持利旧与升级,更新硬件时无需重新购买软件,为企业客户提供显著的投资保护,降低企业IT成本。 三是,在业务优化方面,安超OS具备在同一集群内提供混合业务负载的独特能力,可在一套安超OS环境内实现不同业务的优化:为每类应用定制不同的存储数据块大小,优化应用读写效率,提供更高的业务性能;数据可按组织架构逻辑隔离,部门拥有独立的副本而无需新建一套云环境,降低企业IT的成本与复杂度;数据重构优先级保证关键业务在故障时第一时间恢复,也能避免业务链启动错误的场景出现。 四是,在简捷运维方面,安超OS是一款轻量级云创新平台,其所有管理策略以虚拟机和业务为核心,不需要配置或管理卷、LUN、文件系统、RAID等需求,从根本上简化了云操作系统的管理。通过标准ISO安装,可实现30分钟平台极速搭建,1分钟业务快速部署,一键集群启停与一键运维巡检。降低企业IT技术门槛,使IT部门从技术转移并聚焦于业务推进和变革,助力企业实现软件定义数据中心。 五是,在高性价比方面,安超OS在设计之初,华云数据就考虑到它是一个小而美、大而全的产品,所以给客户提供组件化授权,方便用户按需购买,按需使用,避免一次性采购过度,产生配置浪费。并且安超OS提供在线压缩等容量优化方案,支持无限个数无损快照,无硬件绑定,支持License迁移。 由此可见,安超OS通用型云操作系统的本质,其实就是一款以安全可信为基础,以业务优化为核心的轻量级云创新平台,能够让中国政府和企业在数字化转型中,更好的发挥云平台的价值,同时也能有效的支持他们的业务创新。 生态之上的云操作系统 纵观IT发展的过程,每个时代都离不开通用型操作系统:在PC时代,通用型操作系统是Windows、Linux;在移动互联时代,通用型操作系统是安卓(Android),而这些通用型操作系统之所以能够成功,背后其实也离不开生态的开放和壮大。 如果以此类比的话,生态合作和生态开放同样也是华云安超OS产品的核心战略,这也让安超OS超越了传统意义上的云创新平台,是一款架构于生态开放之上的云操作系统。 华云数据集团副董事长、执行副总裁马杜 据华云数据集团副董事长、执行副总裁马杜介绍,目前华云数据正与业内众多合作伙伴建立了生态合作关系,覆盖硬件、软件、芯片、应用、方案等多个领域,通过生态合作,华云数据希望进一步完善云数据中心的产业链生态,与合作伙伴共建云计算生态圈。 其中,在基础架构方面,华云数据与飞腾、海光、申威等芯片厂商以及中标麒麟、银河麒麟等国产操作系统实现了互认证,与VMware、Dell EMC、广达、浪潮、曙光、长城、Citrix、Veeam、SevOne、XSKY、锐捷网络、上海仪电、NEXIFY等多家国内外知名IT厂商达成了战略合作,共同为中国政企用户提供基于云计算的通用行业解决方案与垂直行业解决方案,助推用户上云实现创新加速模式。 同时,在解决方案方面,华云数据也一直在完善自身的产业链,建立最广泛的生态体系。例如,PaaS平台领域的合作伙伴包括灵雀云、Daocloud、时速云、优创联动、长城超云、蓝云、星环科技、华夏博格、时汇信息、云赛、热璞科技、思捷、和信创天、酷站科技、至臻科技达成合作关系;数据备份领域有金蝶、爱数、Veeam、英方云、壹进制;安全领域有亚信安全、江南安全、绿盟、赛亚安全、默安科技;行业厂商包括善智互联、蓝美视讯、滴滴、天港集团、航天科工等合作伙伴,由此形成了非常有竞争力的整体解决方案。 不仅如此,华云数据与众多生态厂家共同完成了兼容性互认证测试,构建了一个最全面的基础架构生态体系,为推出的国产通用型云操作系统提供了一个坚实的基础。也让该系统提高了其包括架构优化能力、技术研发能力、资源整合能力、海量运营能力在内的综合能力,为客户提供稳定、可靠的上云服务,赋能产业变革。 值得一提的是,华云数据还发布了让利于合作伙伴的渠道合作策略,通过和合作伙伴的合作共赢,华云数据希望将安超OS推广到国内的全行业,让中国企业都能用上安全、放心的国产通用型云操作系统,并让安超OS真正成为未来中国企业上云的重要推手。 显而易见,数字化的转型与升级,以及数字经济的落地和发展,任重而道远,艰难而伟大,而华云数据正以安超OS云操作系统为核心构建的新生态模式和所释放的新能力,不仅会驱动华云数据未来展现出更多的可能性,激发出更多新的升维竞争力,更将会加速整个中国政府和企业的数字化转型步伐。 全文总结,在云计算落地中国的过程中,华云数据既是早期的探索者,也是落地的实践者,更是未来的推动者。特别是安超OS云操作系统的推出,背后正是华云凭借较强的技术驾驭能力,以及对中国企业用户痛点的捕捉,使得华云能够走出一条差异化的创新成长之路,也真正重新定义了“中国云”未来的发展壮大之路。 申耀的科技观察,由科技与汽车跨界媒体人申斯基(微信号:shenyao)创办,16年媒体工作经验,拥有中美两地16万公里自驾经验,专注产业互联网、企业数字化、渠道生态以及汽车科技内容的观察和思考。 本篇文章为转载内容。原文链接:https://blog.csdn.net/W5AeN4Hhx17EDo1/article/details/99899011。 该文由互联网用户投稿提供,文中观点代表作者本人意见,并不代表本站的立场。 作为信息平台,本站仅提供文章转载服务,并不拥有其所有权,也不对文章内容的真实性、准确性和合法性承担责任。 如发现本文存在侵权、违法、违规或事实不符的情况,请及时联系我们,我们将第一时间进行核实并删除相应内容。
2023-03-16 21:41:38
302
转载
转载文章
...主机名 IP 角色 端口 nodename 数据目录 gtm 192.168.20.132 GTM 6666 gtm /nodes/gtm 协调器 5432 coord1 /nodes/coordinator xl1 192.168.20.133 数据节点 5433 node1 /nodes/pgdata gtm代理 6666 gtmpoxy01 /nodes/gtm_pxy1 协调器 5432 coord2 /nodes/coordinator xl2 192.168.20.134 数据节点 5433 node2 /nodes/pgdata gtm代理 6666 gtmpoxy02 /nodes/gtm_pxy2 要求 GNU make版本 3.8及以上版本 [root@pg ~] make --versionGNU Make 3.82Built for x86_64-redhat-linux-gnuCopyright (C) 2010 Free Software Foundation, Inc.License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>This is free software: you are free to change and redistribute it.There is NO WARRANTY, to the extent permitted by law. 需安装GCC包 需安装tar包 用于解压缩文件 默认需要GNU Readline library 其作用是可以让psql命令行记住执行过的命令,并且可以通过键盘上下键切换命令。但是可以通过--without-readline禁用这个特性,或者可以指定--withlibedit-preferred选项来使用libedit 默认使用zlib压缩库 可通过--without-zlib选项来禁用 配置hosts 所有主机上都配置 [root@xl2 11] cat /etc/hosts127.0.0.1 localhost192.168.20.132 gtm192.168.20.133 xl1192.168.20.134 xl2 关闭防火墙、Selinux 所有主机都执行 关闭防火墙: [root@gtm ~] systemctl stop firewalld.service[root@gtm ~] systemctl disable firewalld.service selinux设置: [root@gtm ~]vim /etc/selinux/config 设置SELINUX=disabled,保存退出。 This file controls the state of SELinux on the system. SELINUX= can take one of these three values: enforcing - SELinux security policy is enforced. permissive - SELinux prints warnings instead of enforcing. disabled - No SELinux policy is loaded.SELINUX=disabled SELINUXTYPE= can take one of three two values: targeted - Targeted processes are protected, minimum - Modification of targeted policy. Only selected processes are protected. mls - Multi Level Security protection. 安装依赖包 所有主机上都执行 yum install -y flex bison readline-devel zlib-devel openjade docbook-style-dsssl gcc 创建用户 所有主机上都执行 [root@gtm ~] useradd postgres[root@gtm ~] passwd postgres[root@gtm ~] su - postgres[root@gtm ~] mkdir ~/.ssh[root@gtm ~] chmod 700 ~/.ssh 配置SSH免密登录 仅仅在gtm节点配置如下操作: [root@gtm ~] su - postgres[postgres@gtm ~] ssh-keygen -t rsa[postgres@gtm ~] cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys[postgres@gtm ~] chmod 600 ~/.ssh/authorized_keys 将刚生成的认证文件拷贝到xl1到xl2中,使得gtm节点可以免密码登录xl1~xl2的任意一个节点: [postgres@gtm ~] scp ~/.ssh/authorized_keys postgres@xl1:~/.ssh/[postgres@gtm ~] scp ~/.ssh/authorized_keys postgres@xl2:~/.ssh/ 对所有提示都不要输入,直接enter下一步。直到最后,因为第一次要求输入目标机器的用户密码,输入即可。 下载源码 下载地址:https://www.postgres-xl.org/download/ [root@slave ~] ll postgres-xl-10r1.1.tar.gz-rw-r--r-- 1 root root 28121666 May 30 05:21 postgres-xl-10r1.1.tar.gz 编译、安装Postgres-XL 所有节点都安装,编译需要一点时间,最好同时进行编译。 [root@slave ~] tar xvf postgres-xl-10r1.1.tar.gz[root@slave ~] ./configure --prefix=/home/postgres/pgxl/[root@slave ~] make[root@slave ~] make install[root@slave ~] cd contrib/ --安装必要的工具,在gtm节点上安装即可[root@slave ~] make[root@slave ~] make install 配置环境变量 所有节点都要配置 进入postgres用户,修改其环境变量,开始编辑 [root@gtm ~]su - postgres[postgres@gtm ~]vi .bashrc --不是.bash_profile 在打开的文件末尾,新增如下变量配置: export PGHOME=/home/postgres/pgxlexport LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATHexport PATH=$PGHOME/bin:$PATH 按住esc,然后输入:wq!保存退出。输入以下命令对更改重启生效。 [postgres@gtm ~] source .bashrc --不是.bash_profile 输入以下语句,如果输出变量结果,代表生效 [postgres@gtm ~] echo $PGHOME 应该输出/home/postgres/pgxl代表生效 配置集群 生成pgxc_ctl.conf配置文件 [postgres@gtm ~] pgxc_ctl prepare/bin/bashInstalling pgxc_ctl_bash script as /home/postgres/pgxl/pgxc_ctl/pgxc_ctl_bash.ERROR: File "/home/postgres/pgxl/pgxc_ctl/pgxc_ctl.conf" not found or not a regular file. No such file or directoryInstalling pgxc_ctl_bash script as /home/postgres/pgxl/pgxc_ctl/pgxc_ctl_bash.Reading configuration using /home/postgres/pgxl/pgxc_ctl/pgxc_ctl_bash --home /home/postgres/pgxl/pgxc_ctl --configuration /home/postgres/pgxl/pgxc_ctl/pgxc_ctl.confFinished reading configuration. PGXC_CTL START Current directory: /home/postgres/pgxl/pgxc_ctl 配置pgxc_ctl.conf 新建/home/postgres/pgxc_ctl/pgxc_ctl.conf文件,编辑如下: 对着模板文件一个一个修改,否则会造成初始化过程出现各种神奇问题。 pgxcInstallDir=$PGHOMEpgxlDATA=$PGHOME/data pgxcOwner=postgres---- GTM Master -----------------------------------------gtmName=gtmgtmMasterServer=gtmgtmMasterPort=6666gtmMasterDir=$pgxlDATA/nodes/gtmgtmSlave=y Specify y if you configure GTM Slave. Otherwise, GTM slave will not be configured and all the following variables will be reset.gtmSlaveName=gtmSlavegtmSlaveServer=gtm value none means GTM slave is not available. Give none if you don't configure GTM Slave.gtmSlavePort=20001 Not used if you don't configure GTM slave.gtmSlaveDir=$pgxlDATA/nodes/gtmSlave Not used if you don't configure GTM slave.---- GTM-Proxy Master -------gtmProxyDir=$pgxlDATA/nodes/gtm_proxygtmProxy=y gtmProxyNames=(gtm_pxy1 gtm_pxy2) gtmProxyServers=(xl1 xl2) gtmProxyPorts=(6666 6666) gtmProxyDirs=($gtmProxyDir $gtmProxyDir) ---- Coordinators ---------coordMasterDir=$pgxlDATA/nodes/coordcoordNames=(coord1 coord2) coordPorts=(5432 5432) poolerPorts=(6667 6667) coordPgHbaEntries=(0.0.0.0/0)coordMasterServers=(xl1 xl2) coordMasterDirs=($coordMasterDir $coordMasterDir)coordMaxWALsernder=0 没设置备份节点,设置为0coordMaxWALSenders=($coordMaxWALsernder $coordMaxWALsernder) 数量保持和coordMasterServers一致coordSlave=n---- Datanodes ----------datanodeMasterDir=$pgxlDATA/nodes/dn_masterprimaryDatanode=xl1 主数据节点datanodeNames=(node1 node2)datanodePorts=(5433 5433) datanodePoolerPorts=(6668 6668) datanodePgHbaEntries=(0.0.0.0/0)datanodeMasterServers=(xl1 xl2)datanodeMasterDirs=($datanodeMasterDir $datanodeMasterDir)datanodeMaxWalSender=4datanodeMaxWALSenders=($datanodeMaxWalSender $datanodeMaxWalSender) 集群初始化,启动,停止 初始化 pgxc_ctl -c /home/postgres/pgxc_ctl/pgxc_ctl.conf init all 输出结果: /bin/bashInstalling pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Installing pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Reading configuration using /home/postgres/pgxc_ctl/pgxc_ctl_bash --home /home/postgres/pgxc_ctl --configuration /home/postgres/pgxc_ctl/pgxc_ctl.conf/home/postgres/pgxc_ctl/pgxc_ctl.conf: line 189: $coordExtraConfig: ambiguous redirectFinished reading configuration. PGXC_CTL START Current directory: /home/postgres/pgxc_ctlStopping all the coordinator masters.Stopping coordinator master coord1.Stopping coordinator master coord2.pg_ctl: directory "/home/postgres/pgxc/nodes/coord/coord1" does not existpg_ctl: directory "/home/postgres/pgxc/nodes/coord/coord2" does not existDone.Stopping all the datanode masters.Stopping datanode master datanode1.Stopping datanode master datanode2.pg_ctl: PID file "/home/postgres/pgxc/nodes/datanode/datanode1/postmaster.pid" does not existIs server running?Done.Stop GTM masterwaiting for server to shut down.... doneserver stopped[postgres@gtm ~]$ echo $PGHOME/home/postgres/pgxl[postgres@gtm ~]$ ll /home/postgres/pgxl/pgxc/nodes/gtm/gtm.^C[postgres@gtm ~]$ pgxc_ctl -c /home/postgres/pgxc_ctl/pgxc_ctl.conf init all/bin/bashInstalling pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Installing pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Reading configuration using /home/postgres/pgxc_ctl/pgxc_ctl_bash --home /home/postgres/pgxc_ctl --configuration /home/postgres/pgxc_ctl/pgxc_ctl.conf/home/postgres/pgxc_ctl/pgxc_ctl.conf: line 189: $coordExtraConfig: ambiguous redirectFinished reading configuration. PGXC_CTL START Current directory: /home/postgres/pgxc_ctlInitialize GTM masterERROR: target directory (/home/postgres/pgxc/nodes/gtm) exists and not empty. Skip GTM initilializationDone.Start GTM masterserver startingInitialize all the coordinator masters.Initialize coordinator master coord1.ERROR: target coordinator master coord1 is running now. Skip initilialization.Initialize coordinator master coord2.The files belonging to this database system will be owned by user "postgres".This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8".The default database encoding has accordingly been set to "UTF8".The default text search configuration will be set to "english".Data page checksums are disabled.fixing permissions on existing directory /home/postgres/pgxc/nodes/coord/coord2 ... okcreating subdirectories ... okselecting default max_connections ... 100selecting default shared_buffers ... 128MBselecting dynamic shared memory implementation ... posixcreating configuration files ... okrunning bootstrap script ... okperforming post-bootstrap initialization ... creating cluster information ... oksyncing data to disk ... okfreezing database template0 ... okfreezing database template1 ... okfreezing database postgres ... okWARNING: enabling "trust" authentication for local connectionsYou can change this by editing pg_hba.conf or using the option -A, or--auth-local and --auth-host, the next time you run initdb.Success.Done.Starting coordinator master.Starting coordinator master coord1ERROR: target coordinator master coord1 is already running now. Skip initialization.Starting coordinator master coord22019-05-30 21:09:25.562 EDT [2148] LOG: listening on IPv4 address "0.0.0.0", port 54322019-05-30 21:09:25.562 EDT [2148] LOG: listening on IPv6 address "::", port 54322019-05-30 21:09:25.563 EDT [2148] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"2019-05-30 21:09:25.601 EDT [2149] LOG: database system was shut down at 2019-05-30 21:09:22 EDT2019-05-30 21:09:25.605 EDT [2148] LOG: database system is ready to accept connections2019-05-30 21:09:25.612 EDT [2156] LOG: cluster monitor startedDone.Initialize all the datanode masters.Initialize the datanode master datanode1.Initialize the datanode master datanode2.The files belonging to this database system will be owned by user "postgres".This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8".The default database encoding has accordingly been set to "UTF8".The default text search configuration will be set to "english".Data page checksums are disabled.fixing permissions on existing directory /home/postgres/pgxc/nodes/datanode/datanode1 ... okcreating subdirectories ... okselecting default max_connections ... 100selecting default shared_buffers ... 128MBselecting dynamic shared memory implementation ... posixcreating configuration files ... okrunning bootstrap script ... okperforming post-bootstrap initialization ... creating cluster information ... oksyncing data to disk ... okfreezing database template0 ... okfreezing database template1 ... okfreezing database postgres ... okWARNING: enabling "trust" authentication for local connectionsYou can change this by editing pg_hba.conf or using the option -A, or--auth-local and --auth-host, the next time you run initdb.Success.The files belonging to this database system will be owned by user "postgres".This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8".The default database encoding has accordingly been set to "UTF8".The default text search configuration will be set to "english".Data page checksums are disabled.fixing permissions on existing directory /home/postgres/pgxc/nodes/datanode/datanode2 ... okcreating subdirectories ... okselecting default max_connections ... 100selecting default shared_buffers ... 128MBselecting dynamic shared memory implementation ... posixcreating configuration files ... okrunning bootstrap script ... okperforming post-bootstrap initialization ... creating cluster information ... oksyncing data to disk ... okfreezing database template0 ... okfreezing database template1 ... okfreezing database postgres ... okWARNING: enabling "trust" authentication for local connectionsYou can change this by editing pg_hba.conf or using the option -A, or--auth-local and --auth-host, the next time you run initdb.Success.Done.Starting all the datanode masters.Starting datanode master datanode1.WARNING: datanode master datanode1 is running now. Skipping.Starting datanode master datanode2.2019-05-30 21:09:33.352 EDT [2404] LOG: listening on IPv4 address "0.0.0.0", port 154322019-05-30 21:09:33.352 EDT [2404] LOG: listening on IPv6 address "::", port 154322019-05-30 21:09:33.355 EDT [2404] LOG: listening on Unix socket "/tmp/.s.PGSQL.15432"2019-05-30 21:09:33.392 EDT [2404] LOG: redirecting log output to logging collector process2019-05-30 21:09:33.392 EDT [2404] HINT: Future log output will appear in directory "pg_log".Done.psql: FATAL: no pg_hba.conf entry for host "192.168.20.132", user "postgres", database "postgres"psql: FATAL: no pg_hba.conf entry for host "192.168.20.132", user "postgres", database "postgres"Done.psql: FATAL: no pg_hba.conf entry for host "192.168.20.132", user "postgres", database "postgres"psql: FATAL: no pg_hba.conf entry for host "192.168.20.132", user "postgres", database "postgres"Done.[postgres@gtm ~]$ pgxc_ctl -c /home/postgres/pgxc_ctl/pgxc_ctl.conf stop all/bin/bashInstalling pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Installing pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Reading configuration using /home/postgres/pgxc_ctl/pgxc_ctl_bash --home /home/postgres/pgxc_ctl --configuration /home/postgres/pgxc_ctl/pgxc_ctl.conf/home/postgres/pgxc_ctl/pgxc_ctl.conf: line 189: $coordExtraConfig: ambiguous redirectFinished reading configuration. PGXC_CTL START Current directory: /home/postgres/pgxc_ctlStopping all the coordinator masters.Stopping coordinator master coord1.Stopping coordinator master coord2.pg_ctl: directory "/home/postgres/pgxc/nodes/coord/coord1" does not existDone.Stopping all the datanode masters.Stopping datanode master datanode1.Stopping datanode master datanode2.pg_ctl: PID file "/home/postgres/pgxc/nodes/datanode/datanode1/postmaster.pid" does not existIs server running?Done.Stop GTM masterwaiting for server to shut down.... doneserver stopped[postgres@gtm ~]$ pgxc_ctl/bin/bashInstalling pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Installing pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Reading configuration using /home/postgres/pgxc_ctl/pgxc_ctl_bash --home /home/postgres/pgxc_ctl --configuration /home/postgres/pgxc_ctl/pgxc_ctl.conf/home/postgres/pgxc_ctl/pgxc_ctl.conf: line 189: $coordExtraConfig: ambiguous redirectFinished reading configuration. PGXC_CTL START Current directory: /home/postgres/pgxc_ctlPGXC monitor allNot running: gtm masterRunning: coordinator master coord1Not running: coordinator master coord2Running: datanode master datanode1Not running: datanode master datanode2PGXC stop coordinator master coord1Stopping coordinator master coord1.pg_ctl: directory "/home/postgres/pgxc/nodes/coord/coord1" does not existDone.PGXC stop datanode master datanode1Stopping datanode master datanode1.pg_ctl: PID file "/home/postgres/pgxc/nodes/datanode/datanode1/postmaster.pid" does not existIs server running?Done.PGXC monitor allNot running: gtm masterRunning: coordinator master coord1Not running: coordinator master coord2Running: datanode master datanode1Not running: datanode master datanode2PGXC monitor allNot running: gtm masterNot running: coordinator master coord1Not running: coordinator master coord2Not running: datanode master datanode1Not running: datanode master datanode2PGXC exit[postgres@gtm ~]$ pgxc_ctl -c /home/postgres/pgxc_ctl/pgxc_ctl.conf init all/bin/bashInstalling pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Installing pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Reading configuration using /home/postgres/pgxc_ctl/pgxc_ctl_bash --home /home/postgres/pgxc_ctl --configuration /home/postgres/pgxc_ctl/pgxc_ctl.conf/home/postgres/pgxc_ctl/pgxc_ctl.conf: line 189: $coordExtraConfig: ambiguous redirectFinished reading configuration. PGXC_CTL START Current directory: /home/postgres/pgxc_ctlInitialize GTM masterERROR: target directory (/home/postgres/pgxc/nodes/gtm) exists and not empty. Skip GTM initilializationDone.Start GTM masterserver startingInitialize all the coordinator masters.Initialize coordinator master coord1.Initialize coordinator master coord2.The files belonging to this database system will be owned by user "postgres".This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8".The default database encoding has accordingly been set to "UTF8".The default text search configuration will be set to "english".Data page checksums are disabled.fixing permissions on existing directory /home/postgres/pgxc/nodes/coord/coord1 ... okcreating subdirectories ... okselecting default max_connections ... 100selecting default shared_buffers ... 128MBselecting dynamic shared memory implementation ... posixcreating configuration files ... okrunning bootstrap script ... okperforming post-bootstrap initialization ... creating cluster information ... oksyncing data to disk ... okfreezing database template0 ... okfreezing database template1 ... okfreezing database postgres ... okWARNING: enabling "trust" authentication for local connectionsYou can change this by editing pg_hba.conf or using the option -A, or--auth-local and --auth-host, the next time you run initdb.Success.The files belonging to this database system will be owned by user "postgres".This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8".The default database encoding has accordingly been set to "UTF8".The default text search configuration will be set to "english".Data page checksums are disabled.fixing permissions on existing directory /home/postgres/pgxc/nodes/coord/coord2 ... okcreating subdirectories ... okselecting default max_connections ... 100selecting default shared_buffers ... 128MBselecting dynamic shared memory implementation ... posixcreating configuration files ... okrunning bootstrap script ... okperforming post-bootstrap initialization ... creating cluster information ... oksyncing data to disk ... okfreezing database template0 ... okfreezing database template1 ... okfreezing database postgres ... okWARNING: enabling "trust" authentication for local connectionsYou can change this by editing pg_hba.conf or using the option -A, or--auth-local and --auth-host, the next time you run initdb.Success.Done.Starting coordinator master.Starting coordinator master coord1Starting coordinator master coord22019-05-30 21:13:03.998 EDT [25137] LOG: listening on IPv4 address "0.0.0.0", port 54322019-05-30 21:13:03.998 EDT [25137] LOG: listening on IPv6 address "::", port 54322019-05-30 21:13:04.000 EDT [25137] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"2019-05-30 21:13:04.038 EDT [25138] LOG: database system was shut down at 2019-05-30 21:13:00 EDT2019-05-30 21:13:04.042 EDT [25137] LOG: database system is ready to accept connections2019-05-30 21:13:04.049 EDT [25145] LOG: cluster monitor started2019-05-30 21:13:04.020 EDT [2730] LOG: listening on IPv4 address "0.0.0.0", port 54322019-05-30 21:13:04.020 EDT [2730] LOG: listening on IPv6 address "::", port 54322019-05-30 21:13:04.021 EDT [2730] LOG: listening on Unix socket "/tmp/.s.PGSQL.5432"2019-05-30 21:13:04.057 EDT [2731] LOG: database system was shut down at 2019-05-30 21:13:00 EDT2019-05-30 21:13:04.061 EDT [2730] LOG: database system is ready to accept connections2019-05-30 21:13:04.062 EDT [2738] LOG: cluster monitor startedDone.Initialize all the datanode masters.Initialize the datanode master datanode1.Initialize the datanode master datanode2.The files belonging to this database system will be owned by user "postgres".This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8".The default database encoding has accordingly been set to "UTF8".The default text search configuration will be set to "english".Data page checksums are disabled.fixing permissions on existing directory /home/postgres/pgxc/nodes/datanode/datanode1 ... okcreating subdirectories ... okselecting default max_connections ... 100selecting default shared_buffers ... 128MBselecting dynamic shared memory implementation ... posixcreating configuration files ... okrunning bootstrap script ... okperforming post-bootstrap initialization ... creating cluster information ... oksyncing data to disk ... okfreezing database template0 ... okfreezing database template1 ... okfreezing database postgres ... okWARNING: enabling "trust" authentication for local connectionsYou can change this by editing pg_hba.conf or using the option -A, or--auth-local and --auth-host, the next time you run initdb.Success.The files belonging to this database system will be owned by user "postgres".This user must also own the server process.The database cluster will be initialized with locale "en_US.UTF-8".The default database encoding has accordingly been set to "UTF8".The default text search configuration will be set to "english".Data page checksums are disabled.fixing permissions on existing directory /home/postgres/pgxc/nodes/datanode/datanode2 ... okcreating subdirectories ... okselecting default max_connections ... 100selecting default shared_buffers ... 128MBselecting dynamic shared memory implementation ... posixcreating configuration files ... okrunning bootstrap script ... okperforming post-bootstrap initialization ... creating cluster information ... oksyncing data to disk ... okfreezing database template0 ... okfreezing database template1 ... okfreezing database postgres ... okWARNING: enabling "trust" authentication for local connectionsYou can change this by editing pg_hba.conf or using the option -A, or--auth-local and --auth-host, the next time you run initdb.Success.Done.Starting all the datanode masters.Starting datanode master datanode1.Starting datanode master datanode2.2019-05-30 21:13:12.077 EDT [25392] LOG: listening on IPv4 address "0.0.0.0", port 154322019-05-30 21:13:12.077 EDT [25392] LOG: listening on IPv6 address "::", port 154322019-05-30 21:13:12.079 EDT [25392] LOG: listening on Unix socket "/tmp/.s.PGSQL.15432"2019-05-30 21:13:12.114 EDT [25392] LOG: redirecting log output to logging collector process2019-05-30 21:13:12.114 EDT [25392] HINT: Future log output will appear in directory "pg_log".2019-05-30 21:13:12.079 EDT [2985] LOG: listening on IPv4 address "0.0.0.0", port 154322019-05-30 21:13:12.079 EDT [2985] LOG: listening on IPv6 address "::", port 154322019-05-30 21:13:12.081 EDT [2985] LOG: listening on Unix socket "/tmp/.s.PGSQL.15432"2019-05-30 21:13:12.117 EDT [2985] LOG: redirecting log output to logging collector process2019-05-30 21:13:12.117 EDT [2985] HINT: Future log output will appear in directory "pg_log".Done.psql: FATAL: no pg_hba.conf entry for host "192.168.20.132", user "postgres", database "postgres"psql: FATAL: no pg_hba.conf entry for host "192.168.20.132", user "postgres", database "postgres"Done.psql: FATAL: no pg_hba.conf entry for host "192.168.20.132", user "postgres", database "postgres"psql: FATAL: no pg_hba.conf entry for host "192.168.20.132", user "postgres", database "postgres"Done. 启动 pgxc_ctl -c /home/postgres/pgxc_ctl/pgxc_ctl.conf start all 关闭 pgxc_ctl -c /home/postgres/pgxc_ctl/pgxc_ctl.conf stop all 查看集群状态 [postgres@gtm ~]$ pgxc_ctl monitor all/bin/bashInstalling pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Installing pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Reading configuration using /home/postgres/pgxc_ctl/pgxc_ctl_bash --home /home/postgres/pgxc_ctl --configuration /home/postgres/pgxc_ctl/pgxc_ctl.conf/home/postgres/pgxc_ctl/pgxc_ctl.conf: line 189: $coordExtraConfig: ambiguous redirectFinished reading configuration. PGXC_CTL START Current directory: /home/postgres/pgxc_ctlRunning: gtm masterRunning: coordinator master coord1Running: coordinator master coord2Running: datanode master datanode1Running: datanode master datanode2 配置集群信息 分别在数据节点、协调器节点上分别执行以下命令: 注:本节点只执行修改操作即可(alert node),其他节点执行创建命令(create node)。因为本节点已经包含本节点的信息。 create node coord1 with (type=coordinator,host=xl1, port=5432);create node coord2 with (type=coordinator,host=xl2, port=5432);alter node coord1 with (type=coordinator,host=xl1, port=5432);alter node coord2 with (type=coordinator,host=xl2, port=5432);create node datanode1 with (type=datanode, host=xl1,port=15432,primary=true,PREFERRED);create node datanode2 with (type=datanode, host=xl2,port=15432);alter node datanode1 with (type=datanode, host=xl1,port=15432,primary=true,PREFERRED);alter node datanode2 with (type=datanode, host=xl2,port=15432);select pgxc_pool_reload(); 分别登陆数据节点、协调器节点验证 postgres= select from pgxc_node;node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred | node_id-----------+-----------+-----------+-----------+----------------+------------------+-------------coord1 | C | 5432 | xl1 | f | f | 1885696643coord2 | C | 5432 | xl2 | f | f | -1197102633datanode2 | D | 15432 | xl2 | f | f | -905831925datanode1 | D | 15432 | xl1 | t | f | 888802358(4 rows) 测试 插入数据 在数据节点1,执行相关操作。 通过协调器端口登录PG [postgres@xl1 ~]$ psql -p 5432psql (PGXL 10r1.1, based on PG 10.6 (Postgres-XL 10r1.1))Type "help" for help.postgres= create database lei;CREATE DATABASEpostgres= \c lei;You are now connected to database "lei" as user "postgres".lei= create table test1(id int,name text);CREATE TABLElei= insert into test1(id,name) select generate_series(1,8),'测试';INSERT 0 8lei= select from test1;id | name----+------1 | 测试2 | 测试5 | 测试6 | 测试8 | 测试3 | 测试4 | 测试7 | 测试(8 rows) 注:默认创建的表为分布式表,也就是每个数据节点值存储表的部分数据。关于表类型具体说明,下面有说明。 通过15432端口登录数据节点,查看数据 有5条数据 [postgres@xl1 ~]$ psql -p 15432psql (PGXL 10r1.1, based on PG 10.6 (Postgres-XL 10r1.1))Type "help" for help.postgres= \c lei;You are now connected to database "lei" as user "postgres".lei= select from test1;id | name----+------1 | 测试2 | 测试5 | 测试6 | 测试8 | 测试(5 rows) 登录到节点2,查看数据 有3条数据 [postgres@xl2 ~]$ psql -p15432psql (PGXL 10r1.1, based on PG 10.6 (Postgres-XL 10r1.1))Type "help" for help.postgres= \c lei;You are now connected to database "lei" as user "postgres".lei= select from test1;id | name----+------3 | 测试4 | 测试7 | 测试(3 rows) 两个节点的数据加起来整个8条,没有问题。 至此Postgre-XL集群搭建完成。 创建数据库、表时可能会出现以下错误: ERROR: Failed to get pooled connections 是因为pg_hba.conf配置不对,所有节点加上host all all 192.168.20.0/0 trust并重启集群即可。 ERROR: No Datanode defined in cluster 首先确认是否创建了数据节点,也就是create node相关的命令。如果创建了则执行select pgxc_pool_reload();使其生效即可。 集群管理与应用 表类型说明 REPLICATION表:各个datanode节点中,表的数据完全相同,也就是说,插入数据时,会分别在每个datanode节点插入相同数据。读数据时,只需要读任意一个datanode节点上的数据。 建表语法: CREATE TABLE repltab (col1 int, col2 int) DISTRIBUTE BY REPLICATION; DISTRIBUTE :会将插入的数据,按照拆分规则,分配到不同的datanode节点中存储,也就是sharding技术。每个datanode节点只保存了部分数据,通过coordinate节点可以查询完整的数据视图。 CREATE TABLE disttab(col1 int, col2 int, col3 text) DISTRIBUTE BY HASH(col1); 模拟数据插入 任意登录一个coordinate节点进行建表操作 [postgres@gtm ~]$ psql -h xl1 -p 5432 -U postgrespostgres= INSERT INTO disttab SELECT generate_series(1,100), generate_series(101, 200), 'foo';INSERT 0 100postgres= INSERT INTO repltab SELECT generate_series(1,100), generate_series(101, 200);INSERT 0 100 查看数据分布结果: DISTRIBUTE表分布结果 postgres= SELECT xc_node_id, count() FROM disttab GROUP BY xc_node_id;xc_node_id | count ------------+-------1148549230 | 42-927910690 | 58(2 rows) REPLICATION表分布结果 postgres= SELECT count() FROM repltab;count -------100(1 row) 查看另一个datanode2中repltab表结果 [postgres@datanode2 pgxl9.5]$ psql -p 15432psql (PGXL 10r1.1, based on PG 10.6 (Postgres-XL 10r1.1))Type "help" for help.postgres= SELECT count() FROM repltab;count -------100(1 row) 结论:REPLICATION表中,datanode1,datanode2中表是全部数据,一模一样。而DISTRIBUTE表,数据散落近乎平均分配到了datanode1,datanode2节点中。 新增数据节点与数据重分布 在线新增节点、并重新分布数据。 新增datanode节点 在gtm集群管理节点上执行pgxc_ctl命令 [postgres@gtm ~]$ pgxc_ctl/bin/bashInstalling pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Installing pgxc_ctl_bash script as /home/postgres/pgxc_ctl/pgxc_ctl_bash.Reading configuration using /home/postgres/pgxc_ctl/pgxc_ctl_bash --home /home/postgres/pgxc_ctl --configuration /home/postgres/pgxc_ctl/pgxc_ctl.confFinished reading configuration. PGXC_CTL START Current directory: /home/postgres/pgxc_ctlPGXC 在服务器xl3上,新增一个master角色的datanode节点,名称是datanode3 端口号暂定5430,pool master暂定6669 ,指定好数据目录位置,从两个节点升级到3个节点,之后要写3个none none应该是datanodeSpecificExtraConfig或者datanodeSpecificExtraPgHba配置PGXC add datanode master datanode3 xl3 15432 6671 /home/postgres/pgxc/nodes/datanode/datanode3 none none none 等待新增完成后,查询集群节点状态: postgres= select from pgxc_node;node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred | node_id-----------+-----------+-----------+-----------+----------------+------------------+-------------datanode1 | D | 15432 | xl1 | t | f | 888802358datanode2 | D | 15432 | xl2 | f | f | -905831925datanode3 | D | 15432 | xl3 | f | f | -705831925coord1 | C | 5432 | xl1 | f | f | 1885696643coord2 | C | 5432 | xl2 | f | f | -1197102633(4 rows) 节点新增完毕 数据重新分布 由于新增节点后无法自动完成数据重新分布,需要手动操作。 DISTRIBUTE表分布在了node1,node2节点上,如下: postgres= SELECT xc_node_id, count() FROM disttab GROUP BY xc_node_id;xc_node_id | count ------------+-------1148549230 | 42-927910690 | 58(2 rows) 新增一个节点后,将sharding表数据重新分配到三个节点上,将repl表复制到新节点 重分布sharding表postgres= ALTER TABLE disttab ADD NODE (datanode3);ALTER TABLE 复制数据到新节点postgres= ALTER TABLE repltab ADD NODE (datanode3);ALTER TABLE 查看新的数据分布: postgres= SELECT xc_node_id, count() FROM disttab GROUP BY xc_node_id;xc_node_id | count ------------+--------700122826 | 36-927910690 | 321148549230 | 32(3 rows) 登录datanode3(新增的时候,放在了xl3服务器上,端口15432)节点查看数据: [postgres@gtm ~]$ psql -h xl3 -p 15432 -U postgrespsql (PGXL 10r1.1, based on PG 10.6 (Postgres-XL 10r1.1))Type "help" for help.postgres= select count() from repltab;count -------100(1 row) 很明显,通过 ALTER TABLE tt ADD NODE (dn)命令,可以将DISTRIBUTE表数据重新分布到新节点,重分布过程中会中断所有事务。可以将REPLICATION表数据复制到新节点。 从datanode节点中回收数据 postgres= ALTER TABLE disttab DELETE NODE (datanode3);ALTER TABLEpostgres= ALTER TABLE repltab DELETE NODE (datanode3);ALTER TABLE 删除数据节点 Postgresql-XL并没有检查将被删除的datanode节点是否有replicated/distributed表的数据,为了数据安全,在删除之前需要检查下被删除节点上的数据,有数据的话,要回收掉分配到其他节点,然后才能安全删除。删除数据节点分为四步骤: 1.查询要删除节点dn3的oid postgres= SELECT oid, FROM pgxc_node;oid | node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred | node_id -------+-----------+-----------+-----------+-----------+----------------+------------------+-------------11819 | coord1 | C | 5432 | datanode1 | f | f | 188569664316384 | coord2 | C | 5432 | datanode2 | f | f | -119710263316385 | node1 | D | 5433 | datanode1 | f | t | 114854923016386 | node2 | D | 5433 | datanode2 | f | f | -92791069016397 | dn3 | D | 5430 | datanode1 | f | f | -700122826(5 rows) 2.查询dn3对应的oid中是否有数据 testdb= SELECT FROM pgxc_class WHERE nodeoids::integer[] @> ARRAY[16397];pcrelid | pclocatortype | pcattnum | pchashalgorithm | pchashbuckets | nodeoids ---------+---------------+----------+-----------------+---------------+-------------------16388 | H | 1 | 1 | 4096 | 16397 16385 1638616394 | R | 0 | 0 | 0 | 16397 16385 16386(2 rows) 3.有数据的先回收数据 postgres= ALTER TABLE disttab DELETE NODE (dn3);ALTER TABLEpostgres= ALTER TABLE repltab DELETE NODE (dn3);ALTER TABLEpostgres= SELECT FROM pgxc_class WHERE nodeoids::integer[] @> ARRAY[16397];pcrelid | pclocatortype | pcattnum | pchashalgorithm | pchashbuckets | nodeoids ---------+---------------+----------+-----------------+---------------+----------(0 rows) 4.安全删除dn3 PGXC$ remove datanode master dn3 clean 故障节点FAILOVER 1.查看当前集群状态 [postgres@gtm ~]$ psql -h xl1 -p 5432psql (PGXL 10r1.1, based on PG 10.6 (Postgres-XL 10r1.1))Type "help" for help.postgres= SELECT oid, FROM pgxc_node;oid | node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred | node_id-------+-----------+-----------+-----------+-----------+----------------+------------------+-------------11739 | coord1 | C | 5432 | xl1 | f | f | 188569664316384 | coord2 | C | 5432 | xl2 | f | f | -119710263316387 | datanode2 | D | 15432 | xl2 | f | f | -90583192516388 | datanode1 | D | 15432 | xl1 | t | t | 888802358(4 rows) 2.模拟datanode1节点故障 直接关闭即可 PGXC stop -m immediate datanode master datanode1Stopping datanode master datanode1.Done. 3.测试查询 只要查询涉及到datanode1上的数据,那么该查询就会报错 postgres= SELECT xc_node_id, count() FROM disttab GROUP BY xc_node_id;WARNING: failed to receive file descriptors for connectionsERROR: Failed to get pooled connectionsHINT: This may happen because one or more nodes are currently unreachable, either because of node or network failure.Its also possible that the target node may have hit the connection limit or the pooler is configured with low connections.Please check if all nodes are running fine and also review max_connections and max_pool_size configuration parameterspostgres= SELECT xc_node_id, FROM disttab WHERE col1 = 3;xc_node_id | col1 | col2 | col3------------+------+------+-------905831925 | 3 | 103 | foo(1 row) 测试发现,查询范围如果涉及到故障的node1节点,会报错,而查询的数据范围不在node1上的话,仍然可以查询。 4.手动切换 要想切换,必须要提前配置slave节点。 PGXC$ failover datanode node1 切换完成后,查询集群 postgres= SELECT oid, FROM pgxc_node;oid | node_name | node_type | node_port | node_host | nodeis_primary | nodeis_preferred | node_id -------+-----------+-----------+-----------+-----------+----------------+------------------+-------------11819 | coord1 | C | 5432 | datanode1 | f | f | 188569664316384 | coord2 | C | 5432 | datanode2 | f | f | -119710263316386 | node2 | D | 15432 | datanode2 | f | f | -92791069016385 | node1 | D | 15433 | datanode2 | f | t | 1148549230(4 rows) 发现datanode1节点的ip和端口都已经替换为配置的slave了。 本篇文章为转载内容。原文链接:https://blog.csdn.net/qianglei6077/article/details/94379331。 该文由互联网用户投稿提供,文中观点代表作者本人意见,并不代表本站的立场。 作为信息平台,本站仅提供文章转载服务,并不拥有其所有权,也不对文章内容的真实性、准确性和合法性承担责任。 如发现本文存在侵权、违法、违规或事实不符的情况,请及时联系我们,我们将第一时间进行核实并删除相应内容。
2023-01-30 11:09:03
94
转载
转载文章
... //打印服务器监听端口 </script> </html> <!-- ★★★ 模式2 ★★★ --> <?php //如果有php运行环境,只需把该文件扩展名改成 .php,然后上传到web目录即可在真实服务器上测试 header("Access-Control-Allow-Origin: "); ?> <!DOCTYPE html> <head> <meta charset="utf-8" /> <title>康虎云报表系统测试</title> <style type="text/css"> output {font-size: 12px; background-color:F0FFF0;} </style> </head> <body> <div style="width: 100%;text-align:center;"> <h2>康虎云报表系统(Ver 1.3.0)</h2> <h3>打印测试(模式2)</h3> <div style="line-height: 1.5;"> <div style="width: 70%; text-align: left;"> <b>一、首先按下列步骤设置:</b><br/> 1、运行打印服务器;<br/> 2、按“停止”按钮停止服务;<br/> 3、打开“设置”区;<br/> 4、在“常用参数-->服务模式”中,选择“模式2”;<br/> 5、按“启动”按钮启动服务。 </div> <div style="width: 70%; text-align: left;"> <b>二、按本页的“打印”按钮开始打印。</b><br/> </div><br/> <input type="button" id="btnPrint" value="打印" /><br/><br/> <div style="width: 70%; text-align: left; font-size: 12px;"> 由于JavaScript在不同域名下访问会出现由来已久的跨域问题,所以正式部署到服务器使用时,要解决跨域问题。<br/> 对于IE8以上版本浏览器,只需增加一个reponse头:Access-Control-Allow-Origin即可,而对于php、jsp、asp/aspx等动态语言而言,增加一个response头是非常简单的事,例如:<br/> <b>在php:</b><br/><span style="color: red;"> <?php <br/> header("Access-Control-Allow-Origin: ");<br/> ?><br/> </span> <b>在jsp:</b><br/><span style="color: red;"> <% <br/> response.setHeader("Access-Control-Allow-Origin", ""); <br/> %><br/> </span> <b>在asp.net中:</b><br/><span style="color: red;"> Response.AppendHeader("Access-Control-Allow-Origin", ""); </span>,<br/>其他语言里,大家请自行搜索“ajax跨域”。而对于IE8以下的浏览器,大家可以自行搜索“IE6+Ajax+跨域”寻找解决办法吧,也可以联系我们帮助。 </div> </div> </div> <div id="output"></div> </body> <!-- 引入模式2所需的javascript支持库 --> <script type="text/javascript" src="cfprint_mode2.min.js" charset="UTF-8"></script> <!-- 构造报表数据 --> <script type="text/javascript"> var _reportData = '{"template":"waybill.fr3","ver":3, "Tables":[ {"Name":"Table1", "Cols":[{"type":"str","size":255,"name":"HAWB","required":false},{"type":"int","size":0,"name":"NO","required":false},{"type":"float","size":0,"name":"报关公司面单号","required":false},{"type":"integer","size":0,"name":"公司内部单号","required":false},{"type":"str","size":255,"name":"发件人","required":false},{"type":"str","size":255,"name":"发件人地址","required":false},{"type":"str","size":255,"name":"发件人电话","required":false},{"type":"str","size":255,"name":"发货国家","required":false},{"type":"str","size":255,"name":"收件人","required":false},{"type":"str","size":255,"name":"收件人地址","required":false},{"type":"str","size":255,"name":"收件人电话","required":false},{"type":"str","size":255,"name":"收货人证件号码","required":false},{"type":"str","size":255,"name":"收货省份","required":false},{"type":"float","size":0,"name":"总计费重量","required":false},{"type":"int","size":0,"name":"总件数","required":false},{"type":"float","size":0,"name":"申报总价(CNY)","required":false},{"type":"float","size":0,"name":"申报总价(JPY)","required":false},{"type":"int","size":0,"name":"件数1","required":false},{"type":"str","size":255,"name":"品名1","required":false},{"type":"float","size":0,"name":"单价1(JPY)","required":false},{"type":"str","size":255,"name":"单位1","required":false},{"type":"float","size":0,"name":"申报总价1(CNY)","required":false},{"type":"float","size":0,"name":"申报总价1(JPY)","required":false},{"type":"int","size":0,"name":"件数2","required":false},{"type":"str","size":255,"name":"品名2","required":false},{"type":"float","size":0,"name":"单价2(JPY)","required":false},{"type":"str","size":255,"name":"单位2","required":false},{"type":"float","size":0,"name":"申报总价2(CNY)","required":false},{"type":"float","size":0,"name":"申报总价2(JPY)","required":false},{"type":"int","size":0,"name":"件数3","required":false},{"type":"str","size":255,"name":"品名3","required":false},{"type":"float","size":0,"name":"单价3(JPY)","required":false},{"type":"str","size":255,"name":"单位3","required":false},{"type":"float","size":0,"name":"申报总价3(CNY)","required":false},{"type":"float","size":0,"name":"申报总价3(JPY)","required":false},{"type":"int","size":0,"name":"件数4","required":false},{"type":"str","size":255,"name":"品名4","required":false},{"type":"float","size":0,"name":"单价4(JPY)","required":false},{"type":"str","size":255,"name":"单位4","required":false},{"type":"float","size":0,"name":"申报总价4(CNY)","required":false},{"type":"float","size":0,"name":"申报总价4(JPY)","required":false},{"type":"int","size":0,"name":"件数5","required":false},{"type":"str","size":255,"name":"品名5","required":false},{"type":"float","size":0,"name":"单价5(JPY)","required":false},{"type":"str","size":255,"name":"单位5","required":false},{"type":"float","size":0,"name":"申报总价5(CNY)","required":false},{"type":"float","size":0,"name":"申报总价5(JPY)","required":false},{"type":"str","size":255,"name":"参考号","required":false},{"type":"AutoInc","size":0,"name":"ID","required":false}],"Data":[{"公司内部单号":730293,"发货国家":"日本","单价1(JPY)":null,"申报总价2(JPY)":null,"单价4(JPY)":null,"申报总价2(CNY)":null,"申报总价5(JPY)":null,"报关公司面单号":200303900791,"申报总价5(CNY)":null,"收货人证件号码":null,"申报总价1(JPY)":null,"单价3(JPY)":null,"申报总价1(CNY)":null,"申报总价4(JPY)":null,"申报总价4(CNY)":null,"收件人电话":"182-1758-9999","收件人地址":"上海市闵行区虹梅南路1660弄蔷薇八村139号502室","HAWB":"860014010055","发件人电话":"03-3684-9999","发件人地址":" 1-1-13,Kameido,Koto-ku,Tokyo","NO":3,"ID":3,"单价2(JPY)":null,"申报总价3(JPY)":null,"单价5(JPY)":null,"申报总价3(CNY)":null,"收货省份":null,"申报总价(JPY)":null,"申报总价(CNY)":null,"总计费重量":3.20,"收件人":"张三丰2","总件数":13,"品名5":null,"品名4":null,"品名3":null,"品名2":null,"品名1":"纸尿片","参考号":null,"发件人":"NAKAGAWA SUMIRE 2","单位5":null,"单位4":null,"单位3":null,"单位2":null,"单位1":null,"件数5":null,"件数4":null,"件数3":3,"件数2":null,"件数1":10},{"公司内部单号":730291,"发货国家":"日本","单价1(JPY)":null,"申报总价2(JPY)":null,"单价4(JPY)":null,"申报总价2(CNY)":null,"申报总价5(JPY)":null,"报关公司面单号":200303900789,"申报总价5(CNY)":null,"收货人证件号码":null,"申报总价1(JPY)":null,"单价3(JPY)":null,"申报总价1(CNY)":null,"申报总价4(JPY)":null,"申报总价4(CNY)":null,"收件人电话":"182-1758-9999","收件人地址":"上海市闵行区虹梅南路1660弄蔷薇八村139号502室","HAWB":"860014010035","发件人电话":"03-3684-9999","发件人地址":" 1-1-13,Kameido,Koto-ku,Tokyo","NO":1,"ID":1,"单价2(JPY)":null,"申报总价3(JPY)":null,"单价5(JPY)":null,"申报总价3(CNY)":null,"收货省份":null,"申报总价(JPY)":null,"申报总价(CNY)":null,"总计费重量":3.20,"收件人":"张三丰","总件数":13,"品名5":null,"品名4":null,"品名3":null,"品名2":null,"品名1":"纸尿片","参考号":null,"发件人":"NAKAGAWA SUMIRE","单位5":null,"单位4":null,"单位3":null,"单位2":null,"单位1":null,"件数5":null,"件数4":null,"件数3":3,"件数2":null,"件数1":10},{"公司内部单号":730292,"发货国家":"日本","单价1(JPY)":null,"申报总价2(JPY)":null,"单价4(JPY)":null,"申报总价2(CNY)":null,"申报总价5(JPY)":null,"报关公司面单号":200303900790,"申报总价5(CNY)":null,"收货人证件号码":null,"申报总价1(JPY)":null,"单价3(JPY)":null,"申报总价1(CNY)":null,"申报总价4(JPY)":null,"申报总价4(CNY)":null,"收件人电话":"182-1758-9999","收件人地址":"上海市闵行区虹梅南路1660弄蔷薇八村139号502室","HAWB":"860014010045","发件人电话":"03-3684-9999","发件人地址":" 1-1-13,Kameido,Koto-ku,Tokyo","NO":2,"ID":2,"单价2(JPY)":null,"申报总价3(JPY)":null,"单价5(JPY)":null,"申报总价3(CNY)":null,"收货省份":null,"申报总价(JPY)":null,"申报总价(CNY)":null,"总计费重量":3.20,"收件人":"张无忌","总件数":13,"品名5":null,"品名4":null,"品名3":null,"品名2":null,"品名1":"纸尿片","参考号":null,"发件人":"NAKAGAWA SUMIRE 1","单位5":null,"单位4":null,"单位3":null,"单位2":null,"单位1":null,"件数5":null,"件数4":null,"件数3":3,"件数2":null,"件数1":10}]}]}'; if(window.console) console.log("reportData = " + _reportData); </script> <!-- 设置服务器参数 --> <script language="javascript" type="text/javascript"> var cfprint_addr = "127.0.0.1"; //打印服务器监听地址 var cfprint_port = 54321; //打印服务器监听端口 var _url = "http://"+cfprint_addr+":"+cfprint_port; </script> <!-- 编写回调函数用以处理服务器返回的数据 --> <script type="text/javascript"> / 参数: readyState: XMLHttpRequest的状态 httpStatus: 服务端返回的http状态 responseText: 服务端返回的内容 / var callbackSuccess = function(readyState, httpStatus, responseText){ if (httpStatus === 200) { //{"result": 1, "message": "打印完成"} var response = CFPrint.parseJSON(responseText); alert(response.message+", 状态码["+response.result+"]"); }else{ alert('打印失败,HTTP状态代码是:'+httpStatus); } } / 参数: message: 错误信息 / var callbackFailed = function(message){ alert('发送打印任务出错: ' + message); } </script> <!-- 调用发送打印请求功能 --> <script type="text/javascript"> (function(){ document.getElementById("btnPrint").onclick = function() { CFPrint.outputid = "output"; //指定调试信息输出div的id CFPrint.SendRequest(_url, _reportData, callbackSuccess, callbackFailed); //发送打印请求 }; })(); </script> </html> 六、模板设计器(重要!重要!!,好多朋友都找不到设计器入口) 在主界面上,双击右下角的“设计”两个字,即可打开模板设计工具箱,在工具箱有三个按钮和一个大文本框。三个按钮的作用分别是: 设计:以大文本框中的json数据为数据源,打开模板设计器窗口; 预览:以大文本框中的json数据为数据源,预览当前所用模板的打印效果; 打印:以大文本框中的json数据为数据源,向打印机输出当前所用模板生成的报表; 以后将会有详细的模板设计教程发布,如果您遇到紧急的难题,请向作者咨询。 本篇文章为转载内容。原文链接:https://blog.csdn.net/chensongmol/article/details/76087600。 该文由互联网用户投稿提供,文中观点代表作者本人意见,并不代表本站的立场。 作为信息平台,本站仅提供文章转载服务,并不拥有其所有权,也不对文章内容的真实性、准确性和合法性承担责任。 如发现本文存在侵权、违法、违规或事实不符的情况,请及时联系我们,我们将第一时间进行核实并删除相应内容。
2023-04-01 18:34:12
234
转载
MySQL
在Windows操作OS下,可以通过以下流程来开启MySQL数据库: 1. 开启指令行终端,进入MySQL的bin文件夹 cd /d C:\Program Files\MySQL\MySQL Server 8.0\bin 2. 执行以下指令来开启MySQL服务端 mysqld --console 3. 等候MySQL服务端开启结束,可以看到类似以下显示信息 2022-01-03T02:11:00.880724Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.29) starting as process 908 4. 开启新的指令行终端,进入MySQL的bin文件夹 cd /d C:\Program Files\MySQL\MySQL Server 8.0\bin 5. 执行以下指令来连接到MySQL服务端 mysql -u root -p 6. 输入MySQL的root用户密码,进入MySQL指令行界面 Enter password: 7. 成功连接到MySQL服务端后,可以执行各种MySQL指令来管理数据库了 通过以上流程,就可以在Windows操作OS下成功地开启MySQL数据库,并进入MySQL指令行界面来管理数据库了。
2023-12-12 11:10:15
135
数据库专家
MySQL
...权的访问尝试,可利用防火墙规则限制特定IP或网络段对MySQL服务器的访问,并定期进行安全漏洞扫描及补丁更新,以抵御已知的安全风险。 总之,在实际运维过程中,对MySQL登录信息的精细化管理只是数据库安全链条中的一环。通过结合前沿技术手段与严格的管理制度,才能构建起坚实的数据安全保障体系,有效防范数据泄露等安全事件的发生。
2024-01-18 17:26:02
133
码农
Docker
...,包括网卡、路由表、防火墙规则等。在Docker中,每个容器默认会创建一个新的网络命名空间,使其拥有独立的网络配置。当使用--net=host参数启动容器时,该容器将与宿主机共享同一个网络命名空间,即使用宿主机的网络栈。 CNI(Container Network Interface) , CNI是Kubernetes等容器编排系统中用于管理容器网络的一种标准化接口规范。它定义了如何添加和删除容器的网络接口,以确保容器在网络中的连通性。CNI插件提供了多种网络模式选择,如overlay网络、macvlan等,能够支持复杂的网络需求,如跨节点通信、多租户隔离、服务发现等功能,从而增强容器间的通信能力以及容器对特定主机服务的访问能力。在文章的上下文中,虽然未直接提及CNI,但它是理解现代云原生环境下容器网络方案的重要组成部分。
2023-03-28 21:41:55
589
逻辑鬼才
MySQL
...见)或my.ini(Windows系统中常见)的配置文件,用于存储MySQL服务器的全局配置参数。用户可以在此文件中设置如数据库连接密码、端口号、数据存放路径等各种启动选项,当MySQL服务启动时,会读取这些配置信息以初始化和运行数据库服务。 命令行工具 , 命令行工具是一种通过文本界面与计算机系统交互的应用程序,用户通过输入特定指令来执行操作。在MySQL环境下,命令行工具即MySQL客户端,允许用户直接通过键盘输入SQL语句来查询、修改数据库中的数据,以及进行诸如查看和重置密码等管理操作,无需图形用户界面。例如,在文章中提到的“mysql -u root -p”命令就是利用MySQL命令行工具登录MySQL服务器的方式。
2024-02-18 15:42:33
121
码农
MySQL
...问和管控数据,其默认端口为3306。 MySQL部署 MySQL可在Windows、Linux和macOS等系统平台上部署。在Windows上,可以通过MySQL官方网站的下载专区来下载MySQL的Windows部署程序。在Linux上,可以运行终端命令部署MySQL。于Mac OS中,可以运行包管理器来部署MySQL。 MySQL 3306端口设置 默认情况下,MySQL运行3306端口来访问数据库。如果需要设置MySQL的端口,可以通过修改MySQL设置文件my.cnf来实现。在my.cnf文件中,可以指定MySQL的服务端口、主机地址等设置信息。修改完成后,需要重新启动MySQL服务来使设置生效。 常见MySQL错误 在运行MySQL时,常见的错误包括连接失败、权限拒绝、数据库不存在等。这些错误通常可以通过查看MySQL的错误日志或运行终端命令来进行查找和解决。同时,也可以通过在MySQL中执行SQL语句来检查和修复数据表的错误。 MySQL备份和恢复 定期备份MySQL数据库是防止数据损坏、丢失的重要手段。可以运行MySQL自带的终端命令来进行备份和恢复,诸如通过mysqldump命令备份数据库,运行mysql命令进行恢复操作。备份数据时需要注意相关参数的设置,避免备份数据过大或内存资源不足等问题。 结语 MySQL在各类应用程序中广泛运行,掌握MySQL的运行和维护方法对于程序员和网站管控员都是必备技能。在运行MySQL时,需要注意数据安全、备份恢复等关键问题,以保障数据的完整性和可靠性。
2023-02-05 14:43:17
74
程序媛
Docker
...行整体规划,比如通过防火墙规则精细控制容器内外的网络流量,或者采用安全增强型Linux(SELinux)等机制确保容器隔离性。 综上所述,面对Docker操作超时这一实际问题,不仅需要掌握基础的解决方案,更应紧跟行业动态和技术发展趋势,结合自身业务需求,实现容器化的高效稳定运行。而深入研究和应用上述相关领域的最新成果,将有助于提升企业的IT基础设施性能,保障业务连续性和稳定性。
2023-10-26 09:32:48
557
电脑达人
Hadoop
...全性和监控功能,例如防火墙规则、SSH密钥认证、Hadoop日志监控等。希望这篇文章能对你有所帮助!
2023-06-02 09:39:44
477
月影清风-t
DorisDB
...此外,我们还可以使用防火墙等工具来限制对DorisDB的访问。 总的来说,DorisDB提供了一套强大的用户权限管理系统,可以帮助我们有效地管理和保护数据安全。希望本文能对你有所帮助!
2024-01-22 13:14:46
454
春暖花开-t
PostgreSQL
...3. 数据库服务器的防火墙阻止了用户的连接请求。 4. 数据库服务器的配置文件中设定了访问限制。 三、解决方案 针对以上可能的原因,我们可以采取不同的解决措施。 1. 授权问题 我们可以使用GRANT命令来授予用户对特定对象的操作权限。例如,如果我们想要让用户"xx"能够创建新的表,我们可以运行如下命令: sql GRANT CREATE ON SCHEMA public TO xx; 这将允许用户"xx"在公共模式下的所有数据库中创建新表。 2. 用户状态问题 如果用户的账户已被禁用或过期,我们需要先激活或更新该用户的信息。如果是由于密码过期导致的问题,我们可以运行如下命令重置用户的密码: sql ALTER USER xx WITH PASSWORD 'new_password'; 3. 防火墙问题 如果是由于防火墙阻止了用户的连接请求,我们需要调整防火墙规则,允许来自用户IP地址的连接。实际上,具体的步骤会因你使用的防火墙软件的不同而有所差异,所以你得去找找相关的使用指南或者说明书瞧瞧。 4. 安全策略问题 如果我们已经赋予了用户足够的权限,但是仍然遇到了"permission denied"的错误,那么很可能是我们的安全策略设置有问题。在这种情况下,我们得翻翻数据库服务器的那个配置文件,看看是不是设了什么没必要的访问限制,可别让这小问题挡了咱们的道儿。 四、总结 "ERROR: permission denied to user xxx to perform the operation"是我们在使用PostgreSQL时经常会遇到的一个错误。这个问题常常冒出来,多半是因为用户账户的权限没整对,要么就是数据库的安全策略在那设定了访问限制,不让咱们随便进。通过明确错误的原因,我们可以采取相应的解决措施。在解决这个问题的时候,咱们千万不能想得太简单,以为随便给用户加点权限就万事大吉了。咱得把数据库的安全问题也时刻惦记着,这才是关键。只有在保证数据安全的前提下,才能更好地服务于我们的业务需求。
2024-01-14 13:17:13
206
昨夜星辰昨夜风-t
RabbitMQ
...查网络状况。有时候,防火墙规则或者网络延迟也可能导致SSL握手失败。确保客户端能够正常访问服务器,并且没有被中间设备拦截或篡改数据。 5. 总结与反思 通过以上几个步骤,我们应该能够解决大部分的“Connection error: SSL certificate verification failed”问题。当然了,每个项目的具体情况都不一样,可能还得根据实际情况来灵活调整呢。在这过程中,我可学了不少关于SSL/TLS的门道,还掌握了怎么高效地找问题和解决问题。 希望大家在遇到类似问题时,不要轻易放弃,多查阅资料,多尝试不同的解决方案。同时,也要学会利用工具和日志来辅助我们的排查工作。希望我的分享能对你有所帮助!
2025-01-02 15:54:12
159
雪落无痕
Docker
...Linux 机器或 Windows 上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口。文章中提到的 Docker 可以帮助用户在不改变现有环境的情况下运行 WGCLOUD 的 agent。 配置文件 , 配置文件是指用于定义软件系统运行时所需的各种参数和设置的文件。在 WGCLOUD 的 agent 中,配置文件包含服务器地址、认证信息等关键信息。这些信息指导 agent 如何连接到服务器以及验证身份。文章中提到的配置文件 config.yaml 包含了 agent 连接服务器所需的信息,需要正确配置并挂载到容器内。 日志 , 日志是指系统或程序在运行过程中产生的记录文件,通常用于记录系统事件、错误信息、运行状态等。通过查看日志,管理员可以了解程序运行的情况,帮助排查和解决问题。文章中提到可以通过 docker logs 命令查看容器的日志信息,以便确认 WGCLOUD 的 agent 是否正常工作。
2025-03-09 16:19:42
87
青春印记_
Beego
...配置,或者是服务器的防火墙阻止了HTTPS请求。在这种情况下,需要仔细检查配置文件和防火墙规则。 六、结论 总的来说,在使用Beego框架开发过程中,处理HTTPS协议下的证书问题是不可避免的一部分。咱们得先把HTTPS协议那个基础原理摸清楚,再来说说如何在Beego框架里头给它配好HTTPS。而且啊,那些常遇到的小插曲、小问题,咱们也得心里有数,手到擒来地解决才行。只有这样,我们才能在实际开发过程中,更加轻松地应对各种证书问题。
2023-09-01 11:29:54
502
青山绿水-t
NodeJS
...感部分。 6. 使用防火墙 防火墙可以帮助我们阻止来自特定IP地址的请求,从而防止DDoS攻击。 7. 日志记录和审计 我们需要记录所有的系统事件,以便在发生问题时能够追溯到问题的发生位置。同时,我们还需要定期进行系统审计,检查是否有任何异常行为。 四、总结 虽然Node.js为我们提供了很多便利,但是我们也不能忽视其中可能存在的安全问题。只有时刻瞪大眼睛,像老鹰护小鸡那样采取实实在在的防护行动,才能确保我们的系统稳稳妥妥、安安全全地跑起来,不会出任何岔子。
2024-01-07 18:08:03
97
彩虹之上-t
Consul
...然是必要的,比如通过防火墙规则限制访问。 五、总结 设置环回IP在Consul中是提高服务可用性和内部通信效率的重要步骤。搞懂环回IP的那点事儿,再加上Consul那些好玩的API和设置技巧,咱们就能轻松搞定微服务架构的那些琐碎事儿了。你知道吗,宝贝,每一个小细节都能决定系统是否顺溜运转,所以我们得像照顾宝宝一样细心对待每个步骤! 希望这篇文章能帮助你更好地理解和应用Consul的环回IP功能。如果你在实践中遇到任何问题,欢迎随时提问,我们一起探讨和学习。祝你在服务发现和配置的道路上越走越远!
2024-06-07 10:44:53
452
梦幻星空
站内搜索
用于搜索本网站内部文章,支持栏目切换。
知识学习
实践的时候请根据实际情况谨慎操作。
随机学习一条linux命令:
jobs
- 列出当前Shell会话中的后台作业及其状态。
推荐内容
推荐本栏目内的其它文章,看看还有哪些文章让你感兴趣。
2023-04-28
2023-08-09
2023-06-18
2023-04-14
2023-02-18
2023-04-17
2024-01-11
2023-10-03
2023-09-09
2023-06-13
2023-08-07
2023-03-11
历史内容
快速导航到对应月份的历史文章列表。
随便看看
拉到页底了吧,随便看看还有哪些文章你可能感兴趣。
时光飞逝
"流光容易把人抛,红了樱桃,绿了芭蕉。"