- 博客(220)
- 资源 (5)
- 问答 (2)
- 收藏
- 关注
原创 Redis的sorted set如何根据权查询下n个数据返回
zadd test 1 hello1zadd test 2hello2zadd test 3 hello2
2021-06-09 19:22:04
497
原创 python如何判断数据是字符串
# -*- coding: utf-8 -*-L1 = ['Hello', 'World', 18, 'Apple', None]L2 = [x for x in L1 if type(x)==type('x')]print(L2)输出['Hello', 'World', 'Apple'] 非字符串被过滤
2020-12-10 10:24:09
2125
原创 XXL-JOB学习笔记(二)
xxl支持多种路由策略。路由策略针对同一个job在不同group运行的策略,当同时启动多个同名的执行器例子时,这个执行器就有多个,如下:这样这个xxl-job-executor-sample下就有两个进程了,配置这个group下的的job的路由策略:具体策略详见com.xxl.job.admin.core.route.ExecutorRouteStrategyEnumFIRST(I18nUtil.getString("jobconf_route_first"), new Executo
2020-11-24 08:46:48
901
1
原创 ThreadLocal和InheritableThreadLocal
ThreadLocal是做线程本地存储,ThreadLocal为变量在每个线程中都创建了一个副本,每个线程可以访问自己内部的副本变量。举个ThreadLocal的例子public class ThreadLocalTest { private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>(); public static void main(String[] args) {
2020-11-19 20:45:22
254
原创 XXL-JOB学习笔记(一)
源码去github下载下,先去执行sql新建几个表:打开主要分为3个部分:1,管理台2,核心3,执行例子运行xxl-job-admin,成功后打开管理台运行执行例子,我这边用的springboot的demo配置application.properties后启动# web portserver.port=8089# no web#spring.main.web-environment=false# log configlogging.c..
2020-11-19 20:45:04
693
原创 datax安装和使用
1 安装包准备apache-maven-3.3.9-bin.tar.gz datax.tar.gz jdk-8u221-linux-x64.tar.gz Python-3.7.1.tgz1,安装jdk,maven,pythontar -zxvf jdk-8u221-linux-x64.tar.gz -C ~/app/tar -zxvf apache-maven-3.3.9-bin.tar.gz -C ~/app/...
2020-09-29 19:06:51
552
原创 mysql报错【Illegal mix of collations (utf8_general_ci,IMPLICIT) and (utf8_german2_ci,IMPLICIT) for oper
1,可以直接在建表时添加ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_german2_ci2,修改默认的COLLATEmysql> SHOW VARIABLES LIKE 'collation_%';+----------------------+-----------------+| Variable_name | Value |+----------------------+-------------...
2020-08-27 13:47:53
646
原创 修改redhat7.5的yum源为阿里云的yum源
1,强制卸载所有包rpm -qa|grep yum|xargs rpm -e --nodeps2,查看是否卸载完全rpm -qa|grep yum3,下载相关的rpm插件,mkdir softwarecd softwarewget https://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpmwget https://mirrors.aliyun.
2020-07-26 19:13:32
989
原创 spark-sql执行报错No suitable driver found for jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=
未指定--driver-class-path正确指令:spark-sql local[2] --jars ~/software/mysql-connector-java-5.1.27-bin.jar --driver-class-path ~/software/mysql-connector-java-5.1.27-bin.jar
2020-07-17 21:08:26
3001
原创 linux下安装jdk
1,下载jdk-8u221-linux-x64.tar.gz文件2,解压tar -zxvf jdk-8u221-linux-x64.tar.gz -C ~/app/3,配置环境参数vi ~/.bash_profile添加路径:export JAVA_HOME=/home/hadoop/app/jdk1.8.0_221export PATH=$JAVA_HOME/bin:$PATH4,刷新权限source~/.bash_profile5,用java和jav.
2020-07-17 20:42:42
216
原创 window向linux系统上传文件的方法
1,如果windows命令行支持scp,就用scp上传scp path/文件名linux用户名@主机名或者ip地址:目录例子:scp F:\BaiduNetdiskDownload\mysql-connector-java-5.1.27-bin.jar hadoop@hadoop001:~/app/apache-hive-2.3.7-bin/lib2,使用lrzsz 首先安装该插件yum install lrzszrz命令回车即可跳出弹窗从本地上传文件sz 文件名 ...
2020-07-17 20:38:38
847
1
原创 spark-sql的使用配置流程
1,安装配置好jdk,mysql和scala2,安装配置hadoop3,安装配置好hive4,安装配置好spark5,把hive的conf目录下hive-site.xml文件拷贝到spark的conf目录下cp hive-site.xml /home/hadoop/app/spark-2.4.6-bin-hadoop2.7/conf6,spark启动,需指定mysql驱动包,进入scala命令行spark-shell local[2] --jars ~/software/my
2020-07-17 20:27:53
920
原创 spark.sql(“show tables“).show执行报错
错误信息如下:20/07/17 20:04:06 WARN Hive: Failed to access metastore. This class should not accessed in runtime.org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveM
2020-07-17 20:14:32
2328
原创 springboot项目里使用scala进行开发配置
<!--添加依赖--><dependency> <groupId>org.scala-lang</groupId> <artifactId>scala-library</artifactId></dependency><!--添加plugin--><plugin> <groupId>net.alchim31.maven</groupId&g..
2020-05-27 17:50:42
959
原创 使用scp上传文件时报错WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
我在windows上使用scp向linux上传文件时报错:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING...
2020-05-21 11:47:48
372
1
原创 idea下载hadoop里的文件报错java.io.IOException: (null) entry in command string: null chmod 0644 D:\Users\Admi
详细报错如下:java.io.IOException: (null) entry in command string: null chmod 0644 D:\Users\Administrator\Desktop\11.txt at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:770) at org.apache.hadoop.util.Shell.execCommand(Shell.java...
2020-05-19 11:55:55
759
1
原创 hadoop上传文件报错:org.apache.hadoop.ipc.RemoteException(java.io.IOException)
上传报错:org.apache.hadoop.ipc.RemoteException(java.io.IOException): File /b.txt could only be replicated to 0 nodes instead of minReplication (=1). There are 1 datanode(s) running and 1 node(s) are excluded in this operation.查看hadoop运行情况,发现主机名称为Hostname: lo.
2020-05-19 11:27:50
1997
原创 IDEA本地连接使用公网ip连接Hadoop时报错cannot connect
我起初在一台云服务器上安装hadoop,使用hadoop shell 操作文件正常,打开50070端口的网页正常当我在本地使用idea配置连接hadoop是时,报错网络连接不上此时,我的core-site.xml里的配置是这样的:<configuration><property> <name>fs.defaultFS</name> <value>hdfs://localhost:8020</va...
2020-05-18 14:17:25
822
原创 hadoop复制文件时报错No such file or directory
[root@hecs-x-large-2-linux-20200331210616 data]# hadoop fs -put hello.txt20/05/15 15:29:13 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicableput: `.': No such file or director
2020-05-15 15:32:56
4747
原创 linux安装配置nexus
首先安装好jdk,未安装执行yum -y install java-1.8.0-openjdk*下载nexus-2.14.3-02-bundle.tar.gz文件,自己去找解压tar xfvz nexus-2.14.3-02-bundle.tar.gz打开 /etc/profile文件在最后添加export RUN_AS_USER=rootvi /etc/profile修...
2019-11-27 17:22:46
251
原创 搭建git私服gogs
cd /tmp/wget https://dl.gogs.io/0.11.34/linux_amd64.tar.gztar -xzvf linux_amd64.tar.gz gogscd gogs前台运行./gogs web2019/11/26 16:19:02 [ WARN] Custom config '/tmp/gogs/custom/conf/app.ini' not f...
2019-11-26 17:09:50
1390
原创 linux关闭被占用的端口
查看pidnetstat -anp | grep 3000tcp6 0 0 :::3000 :::* LISTEN 5288/./gogs关闭kill -9 5288
2019-11-26 16:26:48
449
原创 linux下安装mysql
cd /tmp/wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpmyum localinstall mysql57-community-release-el7-11.noarch.rpm 加载到本地系统yum install mysql-community-server 安装...
2019-11-26 16:01:14
177
原创 jenkins结合git和maven自动部署war包到Tomact里
1,安装好jenkins,git和maven2,本地项目配置好git详见https://blog.youkuaiyun.com/qq_38522268/article/details/91360536配置好war包pom文件详见https://blog.youkuaiyun.com/qq_38522268/article/details/1032415573,a,新建jenkens项目,b,输入名称,...
2019-11-26 14:17:54
502
原创 IDEA创建springboot项目,如何打war包,并在war包的pom.xml的配置下在idea里运行程序进行测试
使用idea创建sprinboot项目默认是打jar包的配置,内嵌tomcat可直接运行程序如果需要打war包,需要对pom.xmle文件进行配置1.排除内嵌的tomcat<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring...
2019-11-25 17:15:04
906
原创 GIT切换commit
多次commit,如何切换到上面的commitgit log查看提交$ git logcommit ca70d336eb2ccfe7f8e41d9c4c9b6520fb3eaa47 (HEAD -> master)Author:Date: Wed Nov 13 18:32:27 2019 +0800 first commitcommit 967bbb92330...
2019-11-13 18:44:10
543
原创 git托管项目
提前准备1,本地安装好git2,申请github账号具体操作,1,选中文件夹,右击Git Bash Here2,初始化Administrator@cde5ce06ad324712b4e MINGW64 /d/Users/Administrator/Desktop/gittest (master)$ git init;3,创建文件READM.MF,写入内容testA...
2019-11-12 20:16:36
284
原创 ERROR 1776 (HY000): Parameters MASTER_LOG_FILE, MASTER_LOG_POS, RELAY_LOG_FILE a nd RELAY_LOG_POS ca
mysql> change master to master_host='115.28.179.114',master_user='repl',master_password='123456',MASTER_LOG_FILE='mysql-bin.000014', MASTER_LOG_POS=516980;ERROR 1776 (HY000): Parameters MASTER_L...
2019-11-11 16:23:19
1285
原创 ERROR 1840 (HY000) at line 24: @@GLOBAL.GTID_PURGED can only be set when @@GLOBA L.GTID_EXECUTED is
在主从复制的时候复制文件mysqldump --single-transaction --master-data --triggers --routines --all-databases -u root -p -f>> all.sql当粘贴的时候报错C:\Users\Administrator\Desktop>mysql -uroot -p -P3307 < ...
2019-11-11 16:17:06
456
原创 springboot如何快速找到spring.factories文件
通过SpringApplication的类加载器获取System.out.println(SpringApplication.class.getClassLoader().getResource("META-INF/spring.factories"));输出:jar:file:/D:/maven/org/springframework/boot/spring-boot/2.2.0....
2019-11-06 11:41:12
4950
原创 如何把一个生成1-7的随机数的函数re(),重新构造成生成1-10随机数的函数re1()
class Test{ public static int re(){ return new Random().nextInt(7)+1; } public static int re1(){ int i=re()-1; int j=re()-1; i=i*7+j;//i的范围0-48 /...
2019-10-24 23:14:58
355
原创 @Autowired,@Qualifier,@Resource的使用
@Autowired直接使用 @Autowired private UserMapper userMapper;@Qualifier需要与@Autowired一起使用,并在Qualifier写bean的name @Autowired @Qualifier("userMapper") private UserMapper userMapper;@...
2019-09-05 09:56:43
483
原创 java使用volatile关键字和interrupt()停止线程
volatile关键的先行发生于后面这个变量的读操作public class Demo { private volatile static boolean shutdown; public static void main(String[] args) throws InterruptedException { Runnable runnable=()-&g...
2019-08-12 20:34:21
410
原创 JAVA线程之Object.wait(),Thread.sleep(),Thread.join(),Thread.yield()的区别
Object.wait()主要在sychronized方法或者sychronized块中使用,使用该方法。当前线程进入waitset中,释放掉锁资源,直到被notify()方法被唤醒,进入锁池中竞争被加锁的资源Thread.sleep()当前线程让出cpu资源,不会影响锁,能够在程序的任何地方使用Thread.join()A,B两个线程 如果B.join(),而此时A线程没有...
2019-08-12 19:42:14
436
原创 java计算正整数二进制数中的1出现的次数
第一种,通过 Integer.bitCount(index) 方法public int[] countBits(int num) { int[] memo = new int[num + 1]; int index = 0; while (index <= num) { memo[index] = Integer.bitCount(index);...
2019-08-12 10:47:24
432
原创 java跳出多重嵌套循环
lab:for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { System.out.println("i="+"+i;"+"j="+j); if(j==3){ break lab; } }}
2019-08-08 11:00:12
183
原创 springcloud配置sleuth和zipkin
docker下启动zipkindocker run -d --restart=unless-stopped -p 9411:9411 openzipkin/zipkin依赖:<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spri...
2019-08-07 13:19:59
517
原创 springcloud使用hystrix-dashboard
依赖:<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-hystrix</artifactId></dependency><!--dashboar...
2019-08-07 11:22:42
347
几个常用的js+css
2018-09-26
TA创建的收藏夹 TA关注的收藏夹
TA关注的人