首页 文章 精选 留言 我的

精选列表

搜索[Java实现],共10000篇文章
优秀的个人博客,低调大师

使用python实现阿里云动态域名解析DDNS

前言 前置条件 1、域名是在阿里云购买的2、地址必须是公网地址,不然加了解析也没有用 简介 通过阿里云提供的SDK,然后自己编写程序新增或者修改域名的解析,达到动态解析域名的目的;主要应用于pppoe拨号的环境,比如家里设置了服务器,但是外网地址经常变化的场景;再比如公司的pppoe网关,需要建立vpn的场景。 安装阿里云SDK 需要安装两个SDK库,一个是阿里云核心SDK库,一个是阿里云域名SDK库;阿里云核心SDK库:pip install aliyun-python-sdk-core阿里云域名SDK库:pip install aliyun-python-sdk-domain阿里云SDK帮助 关于调试 阿里云提供一个在线调试,支持在线调试好之后,再复制回来本地即可。使用调试平台需要先登录。在线调试平台API的模块名称都可以通过帮助文档查询 设计思路 一、获取阿里云的accessKeyId和accessSecret二、获取外网ip三、判断外网ip是否与之前一致四、外网ip不一致时,新增或者更新域名解析记录 详细步骤 获取accessKeyId和accessSecret 可以在阿里云控制台个人中心直接获取,但是一般建议使用RAM角色来进行权限控制,这样这个accessKey和accessSecret就只能操作域名,不能操作其他的资源,相对会比较安全。关于RAM快速入门,请点击链接获取到accessKeyId和accessSecret之后,填入相对应的函数中即可: from aliyunsdkcore.client import AcsClient from aliyunsdkcore.acs_exception.exceptions import ClientException from aliyunsdkcore.acs_exception.exceptions import ServerException from hwx_function import * import os import time client = AcsClient('<accessKeyId>', '<accessSecret>', 'cn-hangzhou') 获取外网IP 通过网络上面的外网ip的API获取,可以使用多个,我这里只是列举了一个,具体代码如下: def get_internet_ip(): with urllib.request.urlopen('http://www.3322.org/dyndns/getip') as response: html = response.read() ip = str(html, encoding='utf-8').replace("\n", "") return ip 判断IP是否一致 因为阿里云不允许修改相同的解析,所以需要比对IP是否一致;因为把上一次解析的IP写入文件,所以只需要读取出来,跟本次得到的外网IP相比较,一致则不修改解析记录,不一致则修改解析记录。关于域名解析操作的代码,下面会有解释。 with open("./ip", 'r') as f: old_ip = f.read() if ip == old_ip: print("noupdate"+"\nnew_ip:"+ip+"\nold_ip:"+old_ip) else: #print("update"+"\nnew_ip:"+ip+"\nold_ip:"+old_ip) wirte_to_file("./ip",ip) des_relsult = Describe_SubDomain_Records(client,"A","sz.huangwx.cn") #判断子域名解析记录查询结果,TotalCount为0表示不存在这个子域名的解析记录,需要新增一个 if des_relsult["TotalCount"] == 0: add_relsult = add_record(client,"5","600","A",ip,"sz","huangwx.cn") record_id = add_relsult["RecordId"] print("域名解析新增成功!") #判断子域名解析记录查询结果,TotalCount为1表示存在这个子域名的解析记录,需要更新解析记录,更新记录需要用到RecordId,这个在查询函数中有返回des_relsult["DomainRecords"]["Record"][0]["RecordId"] elif des_relsult["TotalCount"] == 1: record_id = des_relsult["DomainRecords"]["Record"][0]["RecordId"] update_record(client,"5","600","A",ip,"sz",record_id) print("域名解析更新成功!") else: record_id = 0 print("存在两个子域名解析记录值,请核查删除后再操作!") path = './RecordId' wirte_to_file(path,record_id) 域名解析记录操作 域名解析记录不存在时,就新增解析记录,如果已经存在,则修改解析记录;所以这里还需要用到查询子域名解析记录的API; 子域名解析记录查询 Describe_SubDomain_Records(client,"A","sz.huangwx.cn")这个函数会返回一大堆东西,但是目前我们需要使用的就两个,一个是解析记录的数量,一个就是RecordId,RecordId修改域名解析时需要用到; #这个是函数 def Describe_SubDomain_Records(client,record_type,subdomain): request = DescribeSubDomainRecordsRequest() request.set_accept_format('json') request.set_Type(record_type) request.set_SubDomain(subdomain) response = client.do_action_with_exception(request) response = str(response, encoding='utf-8') relsult = json.loads(response) return relsult #以下是函数调用以及说明 des_relsult = Describe_SubDomain_Records(client,"A","sz.huangwx.cn") des_relsult["TotalCount"]:解析记录的数量,0表示解析记录不存在,1表示有一条解析记录 des_relsult["DomainRecords"]["Record"][0]["RecordId"]:当des_relsult["TotalCount"]为1时,会返回这个RecordId,后续的修改域名解析记录中需要用到 新增域名解析记录 如果域名解析记录不存在时,就需要新增域名解析记录,新增域名解析记录比较简单,直接填写参数即可 def add_record(client,priority,ttl,record_type,value,rr,domainname): request = AddDomainRecordRequest() request.set_accept_format('json') request.set_Priority(priority) request.set_TTL(ttl) request.set_Value(value) request.set_Type(record_type) request.set_RR(rr) request.set_DomainName(domainname) response = client.do_action_with_exception(request) response = str(response, encoding='utf-8') relsult = json.loads(response) return relsult #函数调用 add_relsult = add_record(client,"5","600","A",ip,"sz","huangwx.cn") record_id = add_relsult["RecordId"]#同样会返回一个RecordId,修改的时候也可以直接调用 更新域名解析记录 如果域名解析记录已存在,则不能使用新增,而是更新域名解析记录。更新的时候需要用到RecordId,这个一般查询的时候就会有返回,直接使用即可 def update_record(client,priority,ttl,record_type,value,rr,record_id): request = UpdateDomainRecordRequest() request.set_accept_format('json') request.set_Priority(priority) request.set_TTL(ttl) request.set_Value(value) request.set_Type(record_type) request.set_RR(rr) request.set_RecordId(record_id) response = client.do_action_with_exception(request) response = str(response, encoding='utf-8') return response #函数调用 record_id = des_relsult["DomainRecords"]["Record"][0]["RecordId"] update_record(client,"5","600","A",ip,"sz",record_id) 再加个循环或者定时任务即可定时更新域名解析记录了 总结 1、阿里云函数的使用依赖于阿里云的SDK库,所以这个一定要安装好2、新增解析记录的时候,可以把RecordId存储在本地文件,下次直接判断文件是否存在即可,不用每次都调用查询API

优秀的个人博客,低调大师

Antlr4实现数学四则运算

基本参考https://pragprog.com/book/tpantlr2/the-definitive-antlr-4-reference 一书"Building a Calculator Using a Visitor"一节, 仅添加了数学乘除法符号的支持(×÷). 比如下面的算式: 3×2+8÷4-2×4 源码仍在program-in-chinese/quan5 相比上一版本语法文件去除了空格定义. 需要深究的是优先级问题. 是否因为"表达式 运算符=('*'|'/'|'×'|'÷') 表达式"写在了前面才使得乘除法的优先级在语法分析时更高. 至此, 感觉Antlr语法文件对中文命名的支持还是不错的. 唯一需要权宜之计的就是Token(词)规则必须要大写开头, 因此采用了前缀"T"): grammar 圈5; 程序 : 表达式 ; 表达式 : 表达式 运算符=('*'|'/'|'×'|'÷') 表达式 #乘除 | 表达式 运算符=('+'|'-') 表达式 #加減 | T数 #数 ; T数 : [0-9]+ ; T加 : '+'; T減 : '-'; T乘 : '*'; T数乘: '×'; T除 : '/'; T数除: '÷'; 第一次尝试#标号的辅助功能. 一个"表达式"语法规则生成了三个Visitor方法(如下), 访问器仍比较简单. 注: 语法规则中要么所有分支都有标号, 要么都没有. 不然生成分析器时报错: public class 定制访问器 extends 圈5BaseVisitor<节点> { @Override public 节点 visit数(数Context 上下文) { TerminalNode 数 = 上下文.T数(); return 数 instanceof ErrorNode ? null : new 数节点(数.getText()); } @Override public 节点 visit加減(加減Context 上下文) { 表达式节点 节点 = new 表达式节点(); 节点.运算符 = 上下文.运算符.getType() == 圈5Parser.T加 ? 运算符号.加 : 运算符号.減; 节点.左子节点 = visit(上下文.表达式(0)); 节点.右子节点 = visit(上下文.表达式(1)); return 节点; } @Override public 节点 visit乘除(乘除Context 上下文) { 表达式节点 节点 = new 表达式节点(); int 运算符 = 上下文.运算符.getType(); 节点.运算符 = (运算符 == 圈5Parser.T乘 || 运算符 == 圈5Parser.T数乘) ? 运算符号.乘 : 运算符号.除; 节点.左子节点 = visit(上下文.表达式(0)); 节点.右子节点 = visit(上下文.表达式(1)); return 节点; } } 语法树中稍微复杂一点的"表达式"节点, 代码很冗余: public class 表达式节点 extends 节点 { public 运算符号 运算符; @Override public Object 求值() { if (运算符.equals(运算符号.加)) { return (int)(左子节点.求值()) + ((int)右子节点.求值()); } else if (运算符.equals(运算符号.減)) { return (int)(左子节点.求值()) - ((int)右子节点.求值()); } else if (运算符.equals(运算符号.乘)) { return (int)(左子节点.求值()) * ((int)右子节点.求值()); } else if (运算符.equals(运算符号.除)) { return (int)(左子节点.求值()) / ((int)右子节点.求值()); } else { return null; } } } 已经要手动跑十个测试文件, 下面除了清理代码, 还需要加测试, 再加功能(应该是变量赋值). 2018-01-11

优秀的个人博客,低调大师

利用cobbler 实现系统自动化安装及web管理

1 安装包和配置服务 root:~# yum install cobbler dhcp -y root:~# systemctl enable tftp dhcpd httpd cobblerd root:~# systemctl start tftp httpd cobblerd 2 修改cobbler 配置文件 vim /etc/cobbler/settings server: cobblerIP 384 next_server: cobblerIP 272 default_password_crypted: "$1$VBqc7U0W$F2qhI5oZwR8chJBU.mAly1" 101 manage_dhcp: 1 242 #可自动配置dhcp root:~# cobbler get-loaders task started: 2019-04-19_074328_get_loaders task started (id=Download Bootloader Content, time=Fri Apr 19 07:43:28 2019) downloading https://cobbler.github.io/loaders/README to /var/lib/cobbler/loaders/README downloading https://cobbler.github.io/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo downloading https://cobbler.github.io/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot downloading https://cobbler.github.io/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux downloading https://cobbler.github.io/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi downloading https://cobbler.github.io/loaders/yaboot-1.3.17 to /var/lib/cobbler/loaders/yaboot downloading https://cobbler.github.io/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0 downloading https://cobbler.github.io/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32 downloading https://cobbler.github.io/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi downloading https://cobbler.github.io/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi *** TASK COMPLETE *** root:~# cobbler sync task started: 2019-04-19_074450_sync ********* !!! TASK FAILED !!! 3 配置dhcp服务 root:~# vim /etc/cobbler/dhcp.template subnet 192.168.64.0 netmask 255.255.255.0 { option routers 192.168.64.254; option domain-name-servers 1.1.1.1; option subnet-mask 255.255.255.0; range dynamic-bootp 192.168.64.100 192.168.64.254 root:~# cobbler sync task started: 2019-04-19_075613_sync task started (id=Sync, time=Fri Apr 19 07:56:13 2019) running pre-sync triggers .................................. running shell triggers from /var/lib/cobbler/triggers/change/* *** TASK COMPLETE *** 4导入安装源文件 将光盘挂载好 root:~# dfFilesystem 1K-blocks Used Available Use% Mounted on/dev/mapper/centos-root 52403200 2066756 50336444 4% /devtmpfs 919432 0 919432 0% /devtmpfs 931612 0 931612 0% /dev/shmtmpfs 931612 9744 921868 2% /runtmpfs 931612 0 931612 0% /sys/fs/cgroup/dev/sda1 1038336 149004 889332 15% /boot/dev/mapper/centos-home 154057220 33100 154024120 1% /hometmpfs 186324 0 186324 0% /run/user/0/dev/sr0 10491772 10491772 0 100% /mnt/7/dev/sr1 3897932 3897932 0 100% /mnt/6 root:~# cobbler import --path=/mnt/6 --name=Centos-6.10 --arch=x86_64 task started: 2019-04-19_080352_import task started (id=Media import, time=Fri Apr 19 08:03:52 2019) Found a candidate signature: breed=redhat, version=rhel6 Found a matching signature: breed=redhat, version=rhel6 Adding distros from path /var/www/cobbler/ks_mirror/Centos-6.10-x86_64: creating new distro: Centos-6.10-x86_64 trying symlink: /var/www/cobbler/ks_mirror/Centos-6.10-x86_64 -> /var/www/cobbler/links/Centos-6.10-x86_64 creating new profile: Centos-6.10-x86_64 associating repos checking for rsync repo(s) checking for rhn repo(s) checking for yum repo(s) starting descent into /var/www/cobbler/ks_mirror/Centos-6.10-x86_64 for Centos-6.10-x86_64 processing repo at : /var/www/cobbler/ks_mirror/Centos-6.10-x86_64 need to process repo/comps: /var/www/cobbler/ks_mirror/Centos-6.10-x86_64 looking for /var/www/cobbler/ks_mirror/Centos-6.10-x86_64/repodata/*comps*.xml Keeping repodata as-is :/var/www/cobbler/ks_mirror/Centos-6.10-x86_64/repodata *** TASK COMPLETE *** 查看现有安装选项 root:~# cobbler profile list Centos-6.10-x86_64 [root@localhost ~]# cobbler distro list #安装原文件名称 [root@localhost ~]# cat /var/lib/tftpboot/pxelinux.cfg/default DEFAULT menu PROMPT 0 MENU TITLE Cobbler | http://cobbler.github.io/ TIMEOUT 200 TOTALTIMEOUT 6000 ONTIMEOUT local LABEL local MENU LABEL (local) MENU DEFAULT LOCALBOOT -1 LABEL Centos-6.10-x86_64 kernel /images/Centos-6.10-x86_64/vmlinuz MENU LABEL Centos-6.10-x86_64 append initrd=/images/Centos-6.10-x86_64/initrd.img ksdevice=bootif lang= kssendmac text ks=http://192.168.64.131/cblr/svc/op/ks/profile/Centos-6.10-x86_64 ipappend 2 MENU end cobbler profile remove --name=NAME cobbler distro remove --name=NAME 现在已经可以自动化安装了,不过cobbler默认配置文件为最小化安装,想要自定义的花要修改配置文件 Centos 7.0下使用system-config-kickstart 修改CentOS-Base.repo [base] 修改 ---------->[development] name=CentOS-$releasever - Base root:~# yum install -y system-config-kickstart.noarch root:~ # env LANG=zh_CN.UTF-8 system-config-kickstart #生成自定义配置文件 将ks文件和系统关联,生成启动菜单 cobbler profile add --name=Centos6_mini --distro=Centos-6.10-x86_64 --kickstart=/var/lib/cobbler/kickstarts/ks6mini.cfg 将所有选项选完即可左上角保存 centos6ks文件 #platform=x86, AMD64, or Intel EM64T #version=DEVEL # Firewall configuration firewall --disabled # Install OS instead of upgrade install # Use CDROM installation media url --url=$tree # Root password rootpw --iscrypted $1$RR1QsW0t$qYYwsKO5LloO6y3WaTkdj0 # System authorization information auth --useshadow --passalgo=sha512 # Use text mode install text # System keyboard keyboard us # System language lang en_US # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # Installation logging level logging --level=info # Reboot after installation reboot # System timezone timezone Asia/Shanghai # Network information network --bootproto=dhcp --device=eth0 --onboot=on # System bootloader configuration bootloader --location=mbr --md5pass="$1$EmYezDTP$mBxhDFd/BRDIn6ZBAOtL00" # Clear the Master Boot Record zerombr # Partition clearing information clearpart --all --initlabel # Disk partitioning information part /boot --fstype="ext4" --size=1024 part / --fstype="ext4" --grow --size=1 %post mkdir /root/.ssh chmod 700 /root/.ssh cat > /root/.ssh/authorized_keys <<EOF ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtSEz3OSOAI6UMkRjIVk3cXwVf/tYa9YsBOVd4vamGtrAuPN5+zgOj9T9p+QI0nJHva6LR4Wz5es46zXoSrLoKY4rTpqnmuPNYuG3B/cybOv99+hriq7Vs9/OqMIgsLbtk4R99Rg75wL9jXpcyxgKtCyVYG4sjdlfyQXQXuauzai6u9oqKo7MmDyWiC9QJSqfilrQKhUB+OfVo4/vkYxKLsRy8N6k2BoRTk2VIp7XKB4gr3sutgutXk35A3O08ukGBSA+378G2csDmf9nctGv4kSw/gR6Mdy2LnhcxcnPA5IP39Buvkdp2eqXOnY1zWxTiUdLtfAb81rFpwMudtaK1w== rsa 2048-041619 EOF chmod 600 /root/.ssh/authorized_keys systemctl stop firewalld systemctl disable firewalld.service systemctl stop NetworkManager systemctl disable NetworkManager %end %packages @base @debugging @network-tools %end centos7ks文件 #platform=x86, AMD64, or Intel EM64T #version=DEVEL # Install OS instead of upgrade install # Keyboard layouts keyboard 'us' # Root password rootpw --iscrypted $1$F4q00dyi$IQ1/CLubGYHtDw6EvSiln0 # System language lang en_US # System authorization information auth --useshadow --passalgo=sha512 # Use CDROM installation media url --url=$tree # Use graphical install text # SELinux configuration selinux --disabled # Do not configure the X Window System skipx # Firewall configuration firewall --disabled # Network information network --bootproto=dhcp --device=ens33 # Halt after installation halt # System timezone timezone Asia/Shanghai # System bootloader configuration bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=sda # Partition clearing information clearpart --all --initlabel reboot # Disk partitioning information part /boot --fstype="xfs" --size=1024 part / --fstype="xfs" --grow --size=1 %post mkdir /root/.ssh chmod 700 /root/.ssh cat > /root/.ssh/authorized_keys <<EOF ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtSEz3OSOAI6UMkRjIVk3cXwVf/tYa9YsBOVd4vamGtrAuPN5+zgOj9T9p+QI0nJHva6LR4Wz5es46zXoSrLoKY4rTpqnmuPNYuG3B/cybOv99+hriq7Vs9/OqMIgsLbtk4R99Rg75wL9jXpcyxgKtCyVYG4sjdlfyQXQXuauzai6u9oqKo7MmDyWiC9QJSqfilrQKhUB+OfVo4/vkYxKLsRy8N6k2BoRTk2VIp7XKB4gr3sutgutXk35A3O08ukGBSA+378G2csDmf9nctGv4kSw/gR6Mdy2LnhcxcnPA5IP39Buvkdp2eqXOnY1zWxTiUdLtfAb81rFpwMudtaK1w== rsa 2048-041619 EOF chmod 600 /root/.ssh/authorized_keys systemctl stop firewalld systemctl disable firewalld.service systemctl stop NetworkManager systemctl disable NetworkManager sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config mkdir /etc/yum.repo.d/bak mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/bak/ cat > /etc/yum.repos.d/Centos-Base.repo <<EOF [development] name=CentOS-$releasever - Base - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #released updates [updates] name=CentOS-$releasever - Updates - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that may be useful [extras] name=CentOS-$releasever - Extras - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 #contrib - packages by Centos Users [contrib] name=CentOS-$releasever - Contrib - mirrors.aliyun.com failovermethod=priority baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/ http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/ http://mirrors.cloud.aliyuncs.com/centos/$releasever/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 EOF cat > /etc/yum.repos.d/epel.repo << EOF [epel] name=Extra Packages for Enterprise Linux 7 - $basearch baseurl=http://mirrors.aliyun.com/epel/7/$basearch failovermethod=priority enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 [epel-debuginfo] name=Extra Packages for Enterprise Linux 7 - $basearch - Debug baseurl=http://mirrors.aliyun.com/epel/7/$basearch/debug failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=0 [epel-source] name=Extra Packages for Enterprise Linux 7 - $basearch - Source baseurl=http://mirrors.aliyun.com/epel/7/SRPMS failovermethod=priority enabled=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 gpgcheck=0 EOF %end %packages @base @network-tools %end web管理 阿里云太新会出错,用搜狐 vi /etc/yum.repos.d/epel.repo [epel] name=Extra Packages for Enterprise Linux 7 - $basearch baseurl=http://mirrors.sohu.com/fedora-epel/7/x86_64/ enabled=1 gpgcheck=0 [root@localhost ~]# yum clean all [root@localhost network-scripts]# yum install cobbler-web [root@localhost network-scripts]# service httpd restart [root@localhost network-scripts]# htdigest /etc/cobbler/users.digest Cobbler cobbleradmin(添加新管理用户)

优秀的个人博客,低调大师

基于Spark SQL实现对HDFS操作的实时监控报警

1.前言 E-MapReduce计划从EMR-3.18.1版本开始提供Spark Streaming SQL的预览版功能。Spark Streaming SQL是在Spark Structured Streaming的基础上做了进一步封装,方便用户使用SQL语言进行Spark流式分析开发。Spark Streaming SQL直接地透明地受惠于Spark SQL的优化带来的性能提升,同时也遵循Spark Structured Streaming的语法约束,例如Spark Structured Streaming不支持多流聚合查询,Spark Streaming SQL也就同样不支持。关于EMR Spark Streaming SQL的使用入门,请参考: EMR Spark Streaming SQL语法参考 Spark Streamin

优秀的个人博客,低调大师

Spring Cloud Alibaba基础教程:使用Sentinel实现接口限流

Nacos作为注册中心和配置中心的基础教程,到这里先告一段落,后续与其他结合的内容等讲到的时候再一起拿出来说,不然内容会有点跳跃。接下来我们就来一起学习一下Spring Cloud Alibaba下的另外一个重要组件:Sentinel。 Sentinel是什么 Sentinel的官方标题是:分布式系统的流量防卫兵。从名字上来看,很容易就能猜到它是用来作服务稳定性保障的。对于服务稳定性保障组件,如果熟悉Spring Cloud的用户,第一反应应该就是Hystrix。但是比较可惜的是Netflix已经宣布对Hystrix停止更新。那么,在未来我们还有什么更好的选择呢?除了Spring Cloud官方推荐的resilience4j之外,目前Spring Cloud Alibaba下整合的Sentinel也是用户可以重点考察和选型的目标。 Se

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

用户登录
用户注册
修改密码
忘记密码