API网关APISIX实战部署测试
部署机器列表10。5。1。3310。5。1。9310。5。1。109安装ETCD下载ETCDVERSION3。5。4wgethttps:hub。0z。gsetcdioetcdreleasesdownloadv{ETCDVERSION}etcdv{ETCDVERSION}linuxamd64。tar。gztarxvfetcdv{ETCDVERSION}linuxamd64。tar。gzcdetcdv3。5。4linuxamd64配置
创建启动脚本etcdstart。sh(10。5。1。33)TOKENtoken01CLUSTERSTATEnewNAME1machine1NAME2machine2NAME3machine3HOST110。5。1。33HOST210。5。1。93HOST310。5。1。109CLUSTER{NAME1}http:{HOST1}:2380,{NAME2}http:{HOST2}:2380,{NAME3}http:{HOST3}:2380THISNAME{NAME1}THISIP{HOST1}dataserveretcdv3。5。4linuxamd64etcddatadirdata。etcdname{THISNAME}initialadvertisepeerurlshttp:gt;{THISIP}:2380listenpeerurlshttp:gt;{THISIP}:2380advertiseclienturlshttp:gt;{THISIP}:2379listenclienturlshttp:gt;{THISIP}:2379initialcluster{CLUSTER}initialclusterstate{CLUSTERSTATE}initialclustertoken{TOKEN}
创建启动脚本etcdstart。sh(10。5。1。93)TOKENtoken01CLUSTERSTATEnewNAME1machine1NAME2machine2NAME3machine3HOST110。5。1。33HOST210。5。1。93HOST310。5。1。109CLUSTER{NAME1}http:{HOST1}:2380,{NAME2}http:{HOST2}:2380,{NAME3}http:{HOST3}:2380THISNAME{NAME2}THISIP{HOST2}dataserveretcdv3。5。4linuxamd64etcddatadirdata。etcdname{THISNAME}initialadvertisepeerurlshttp:gt;{THISIP}:2380listenpeerurlshttp:gt;{THISIP}:2380advertiseclienturlshttp:gt;{THISIP}:2379listenclienturlshttp:gt;{THISIP}:2379initialcluster{CLUSTER}initialclusterstate{CLUSTERSTATE}initialclustertoken{TOKEN}
创建启动脚本etcdstart。sh(10。5。1。109)TOKENtoken01CLUSTERSTATEnewNAME1machine1NAME2machine2NAME3machine3HOST110。5。1。33HOST210。5。1。93HOST310。5。1。109CLUSTER{NAME1}http:{HOST1}:2380,{NAME2}http:{HOST2}:2380,{NAME3}http:{HOST3}:2380THISNAME{NAME3}THISIP{HOST3}dataserveretcdv3。5。4linuxamd64etcddatadirdata。etcdname{THISNAME}initialadvertisepeerurlshttp:gt;{THISIP}:2380listenpeerurlshttp:gt;{THISIP}:2380advertiseclienturlshttp:gt;{THISIP}:2379listenclienturlshttp:gt;{THISIP}:2379initialcluster{CLUSTER}initialclusterstate{CLUSTERSTATE}initialclustertoken{TOKEN}启动nohupshetcdstatic。sh测试。etcdctlendpoints10。5。1。33:2379memberlist61c3bf180d89e1a6,started,machine2,http:10。5。1。93:2380,http:10。5。1。93:2379,false789ba48e8fea5046,started,machine1,http:10。5。1。33:2380,http:10。5。1。33:2379,falseef6722f71326bf23,started,machine3,http:10。5。1。109:2380,http:10。5。1。109:2379,false安装APISIXYum安装sudoyuminstallyhttps:repos。apiseven。compackagescentosapacheapisixrepo1。01。noarch。rpmsudoyumconfigmanageraddrepohttps:repos。apiseven。compackagescentosapacheapisix。reposudoyuminstallapisix创建配置viusrlocalapisixconfconfig。yamlapisix:nodelisten:80etcd:host:http:10。5。1。33:2379http:10。5。1。93:2379http:10。5。1。109:2379初始化apisixinit启动apisixstart测试curlhttp:localhost:80
安装APISIX控制台下载安装
这里使用github的加速网址:hub。0z。gs。sudoyuminstallyhttps:hub。0z。gsapacheapisixdashboardreleasesdownloadv2。13apisixdashboard2。130。el7。x8664。rpmsudomanagerapipusrlocalapisixdashboard配置
主要配置暴露端口、访问白名单、etcdyamllintdisablerule:commentsindentationconf:listen:host:10。5。1。33theaddressonwhichtheManagerAPIshouldlisten。port:9000TheportonwhichtheManagerAPIshouldlisten。ssl:host:127。0。0。1theaddressonwhichtheManagerAPIshouldlistenforHTTPS。Thedefaultvalueis0。0。0。0,ifwanttospecify,pleaseenableit。port:9001TheportonwhichtheManagerAPIshouldlistenforHTTPS。cert:tmpcertexample。crtPathofyourSSLcert。key:tmpcertexample。keyPathofyourSSLkey。allowlist:IfwedontsetanyIPlist,thenanyIPaccessisallowedbydefault。0。0。0。00Therulesarecheckedinsequenceuntilthefirstmatchisfound。::1Inthisexample,accessisallowedonlyforIPv4network127。0。0。1,andforIPv6network::1。ItalsosupportCIDRlike192。168。1。024and2001:0db8::32etcd:endpoints:supportsdefiningmultipleetcdhostaddressesforanetcdcluster10。5。1。33:237910。5。1。93:237910。5。1。109:2379yamllintdisablerule:commentsindentationetcdbasicauthinfousername:rootignoreetcdusernameifnotenableetcdauthpassword:123456ignoreetcdpasswordifnotenableetcdauthmtls:keyfile:Pathofyourselfsignedclientsidekeycertfile:Pathofyourselfsignedclientsidecertcafile:Pathofyourselfsignedcacert,theCAisusedtosigncallerscertificatesprefix:apisixapisixconfigsprefixinetcd,apisixbydefaultlog:errorlog:level:warnsupportslevels,lowertohigher:debug,info,warn,error,panic,fatalfilepath:logserror。logsupportsrelativepath,absolutepath,standardoutputsuchas:logserror。log,tmplogserror。log,devstdout,devstderrsuchasabsolutepathonWindows:winfile:C:error。logaccesslog:filepath:logsaccess。logsupportsrelativepath,absolutepath,standardoutputsuchas:logsaccess。log,tmplogsaccess。log,devstdout,devstderrsuchasabsolutepathonWindows:winfile:C:access。loglogexample:20201209T16:38:09。0390800INFOfilterlogging。go:46apisixadminroutesr1{status:401,host:127。0。0。1:9000,query:asdfsafdadfaa,requestId:3d50ecb8758c46d1af5bcd9d1c820156,latency:0,remoteIP:127。0。0。1,method:PUT,errs:〔〕}maxcpu:0supportstweakingwiththenumberofOSthreadsaregoingtobeusedforparallelism。Defaultvalue:0〔willusemaxnumberofavailablecpucoresconsideringhyperthreading(ifany)〕。Ifthevalueisnegative,iswillnottouchtheexistingparallelismprofile。security:accesscontrolalloworigin:http:httpbin。orgaccesscontrolallowcredentials:truesupportusingcustomcorsconfigrationaccesscontrolallowheaders:Authorizationaccesscontrolallowmethods:xframeoptions:denycontentsecuritypolicy:defaultsrcself;scriptsrcselfunsafeeval;stylesrcselfunsafeinlineauthentication:secret:secretsecretforjwttokengeneration。NOTE:Highlyrecommendedtomodifythisvaluetoprotectmanagerapi。ifitsdefaultvalue,whenmanagerapistart,itwillgeneratearandomstringtoreplaceit。expiretime:3600jwttokenexpiretime,insecondusers:yamllintenablerule:commentsindentationusername:adminusernameandpasswordforloginmanagerapipassword:123123username:userpassword:123123plugins:pluginlist(sortedinalphabeticalorder)apibreakerauthzkeycloakbasicauthbatchrequestsconsumerrestrictioncorsdubboproxyechoerrorlogloggerexamplepluginfaultinjectiongrpctranscodehmacauthhttploggeriprestrictionjwtauthkafkaloggerkeyauthlimitconnlimitcountlimitreqlogrotatenodestatusopenidconnectprometheusproxycacheproxymirrorproxyrewriteredirectrefererrestrictionrequestidrequestvalidationresponserewriteserverlesspostfunctionserverlessprefunctionskywalkingslsloggersyslogtcploggerudploggeruriblockerwolfrbaczipkinserverinfotrafficsplit启动nohupsudomanagerapicusrlocalapisixdashboardconfconf。yaml测试
运维启动服务apisixstart停止服务apisixstop热加载配置apisixreload暴露多个端口修改配置,同时暴露80和8080两个端口apisix:nodelisten:808080热加载配置apisixreload问题排查业务访问错误排查日志路径userlocalapisixlogsaccess。loguserlocalapisixlogserror。log
云原生网关微服务
抹茶到底是啥东西做的,看完又涨知识了问到抹茶是啥,估计很多人都吃过,却说不出个所以然来。市面上有很多抹茶味的美食,比如抹茶蛋糕、抹茶冰淇淋等,淡淡的绿色给人一种清爽的感觉。很多人都爱抹茶的味道。抹茶粉是以遮……
5年2。152亿!拉文创造历史!湖人错失引援良机,威少合同真自从经历了上一波工资帽的大涨之后,联盟各支球队都舍得为球星奉上超级合同,天价续约已经是屡见不鲜的事情,而球星才是球队票房收入的保证。明白了这一点之后,我们就看到这个休赛期的天价……
世行贷款项目!北京建工新中标近日,北京建工国际工程公司坦桑尼亚分公司中标达累斯萨拉姆市姆贝齐海滩污水管网和泵站项目(以下简称达市污水管网项目),主要内容包括新建超过100公里的污水管网以及两个污水泵站,2……
除了国内市场都卖爆了!三星S23销量是S22的两倍,超大杯最2月初,三星正式推出了新一代旗舰S23系列。该系列包括S23、S23、S23Ultra三部机型,国行版的起售价分别是5199元、6999元和8999元。虽然S23系列在国内的销……
王者夏侯惇皮肤对比,你喜欢哪一个?中接上一篇接着讲夏侯惇的皮肤第三款逆光决锋者kpl限定皮肤这款皮肤将夏侯惇设计成硬汉大叔整体服饰采用了硬朗的无袖夹克与更据接头感的工装库打开为……
给孩子取乳名要慎重以下乳名不好听还伤娃的自尊,要避免如今孩子的乳名千奇百怪。给孩子取名字的时候,家长思虑的东西会很多,名字是不是符合孩子的命数,名字是否能让孩子让人高看一眼,名字是否可以彰显自己的学识等等。而到了取乳……
比特币,以太坊反弹隔夜清算超过10亿美元的交易随着加密市场在过去24小时内反弹,著名的Uptober模因实现其承诺的机会突然再次活跃起来,比特币(BTC)和以太坊(ETH),业界最大的两种数字资产引领了复苏。根据比特……
什么是金属配位自组装?金属配位自组装(MetalCoordinationSelfAssembly,MCSA)是一种基于金属离子与有机配体之间的协同作用,在无溶剂或溶液中自发形成具有特定结构和功能的超……
普洱茶一定要存放才能喝,这是真的吗?原创问答:真茶君普文《1》每一次问答,我都需要较为谨慎的态度来对待,很多提问有建设性,关于这个普洱茶一定要存放才能喝?这是真的吗?其实很无奈,是否茶商们如此宣传也不……
小时候爱吃吃不起,现在吃得起却不敢吃的食物是什么?我儿时住在乡下,父母外出打工,我的记忆里方便面一定全是儿时高端的奢侈品。城里的娃肯定理解不了。那时候黑白的电视机里放着香港的一些影视剧。里面总传递着一种理念:主人公们因为……
四川泸沽湖景区将于9月25日正式开放来源:四川省泸沽湖景区四川泸沽湖开放公告根据盐源县新冠肺炎疫情应急指挥部要求,四川泸沽湖景区从2022年9月25日0时起有序恢复对外开放。按照预约、错峰、限流……
色美肉香味纯的卤水配方一览,总有一款适合你卤水方子一】卤味菜是热制冷吃的菜肴,以色美肉香味醇而见长,兼具用料广泛,品种多,制作简便,易于存放等特点。它是用‘卤水’来烹饪的,无论是红卤水,还是白卤水,它们的调制都离……