location

hive修改location

匿名 (未验证) 提交于 2019-12-02 23:00:14
FAILED: Error in metadata: /user/hive/warehouse/zwpdb.db/wms_c_wlsydmx1 is not absolute or has no scheme information. Please specify a complete absolute uri with scheme information. FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask hive> alter table wms_c_wlsydmx set location 'hdfs://h252020:9000/user/hive/warehouse/zwpdb.db/wms_c_wlsydmx1' OK 很明显,需要加上hdfs://h252020:9000 文章来源: hive修改location

【SpringCloud】Zuul在何种情况下使用Hystrix

匿名 (未验证) 提交于 2019-12-02 22:59:29
首先,引入 spring-cloud-starter-zuul 之后会间接引入: hystrix依赖已经引入,那么何种情况下使用hystrix呢? 在Zuul的自动配置类 ZuulServerAutoConfiguration 和 ZuulProxyAutoConfiguration 中总共会向Spring容器注入3个Zuul的RouteFilter,分别是 SimpleHostRoutingFilter 简单路由,通过HttpClient向预定的URL发送请求 生效条件: RequestContext.getCurrentContext().getRouteHost() != null 1、RequestContext中的routeHost不为空,routeHost就是URL,即使用URL直连 2、RequestContext中的sendZuulResponse为true,即是否将response发送给客户端,默认为true RibbonRoutingFilter 使用Ribbon、Hystrix和可插入的http客户端发送请求 生效条件: (RequestContext.getRouteHost() == null && RequestContext.get(SERVICE_ID_KEY) != null 1、RequestContext中的routeHost为空,即URL为空

异常:The temporary upload location [/tmp/tomcat.135042057.80/work/Tomcat/localhost/ROOT] is not valid

匿名 (未验证) 提交于 2019-12-02 22:56:40
线上的服务器系统中不能上传文件了,出现如下错误: org.springframework.web.multipart.MultipartException: Could not parse multipart servlet request;nested exception is java.io.IOException: The temporary upload location [/tmp/tomcat.1337767218595042057.80/work/Tomcat/localhost/ROOT] is not valid org.springframework.web.multipart.support.StandardMultipartHttpServletRequest.parseRequest(StandardMultipartHttpServletRequest.java:112) org.springframework.web.multipart.support.StandardMultipartHttpServletRequest. 原因: 在linux系统中,springboot应用服务再启动(java -jar 命令启动服务)的时候,会在操作系统的/tmp目录下生成一个tomcat*的文件目录,上传的文件先要转换成临时文件保存在这个文件夹下面。由于临时

Cant run background service

烂漫一生 提交于 2019-12-02 22:47:32
问题 I am trying to use LocationListener class in a background service to receive the current location of user every time and then comparing it with some data stored in my database. but I am gettin error, when I am trying to do that package com.example.alert; import android.app.Service; import android.content.Context; import android.content.Intent; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.media.MediaPlayer;

Android Get latitude and longitude with location manager [duplicate]

丶灬走出姿态 提交于 2019-12-02 22:25:55
问题 This question already has answers here : getlastknownlocation always return null after I re-install the apk file via eclipse (5 answers) Closed 2 years ago . I'm trying to get the user location with location manager but the location always returns null. I also am asking to the user to turn on the gps. This is my code: int permisioncheck = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION); if(permisioncheck == 0){ lm = (LocationManager)getContext()

php根据经纬度排序,根据经纬度筛选距离段

匿名 (未验证) 提交于 2019-12-02 22:11:45
SQL 语句:select location.* from (select *,round(6378.138*2*asin(sqrt(pow(sin( (36.668530*pi()/180-px_lat*pi()/180)/2),2)+cos(36.668530*pi()/180)*cos(px_lat*pi()/180)* pow(sin( (117.020359*pi()/180-px_lon*pi()/180)/2),2)))*1000) as distance from bsx_training where (px_state = 1) and (type_id != ‘‘) and (((px_lat >= 27.683290277922) and (px_lat <= 45.653769722078)) and ((px_lon >= 105.81826766053) and (px_lon <= 128.22245033947))) order by distance limit 0,10) location where (1=1) and (location.distance <= 500) 先忽略上面这条SQL语句。一一解释 根据SQL排序的SQl语句 // lon1当前用户经度 lat1当前用户纬度,lon2 sql的经度字段 lat sql的纬度字段

关于PHP中微信公众平台网页授权两次重定向跳转的问题

匿名 (未验证) 提交于 2019-12-02 22:11:45
吐槽一下,新版的这个编辑器怎么这么难用!!! 微信公众平台网页授权时,请求授权链接 https://open.weixin.qq.com/connect/oauth2/authorize?appid=xxx&redirect_uri=xxx&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect 之前会出现要求两次授权,以为是网速慢,服务器卡了,没在意。 今天请求 scope=snsapi_base时,发现数据库中存了相同的openid,因为没有使用openid做主键,所以允许openid重复。 查看log发现同一时间居然有2条不通的code。 说明微信那边重定向了2次过来。 网上搜了一下,说是添加 &connect_redirect=1 这个字段,反正我这里无效。问题依旧。 因为是php,使用的是header跳转。 改为location跳转,居然问题解决了!!!! 只需要把 header("Location: {$authorization_url}"); 改为 echo "<script>location.href='".$authorization_url."'</script>"; 文章来源: 关于PHP中微信公众平台网页授权两次重定向跳转的问题

Nginx教程

匿名 (未验证) 提交于 2019-12-02 22:10:10
Nginx 是一个高性能的HTTP和反向代理服务器。 特点是占用内存少,并发能力强,理论上能支持高达50000个并发连接数。 Nginx可以作为静态页面的web服务器,同时还支持CGI协议的动态语言,如perl,php等。但是不支持java, java需要通过tomcat配合。 Nginx可以作为正向代理来进行上网功能。 正向代理:如果把局域网外的Internet想象成一个巨大的资源库,则局域网中的客户端要访问Internet, 则需要通过代理服务器来访问,这种代理服务器就称为正向代理。 正向代理需要客户端配置代理服务器进行指定网站访问。 Nginx可以作为反向代理服务器。 反向代理中,客户端对代理是无感知的。因为客户端不需要任何配置就可以访问。请求发送到反向代理服务器后,由反向代理服务器去选择目标服务器,获取数据后返回给客户端。 反向代理服务器和真实服务器对外就是一台服务器,暴露的是代理服务器的地址,隐藏了真实服务器的地址。 增加服务器的数量,将请求分发到各个服务器上,将原来请求集中到单个服务器上的情况改为将请求分发到多个服务器上,将负载分发到不同的服务器上,也就是我们所说的负载均衡。 为了加快网站的解析速度,可以把动态页面和静态页面由不同的服务器来解析,加快解析速度,降低原来单个服务器的压力。 本次安装在虚拟机CentOS 7.6 64位系统中进行。 先安装gcc环境

用nginx解决前端跨域问题

匿名 (未验证) 提交于 2019-12-02 22:10:10
假如前端你项目部署在nginx的根目录下,然后项目需要请求后台小伙伴写的接口 nginx配置: #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen