首页 文章 精选 留言 我的

精选列表

搜索[开源协作平台],共10000篇文章
优秀的个人博客,低调大师

基于开源MQTT自主接入阿里云IoT平台(Python)

本文由 GXIC 作者 wongxmig 完成,欢迎关注 IoT 开发者社区。 1. 准备工作 1.1 注册阿里云账号 使用个人淘宝账号或手机号,开通阿里云账号,并通过__实名认证(可以用支付宝认证)__ 1.2 免费开通IoT物联网套件 产品官网 https://www.aliyun.com/product/iot 1.3 软件环境 __python2__安装:https://www.python.org/downloads/编辑器 sublimeText/nodepad++/vscode 2. 开发步骤 2.1 云端开发 1) 创建高级版产品 2) 功能定义,产品物模型添加属性 添加产品属性定义 属性名 标识符 数据类型 范围 温度 temperature float -50~100 湿度 humidity float 0~100 物模型对应属性上报topic /sys/替换为

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

基于开源MQTT自主接入阿里云IoT平台(Java)

本文由 GXIC 作者 wongxmig 完成,欢迎关注 IoT 开发者社区。 1. 准备工作 1.1 注册阿里云账号 使用个人淘宝账号或手机号,开通阿里云账号,并通过__实名认证(可以用支付宝认证)__ 1.2 免费开通IoT物联网套件 产品官网 https://www.aliyun.com/product/iot 1.3 软件环境 JDK安装 编辑器 IDEA 2. 开发步骤 2.1 云端开发 1) 创建高级版产品 2) 功能定义,产品物模型添加属性 添加产品属性定义 属性名 标识符 数据类型 范围 温度 temperature float -50~100 湿度 humidity float 0~100 物模型对应属性上报topic /sys/替换为productKey/替换为deviceName/thing/event/property/post 物模型对应的属性上报paylo

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

ELK(elasticsearch+logstash+kibana)开源日志分析平台搭建

环境介绍 System: CentOS7.2 x86_64 hostname:elk-server.huangming.org IP Address: 10.0.6.42、10.17.83.42 本篇的ELK环境为单机部署方式,即将ELK所有的软件包都安装在一台服务器上,配置如下: CPU: 4c Mem: 8G Disk: 50 一、Elasticsearch安装 1、安装jdk 1.8及以上的版本(安装过程略) 1 2 3 4 [root@elk-serverelk] #java-version javaversion "1.8.0_65" Java(TM)SERuntimeEnvironment(build1.8.0_65-b17) JavaHotSpot(TM)64-BitServerVM(build25.65-b01,mixedmode) 2、下载Elasticsearch最新版本(目前5.5版本) 1 2 3 4 使用curl命令下载 tar 包 #curl-L-Ohttps://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.2.tar.gz 也可以使用wget命令下载 #wgethttps://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.2.tar.gz 3、解压至指定目录(安装目录)/usr/local/下,并将其重命名为elasticsearch (完整的目录应该为/usr/local/elasticsearch) 1 2 3 #tar-zxfelasticsearch-5.5.2.tar.gz-C/usr/local/ #cd/usr/local/ #mvelasticsearch-5.5.2elasticsearch 2、创建一个用于运行elasticsearch的普通用户,随后修改elasticsearch家目录的所属权限为该用户;创建elasticsearch数据存储目录/data/elasticsearch 1 2 3 4 5 #groupaddelasticsearch #useradd-gelasticsearchelasticsearch-m #chown-Relasticsearch./usr/local/elasticsearch #mkdir/data/elasticsearch #chown-Relasticsearch./data/elasticsearch 2、修改elasticsearch.yml配置文件 1 2 3 4 5 6 #vimconfig/elasticsearch.yml cluster.name:my-application #ELK集群名称 path.data: /data/elasticsearch #elasticsearch数据存储目录 path.logs: /usr/local/elasticsearch/logs #elasticsearch日志存储路径 network.host:10.17.83.42 #elasticsearch监听地址,默认为localhost http.port:9200 #elasticsearch监听端口,默认问9200 6、修改相关的内核参数 #打开/etc/security/limits.conf文件,添加以下参数 1 2 3 4 *softnproc2048 *hardnproc16384 *softnofile65536 *hardnofile65536 #修改vm.max_map_count=262144 1 #echo"/etc/sysctl.conf">>/etc/sysctl.conf 7、运行elasticsearch (注意:要切换到普通用户运行) # su - elasticsearch $ ./bin/elasticsearch 运行elasticsearch 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 [elasticsearch@elk-server~]$ cd /usr/local/elasticsearch/ [elasticsearch@elk-serverelasticsearch]$. /bin/elasticsearch [2017-08-28T14:51:31,069][INFO][o.e.n.Node][]initializing... [2017-08-28T14:51:31,186][INFO][o.e.e.NodeEnvironment][6eN59Pf]using[1]datapaths,mounts[[/(rootfs)]],netusable_space[89.4gb],nettotal_space[91.4gb],spins?[unknown],types[rootfs] [2017-08-28T14:51:31,187][INFO][o.e.e.NodeEnvironment][6eN59Pf]heapsize[1.9gb],compressedordinaryobjectpointers[ true ] [2017-08-28T14:51:31,188][INFO][o.e.n.Node]nodename[6eN59Pf]derivedfromnodeID[6eN59PfuS7iVRfoEppsngg]; set [node.name]tooverride [2017-08-28T14:51:31,189][INFO][o.e.n.Node]version[5.5.2],pid[2759],build[b2f0c09 /2017-08-14T12 :33:14.154Z],OS[Linux /3 .10.0-327.el7.x86_64 /amd64 ],JVM[OracleCorporation /Java HotSpot(TM)64-BitServerVM /1 .8.0_65 /25 .65-b01] [2017-08-28T14:51:31,189][INFO][o.e.n.Node]JVMarguments[-Xms2g,-Xmx2g,-XX:+UseConcMarkSweepGC,-XX:CMSInitiatingOccupancyFraction=75,-XX:+UseCMSInitiatingOccupancyOnly,-XX:+AlwaysPreTouch,-Xss1m,-Djava.awt.headless= true ,-Dfile.encoding=UTF-8,-Djna.nosys= true ,-Djdk.io.permissionsUseCanonicalPath= true ,-Dio.netty.noUnsafe= true ,-Dio.netty.noKeySetOptimization= true ,-Dio.netty.recycler.maxCapacityPerThread=0,-Dlog4j.shutdownHookEnabled= false ,-Dlog4j2.disable.jmx= true ,-Dlog4j.skipJansi= true ,-XX:+HeapDumpOnOutOfMemoryError,-Des.path.home= /usr/local/elasticsearch ] [2017-08-28T14:51:32,174][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[aggs-matrix-stats] [2017-08-28T14:51:32,174][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[ingest-common] [2017-08-28T14:51:32,175][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[lang-expression] [2017-08-28T14:51:32,175][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[lang-groovy] [2017-08-28T14:51:32,175][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[lang-mustache] [2017-08-28T14:51:32,175][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[lang-painless] [2017-08-28T14:51:32,175][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[parent- join ] [2017-08-28T14:51:32,175][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[percolator] [2017-08-28T14:51:32,175][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[reindex] [2017-08-28T14:51:32,176][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[transport-netty3] [2017-08-28T14:51:32,176][INFO][o.e.p.PluginsService][6eN59Pf]loadedmodule[transport-netty4] [2017-08-28T14:51:32,176][INFO][o.e.p.PluginsService][6eN59Pf]nopluginsloaded [2017-08-28T14:51:33,991][INFO][o.e.d.DiscoveryModule][6eN59Pf]usingdiscovery type [zen] [2017-08-28T14:51:34,576][INFO][o.e.n.Node]initialized [2017-08-28T14:51:34,577][INFO][o.e.n.Node][6eN59Pf]starting... [2017-08-28T14:51:34,814][INFO][o.e.t.TransportService][6eN59Pf]publish_address{10.17.83.42:9300},bound_addresses{10.17.83.42:9300} [2017-08-28T14:51:34,826][INFO][o.e.b.BootstrapChecks][6eN59Pf]boundorpublishingtoanon-loopbackornon-link- local address,enforcingbootstrapchecks [2017-08-28T14:51:37,883][INFO][o.e.c.s.ClusterService][6eN59Pf]new_master{6eN59Pf}{6eN59PfuS7iVRfoEppsngg}{hs82h4vkTwKCEvKybCodbw}{10.17.83.42}{10.17.83.42:9300},reason:zen-disco-elected-as-master([0]nodesjoined) [2017-08-28T14:51:37,900][INFO][o.e.h.n.Netty4HttpServerTransport][6eN59Pf]publish_address{10.17.83.42:9200},bound_addresses{10.17.83.42:9200} [2017-08-28T14:51:37,900][INFO][o.e.n.Node][6eN59Pf]started [2017-08-28T14:51:37,925][INFO][o.e.g.GatewayService][6eN59Pf]recovered[0]indicesintocluster_state [2017-08-28T14:51:43,485][INFO][o.e.c.m.MetaDataCreateIndexService][6eN59Pf][.kibana]creatingindex,cause[api],templates[],shards[1]/[1],mappings[_default_,index-pattern,server,visualization,search,timelion-sheet,config,dashboard,url] 一般情况我们要求elasticsearch在后台运行,使用命令如下: 1 $. /bin/elasticsearch -d 8、检查elasticsearch状态,如下则表示正常运行 1 2 3 4 5 6 7 8 9 10 11 12 13 14 [root@elk-serverelasticsearch] #curlhttp://10.17.83.42:9200 { "name" : "6eN59Pf" , "cluster_name" : "my-application" , "cluster_uuid" : "cKopwE1iTciIQAiFI6d8Gw" , "version" :{ "number" : "5.5.2" , "build_hash" : "b2f0c09" , "build_date" : "2017-08-14T12:33:14.154Z" , "build_snapshot" : false , "lucene_version" : "6.6.0" }, "tagline" : "YouKnow,forSearch" } 二、Logstash安装 1、下载logstash软件包 1 #wgethttps://artifacts.elastic.co/downloads/logstash/logstash-5.5.2.tar.gz 2、解压至指定安装目录 1 2 3 4 #tar-zxflogstash-5.5.2.tar.gz-C/usr/local/ #cd/usr/local/ #mvlogstash-5.5.2logstash 3、运行logstash # cd logstash/ # ./bin/logstash -e 'input { stdin { } } output { stdout {} }' 输入”hello world! ”,验证是否正常输出 1 2 3 4 5 6 7 8 9 10 11 12 [root@elk-serverlogstash] #./bin/logstash-e'input{stdin{}}output{stdout{}}' ERRORStatusLoggerNolog4j2configuration file found.Usingdefaultconfiguration:loggingonlyerrorstotheconsole. SendingLogstash'slogsto /usr/local/logstash/logs which isnowconfiguredvialog4j2.properties [2017-08-28T15:11:33,267][INFO][logstash.setting.writabledirectory]Creatingdirectory{:setting=> "path.queue" ,:path=> "/usr/local/logstash/data/queue" } [2017-08-28T15:11:33,273][INFO][logstash.setting.writabledirectory]Creatingdirectory{:setting=> "path.dead_letter_queue" ,:path=> "/usr/local/logstash/data/dead_letter_queue" } [2017-08-28T15:11:33,300][INFO][logstash.agent]NopersistentUUID file found.GeneratingnewUUID{:uuid=> "2fb479ab-0ca5-4979-89b1-4246df9a7472" ,:path=> "/usr/local/logstash/data/uuid" } [2017-08-28T15:11:33,438][INFO][logstash.pipeline]Startingpipeline{ "id" => "main" , "pipeline.workers" =>8, "pipeline.batch.size" =>125, "pipeline.batch.delay" =>5, "pipeline.max_inflight" =>1000} [2017-08-28T15:11:33,455][INFO][logstash.pipeline]Pipelinemainstarted Thestdinpluginisnowwaiting for input: [2017-08-28T15:11:33,497][INFO][logstash.agent]SuccessfullystartedLogstashAPIendpoint{:port=>9600} helloworld! 2017-08-28T07:11:42.724Zelk-server.huangming.orghelloworld! 三、Kibana安装 1、下载kibana 1 #wgethttps://artifacts.elastic.co/downloads/kibana/kibana-5.5.2-linux-x86_64.tar.gz 2、解压至安装目录 1 2 3 #tar-zxfkibana-5.5.2-linux-x86_64.tar.gz-C/usr/local/ #cd/usr/local/ #mvkibana-5.5.2-linux-x86_64kibana 3、修改配置 1 2 3 4 5 6 7 #cdkibana/ #vimconfig/kibana.yml server.port:5601 #监听端口 server.host: "10.17.83.42" #指定后端服务器 elasticsearch.url: "http://10.17.83.42:9200" #指定elasticsearch实例地址 4、运行kibana # ./bin/kibana & 1 2 3 4 5 6 7 8 9 10 [root@elk-serverkibana] #./bin/kibana& [1]3219 [root@elk-serverkibana] #log[07:26:02.496][info][status][plugin:kibana@5.5.2]Statuschangedfromuninitializedtogreen-Ready log[07:26:02.604][info][status][plugin:elasticsearch@5.5.2]Statuschangedfromuninitializedtoyellow-Waiting for Elasticsearch log[07:26:02.637][info][status][plugin:console@5.5.2]Statuschangedfromuninitializedtogreen-Ready log[07:26:02.682][info][status][plugin:metrics@5.5.2]Statuschangedfromuninitializedtogreen-Ready log[07:26:02.930][info][status][plugin:elasticsearch@5.5.2]Statuschangedfromyellowtogreen-Kibanaindexready log[07:26:02.932][info][status][plugin:timelion@5.5.2]Statuschangedfromuninitializedtogreen-Ready log[07:26:02.937][info][listening]Serverrunningathttp: //10 .17.83.42:5601 log[07:26:02.939][info][status][uisettings]Statuschangedfromuninitializedtogreen-Ready 5、验证kibana 在客户端浏览器打开http://10.17.83.42:5601 在该页面提示我们需要创建一个index 首先创建一个kinana默认的index(名称为.kibana),如果输入的index名不存在,则无法创建 查看运行状态及已安装的插件 至此ELK已经搭建完成了,下面来创建一个收集message系统日志的实例 本文转自 HMLinux 51CTO博客,原文链接:http://blog.51cto.com/7424593/1960254

资源下载

更多资源
腾讯云软件源

腾讯云软件源

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

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册