首页 文章 精选 留言 我的

精选列表

搜索[渲染问题],共10000篇文章
优秀的个人博客,低调大师

Spark 参数传递问题解析

一 . sparkconf 这个需要在代码里面写,在代码里面写了,那么就不能更改了,即便你在外面传递了一个参数,最终也会在代码里面生效,它的优先级最高 二 . sparksubmit / spark-shell 等脚本,一般在这里面传递,针对我这个应用的参数 三 . 配置文件 在conf 目录下,注意如果需要让参数生效,得template 去掉: 默认的,全局的 这三个地方都可以设置参数,如果说,我们对同样一个参数进行设置,最终是哪个地方生效 这三个地方的优先级是: sparkconf > sparksubmit > 配置文件 本文转自 ChinaUnicom110 51CTO博客,原文链接:http://blog.51cto.com/xingyue2011/1952554

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

hadoop 突然断电数据丢失问题

阅读目录 HDFS-Could not obtain block 回到顶部 HDFS-Could not obtain block MapReduceTotal cumulative CPU time: 33 seconds 380 msec Ended Job = job_201308291142_4635 with errors Errorduring job, obtaining debugging information... Job Tracking URL:http://xxx/jobdetails.jsp?jobid=job_201308291142_4635 Examining task ID: task_201308291142_4635_m_000019 (and more) from job job_201308291142_4635 Examining task ID: task_201308291142_4635_m_000007 m(and more) from job job_201308291142_4635 Examining task ID: task_201308291142_4635_m_000009 (and more) from job job_201308291142_4635 Task with the most failures(5): ----- Task ID: task_201308291142_4635_m_000009 URL: http://xxxxxxx:50030/taskdetails.jsp?jobid=job_201308291142_4635&tipid=task_201308291142_4635_m_000009 ----- Diagnostic Messages for this Task: java.io.IOException:java.io.IOException: org.apache.hadoop.hdfs.BlockMissingException: Could not obtain block: BP-1555036314-10.115.5.16-1375773346340:blk_-2678705702538243931_541142 file=/user/hive/warehouse/playtime/dt=20131119/access_pt.log.2013111904.log at org.apache.hadoop.hive.io.HiveIOExceptionHandlerChain.handleRecordReaderNextException(HiveIOExceptionHandlerChain.java:121) at org.apache.hadoop.hive.io.HiveIOExceptionHandlerUtil.handleRecordReaderNextException(HiveIOExceptionHandlerUtil.java:77) at org.apache.hadoop.hive.shims.HadoopShimsSecure$CombineFileRecordReader.doNextWithExceptionHandler(HadoopShimsSecure.java:330) at org.apache.hadoop.hive.shims.HadoopShimsSecure$CombineFileRecordReader.next(HadoopShimsSecure.java:246) at org.apache.hadoop.mapred.MapTask$TrackedRecordReader.moveToNext(MapTask.java:215) at org.apache.hadoop.mapred.MapTask$TrackedRecordReader.next(MapTask.java:200) at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:48) at org.apache.hadoop.mapred.MapTask.runOldMa Reson Solution HDFSFILE - IfHDFSblock is missing 1. confirm status Confirm missing block is exit or not. If missing block is over 1, file is not able to read. $hadoopdfsadmin -report Configured Capacity: 411114887479296 (373.91 TB) Present Capacity: 411091477784158 (373.89 TB) DFS Remaining: 411068945908611 (373.87 TB) DFS Used: 22531875547 (20.98 GB) DFS Used%: 0.01% Under replicated blocks: 0 Blocks with corrupt replicas: 0 Missing blocks: 0 ------------------------------------------------- Datanodes available: 20 (20 total, 0 dead) 2. detail block file hadoop fsck hadoopfsck/ -files -blocks ... Status: HEALTHY Total size: 4056908575 B (Total open files size: 3505453 B) Total dirs: 533 Total files: 15525 (Files currently being written: 2) Total blocks (validated): 15479 (avg. block size 262091 B) (Total open file blocks (not validated): 2) Minimally replicated blocks: 15479 (100.0 %) Over-replicated blocks: 0 (0.0 %) Under-replicated blocks: 0 (0.0 %) Mis-replicated blocks: 0 (0.0 %) Default replication factor: 3 Average block replication: 3.0094967 Corrupt blocks: 0 Missing replicas: 0 (0.0 %) Number of data-nodes: 20 Number of racks: 1 FSCKended at Tue Nov 19 10:17:19 KST 2013 in 351 milliseconds The filesystem under path '/' is HEALTHY 3. remove corrupted file $hadoopfsck-delete ..... .........................Status: HEALTHY Total size: 4062473881 B (Total open files size: 3505453 B) Total dirs: 533 Total files: 15525 (Files currently being written: 2) Total blocks (validated): 15479 (avg. block size 262450 B) (Total open file blocks (not validated): 2) Minimally replicated blocks: 15479 (100.0 %) Over-replicated blocks: 0 (0.0 %) Under-replicated blocks: 0 (0.0 %) Mis-replicated blocks: 0 (0.0 %) Default replication factor: 3 Average block replication: 3.0094967 Corrupt blocks: 0 Missing replicas: 0 (0.0 %) Number of data-nodes: 20 Number of racks: 1 FSCKended at Tue Nov 19 10:21:41 KST 2013 in 294 milliseconds The filesystem under path '/' is HEALTHY HIVE FILE - If hive block is missing altertable drop partition 本文转自疯吻IT博客园博客,原文链接:http://www.cnblogs.com/fengwenit/p/5941552.html,如需转载请自行联系原作者

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

Elasticsearch集群UNASSIGNED shareds问题 修复

线上有3台es组成集群,其他有两台非正常关机了,早上过来发现集群状态为红色,提示"24 UNASSIGNED shareds": 1)查看集群相关信息: curl'localhost:9200/_nodes/process?pretty' 记下这个node的id号; 2)然后找出UNASSIGNED 的相关信息,方便后续修改! # curl -XGET http://localhost:9200/_cat/shards|grep UNASSIGNED % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 30528 100 30528 0 0 705k 0 --:--:-- --:--:-- --:--:-- 745k graylog_83 1 p UNASSIGNED graylog_83 1 r UNASSIGNED graylog_83 0 p UNASSIGNED graylog_83 0 r UNASSIGNED graylog_82 1 p UNASSIGNED graylog_82 1 r UNASSIGNED graylog_85 2 p UNASSIGNED graylog_85 2 r UNASSIGNED graylog_85 1 p UNASSIGNED graylog_85 1 r UNASSIGNED graylog_84 0 p UNASSIGNED graylog_84 0 r UNASSIGNED graylog_87 1 p UNASSIGNED graylog_87 1 r UNASSIGNED graylog_86 3 p UNASSIGNED graylog_86 3 r UNASSIGNED graylog_86 1 p UNASSIGNED graylog_86 1 r UNASSIGNED graylog_89 3 p UNASSIGNED graylog_89 3 r UNASSIGNED graylog_88 1 p UNASSIGNED graylog_88 1 r UNASSIGNED graylog_88 0 p UNASSIGNED graylog_88 0 r UNASSIGNED 3)然后依次修改以上UNASSIGNED ,命令为: curl -XPOST 'localhost:9200/_cluster/reroute' -d '{ "commands" : [ { "allocate" : { "index" : "graylog_83", "shard" : 1, "node" : "Auq82gfGQVWgOBw6S7ajRQ", "allow_primary" : true } }] }' PS: index就是索引的名称:也就是graylog_88,graylog_86,graylog_87..... node:就是在哪个节点上执行; shared:分片的编号! 本文转自 shine_forever 51CTO博客,原文链接:http://blog.51cto.com/shineforever/1859734

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

Openstack 调用socket RAW 权限问题

在Openstack中实现节点高可用的方案中,探测物理节点宕机现象,在程序中调用了socket RAW 协议,但是必须具备root 用户权限,而openstack程序调用是nova用户,于是做了这样的事情,希望能帮助大家 1, 程序调用的错误 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task Traceback (most recent call last): 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.6/site-packages/nova/openstack/common/periodic_task.py" , line 180 , inrun_periodic_tasks 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task task( self , context) 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.6/site-packages/nova/extend/manager.py" , line 91 , inhealth_check_host 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task ifnot icmp_ping.icmp_ping(node_resource[s][ 'host_ip' ]) and \ 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.6/site-packages/nova/extend/icmp_ping.py" , line 157 , inicmp_ping 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task delay = do_one(dest_addr, CONF.timeout) 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.6/site-packages/nova/extend/icmp_ping.py" , line 136 , indo_one 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task ping_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, icmp) 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.6/site-packages/eventlet/greenio.py" , line 116 , in__init__ 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task fd = _original_socket(family_or_realsock, * args, * * kwargs) 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib64/python2.6/socket.py" , line 184 , in__init__ 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task _sock = _realsocket(family, type , proto) 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task error: [Errno 1 ] Operation notpermitted 2,icmp_ping 的实现,这是网上一个哥们写的ICMP 的实,下次找到贴上去,,我拿过来做了一些修改,希望作者不要见怪 URL:https://mail.python.org/pipermail/tutor/2009-November/072706.html 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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright 2011 Ken Pepple # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """ To detect physical nodes is active, according to the sock. Write the daemon ICMP protocol """ importos importsys #import socket importstruct importselect importtime importtraceback fromoslo.config importcfg fromnova.openstack.common importlog as logging fromeventlet.green importsocket icmp_opts = [ cfg.StrOpt( 'timeout' , default = 3 , help = 'Setting socket timeout' ), cfg.StrOpt( 'count' , default = 9 , help = 'Setting the IMCP PING' ), ] CONF = cfg.CONF CONF.register_opts(icmp_opts) LOG = logging.getLogger(__name__) # From /usr/include/linux/icmp.h; your milage may vary. ICMP_ECHO_REQUEST = 8 # Seems to be the same on Solaris. defchecksum(source_string): """ I'm not too confident that this is right but testing seems to suggest that it gives the same answers as in_cksum in ping.c """ sum = 0 countTo = ( len (source_string) / 2 ) * 2 count = 0 whilecount<countTo: thisVal = ord (source_string[count + 1 ]) * 256 + ord (source_string[count]) sum = sum + thisVal sum = sum & 0xffffffff # Necessary? count = count + 2 ifcountTo< len (source_string): sum = sum + ord (source_string[ len (source_string) - 1 ]) sum = sum & 0xffffffff # Necessary? sum = ( sum >> 16 ) + ( sum & 0xffff ) sum = sum + ( sum >> 16 ) answer = ~ sum answer = answer & 0xffff # Swap bytes. Bugger me if I know why. answer = answer >> 8 | (answer << 8 & 0xff00 ) returnanswer defreceive_one_ping(ping_socket, ID , timeout): """ receive the ping from the socket. """ timeLeft = timeout whileTrue: startedSelect = time.clock() whatReady = select.select([ping_socket], [], [], timeLeft) howLongInSelect = (time.clock() - startedSelect) ifwhatReady[ 0 ] = = []: # Timeout return timeReceived = time.clock() recPacket, addr = ping_socket.recvfrom( 1024 ) icmpHeader = recPacket[ 20 : 28 ] type , code, checksum, packetID, sequence = struct.unpack( "bbHHh" , icmpHeader ) ifpacketID = = ID : bytesInDouble = struct.calcsize( "d" ) timeSent = struct.unpack( "d" , recPacket[ 28 : 28 + bytesInDouble])[ 0 ] returntimeReceived - timeSent timeLeft = timeLeft - howLongInSelect iftimeLeft < = 0 : return defsend_one_ping(ping_socket, dest_addr, ID ): """ Send one ping to the given >dest_addr<. """ dest_addr = socket.gethostbyname(dest_addr) # Header is type (8), code (8), checksum (16), id (16), sequence (16) my_checksum = 0 # Make a dummy heder with a 0 checksum. header = struct.pack( "bbHHh" , ICMP_ECHO_REQUEST, 0 , my_checksum, ID , 1 ) bytesInDouble = struct.calcsize( "d" ) data = ( 192 - bytesInDouble) * "Q" data = struct.pack( "d" , time.clock()) + data # Calculate the checksum on the data and the dummy header. my_checksum = checksum(header + data) header = struct.pack( "bbHHh" , ICMP_ECHO_REQUEST, 0 , socket.htons(my_checksum), ID , 1 ) packet = header + data ping_socket.sendto(packet, (dest_addr, 1 )) # Don't know about the 1 defdo_one(dest_addr, timeout): """ Returns either the delay (in seconds) or none on timeout. """ icmp = socket.getprotobyname( "icmp" ) try : ping_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, icmp) #ping_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, icmp) exceptsocket.error, (errno, msg): iferrno = = 1 : # Operation not permitted msg = msg + ( " - Note that ICMP messages can only be sent from processes" " running as root." ) LOG.error(socket.error(msg)) raise # raise the original error my_ID = os.getpid() & 0xFFFF send_one_ping(ping_socket, dest_addr, my_ID) delay = receive_one_ping(ping_socket, my_ID, timeout) ping_socket.close() returndelay deficmp_ping(dest_addr): active = False fori inxrange(CONF.count): try : delay = do_one(dest_addr, CONF.timeout) exceptsocket.gaierror, e: active = False break ifdelay = = None : active = False else : active = True return active 3,我单独写了一个openstack 的组件,来实现高可用(nova-extend),用他来调用 ICMP_PING 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 """Starter script for Nova Extend.""" importsys fromoslo.config importcfg fromnova importconfig fromnova importobjects fromnova.openstack.common importlog as logging fromnova importservice fromnova importutils CONF = cfg.CONF CONF.import_opt( 'topic' , 'nova.extend.api' , group = 'extend' ) defmain(): objects.register_all() config.parse_args(sys.argv) logging.setup( "nova" ) utils.monkey_patch() 4, nova-extend 启动服务的时候会调用nova.extend.manager.ExtendManager 1 2 3 4 ifnot icmp_ping.icmp_ping(node_resource[s][ 'host_ip' ]) and \ utils.is_false(CONF.extend_high_availability): LOG.info( "The compute node [%s] is down " % s) instances_uuid = db.instances_uuid_by_host(context,s) 5, 程序就会报错, 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task Traceback (most recent call last): 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.6/site-packages/nova/openstack/common/periodic_task.py" , line 180 , inrun_periodic_tasks 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task task( self , context) 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.6/site-packages/nova/extend/manager.py" , line 91 , inhealth_check_host 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task ifnot icmp_ping.icmp_ping(node_resource[s][ 'host_ip' ]) and \ 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.6/site-packages/nova/extend/icmp_ping.py" , line 157 , inicmp_ping 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task delay = do_one(dest_addr, CONF.timeout) 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.6/site-packages/nova/extend/icmp_ping.py" , line 136 , indo_one 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task ping_socket = socket.socket(socket.AF_INET, socket.SOCK_RAW, icmp) 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib/python2.6/site-packages/eventlet/greenio.py" , line 116 , in__init__ 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task fd = _original_socket(family_or_realsock, * args, * * kwargs) 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task File "/usr/lib64/python2.6/socket.py" , line 184 , in__init__ 2014 - 03 - 1309 : 33 : 08.4081916TRACE nova.openstack.common.periodic_task _sock = _realsocket(family, type , proto) 2 6 ,我用python 调用是OK 的,但是openstack调用依然报错,我以为是协程限制导致,岂不是,我是这样处理的 1, copy /usr/bin/python /usr/bin/python-extend 2, chown root:root /usr/bin/python-extend 3, chmod ug+s /usr/bin/python-extend 4, 修改/usr/bin/nova-extend #!/usr/bin/python-extend 5,重启服务就OK 了 本文转自 swq499809608 51CTO博客,原文链接:http://blog.51cto.com/swq499809608/1375260

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

ObjC解码汉字网页乱码问题

入股读取的中文网页编码集是gb2312用UTF8的编码得到的结果只能是nil,换用ASCII得到的结果是中文编乱码。 只能这样: NSURL *url = [NSURL URLWithString:urlStr]; NSData *data = [NSData dataWithContentsOfURL:url]; NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(kCFStringEncodingGB_18030_2000); NSString *retStr = [[NSString alloc] initWithData:data encoding:enc]; So EASY! 欢迎加群互相学习,共同进步。QQ群:iOS: 58099570 | Android: 572064792 | Nodejs:329118122 做人要厚道,转载请注明出处! 本文转自张昺华-sky博客园博客,原文链接:http://www.cnblogs.com/sunshine-anycall/archive/2013/05/28/3104267.html ,如需转载请自行联系原作者

资源下载

更多资源
腾讯云软件源

腾讯云软件源

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

Rocky Linux

Rocky Linux

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

Sublime Text

Sublime Text

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

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册