今年互联网形式依旧严峻,再次爆发几次大规模裁员潮。我决定把这篇文章分享出来帮助那些对前途感到迷茫的朋友。
在猎头的眼里,我已不是根正苗红的程序员。何为根正苗红?计算机专业毕业,从毕业起就从事特定方向的开发工作,这才是猎头眼中的香饽饽。
毕业之后的那段岁月,可以用悲惨形容,每当和人提起,我总会有点自嘲的说“睡过凌晨一点的办公室,吃过凌晨三点的便利店,做过凌晨五点的首班车”。但是回头想想,我却要感谢那不堪的经历,让我找到了适合自己的方向。
作为技术人员,我一直有个疑问,什么是你引以为傲的资本?面对已经来临的资本寒冬,应该何去何从?
大学期间,我每年都会给自己总结一个词语。回首做技术的这几年,我同样给自己总结了几个关键词。希望大家可以从中受益。
Please enter the gitlab-ci description for this runner:
可以为空
Please enter this gitlab-ci tags for this runner (comma separated):
Please enter the executor:virtualbox, docker+machine,parallels,shell,ssh,docker-ssh+machine,kubernetes,docker,docker-ssh:
shell
复制代码
FROM openjdk:8-jre
MAINTAINER mrchen <365984197qq.com>
ENV APP_VERSION 1.0.0-SNAPSHOT
#ENV DOCKERIZE_VERSION v0.6.1
#RUN weget https://github.com/jwilder/dockerize/releases/download/ D O C K E R I Z E V E R S I O N / d o c k e r i z e − l i n u x − a m d 64 − DOCKERIZE_VERSION/dockerize-linux-amd64- DOCKERIZEVERSION/dockerize−linux−amd64−DOCKERIZE_VERSION.tar.gz \
RUN mkdir /app
COPY itoken-config-$APP_VERSION.jar /app/app.jar
#ENTRYPOINT [“dockerize”, “-timeout”, “5m”, “-wait”, “tcp://192.168.75.128:8888”, “java”, “-Djava.security.egd=file:/dev/./urandom”, “-jar”, “”]
ENTRYPOINT [“java”, “-Djava.security.egd=file:/dev/./urandom”, “-jar”, “/app/app.jar”, “–spring.profiles.active=prod”]
EXPOSE 8888
复制代码
version: ‘3.1’
services:
itoken-config:
restart: always
image: 47.112.215.6:5000/itoken-config
container_name: itoken-config
ports:
复制代码
stages:
build
push
run
clean
build:
stage: build
script:
/usr/local/maven/apache-maven-3.6.3/bin/mvn clean package
cp target/itoken-config-1.0.0-SNAPSHOT.jar docker/
cd docker
docker build -t 47.112.215.6:5000/itoken-config .
push:
stage: push
script:
run:
stage: run
script:
cd docker
docker-compose down
docker-compose up -d
clean:
stage: clean
script:
复制代码
将上述文件提交到gitLab即可触发脚本
启动多个runner项目需要更改networks
version: ‘3.1’
services:
itoken-eureka:
restart: always
image: 47.112.215.6:5000/itoken-eureka
container_name: itoken-eureka
ports:
networks:
networks:
eureka-network:
复制代码
[](()生产环境项目秒速回滚
=============================================================================
使用linux的ln软链接命令
使用docker的镜像重启回滚到以前版本
[](()使用微服务开发管理员服务
===============================================================================
com.alibaba
druid-spring-boot-starter
${spring-boot-alibaba-druid.version}
mysql
mysql-connector-java
${mysql.version}
runtime
复制代码
datasource:
druid:
url: jdbc:mysql://ip:port/dbname?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root
password: 123456
initial-size: 1
min-idle: 1
max-active: 20
test-on-borrow: true
driver-class-name: com.mysql.jdbc.Driver
复制代码
tk.mybatis
mapper-spring-boot-starter
2.0.2
复制代码
添加MyMapper接口
添加PageHelper类方法
配置代码自动生成插件
[](()测试驱动编程的方式进行敏捷开发(TDD)
=======================================================================================
编写测试用例(登陆和注册的测试用例)
根据用例方法编写实现
[](()静态文件部署方式(nginx-CDN内容分发网络)
============================================================================================
version: ‘3.1’
services:
nginx:
restart: always
image: nginx
container_name: nginx
ports:
81:80
9000:9000
volumes:
./conf/nginx.conf:/etc/nginx/nginx.conf
./wwwroot:/usr/share/nginx/wwwroot
复制代码
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
#}
server {
listen 8080;
server_name 192.168.75.145;
location / {
root /usr/share/nginx/wwwroot/html8080;
index index.html index.html;
}
}
}
复制代码
server {
listen 80;
server_name itoken.mrchen.com;
location / {
proxy_pass http://192.168.75.128:9090;
index index.html index.htm;
}
}
复制代码
upstream myapp1 {
server 192.168.94.132:9090 weight=10;
server 192.168.94.132:9091 weight=10;
}
server {
listen 80;
server_name 192.168.94.132
location / {
proxy_pass http://myapp1;
index index.jsp index.html index.htm;
}
}
复制代码
[](()使用redis做数据缓存
===============================================================================
缓存(数据查询、短连接、新闻内容、商品内容等等)
通过Redis HA(Redis高可用)的方式部署Redis服务
keepalived
zookeeper
sentinel(官方推荐)
复制代码
version: ‘3.1’
services:
master:
image: redis
container_name: redis-master
ports:
slave1:
image: redis
container_name: redis-slave-1
ports:
command: redis-server --slaveof redis-master 6379
slave2:
image: redis
container_name: redis-slave-2
ports:
command: redis-server --slaveof redis-master 6379
复制代码
version: ‘3.1’
services:
sentinel1:
image: redis
container_name: redis-sentinel-1
ports:
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
values:
sentinel2:
image: redis
container_name: redis-sentinel-2
ports:
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
values:
sentinel3:
image: redis
container_name: redis-sentinel-3
ports:
command: redis-sentinel /usr/local/etc/redis/sentinel.conf
values:
复制代码
port 26379
dir /tmp
sentinel monitor mymaster 127.0.0.1 6379 2
sentinel down-after-milliseconds mymaster 30000
sentinel parallel-syncs mymaster 1
sentinel failover-timeout mymaster 180000
sentinel deny-scripts-reconfig yes
复制代码
[](()搭建redis的服务提供者(提供缓存服务)
========================================================================================
org.apache.commons
spring-boot-starter-data-redis
org.springframework.boot
spring-boot-starter-data-redis
复制代码
spring:
redis:
lettuce:
pool:
max-active: 8
max-idle: 8
max-wait: -1ms
min-idle: 0
sentinel:
master: mymaster
nodes: 47.112.215.6:26379,47.112.215.6:26380,47.112.215.6:26381
复制代码
[](()使用redis实现单点登录服务(需要解决同源策略)
============================================================================================
首先,应用群域名要统一
其次,应用群各系统使用的技术要相同
第三,cookie本身不安全
复制代码
[](()解决跨域问题(nginx请求文字会跨域)
=======================================================================================
服务器端实现CORS接口即可,在header中设置:Access-Control-Allow-Origin
复制代码
使用JSONP解决跨域问题
使用Nginx反向代理解决跨域问题
worker_processes 1;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name 47.112.215.6;
location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
root /usr/share/nginx;
index index.html index.html;
}
}
}
复制代码
[](()Spring Boot MyBatis Redis 实现二级缓存(数据不常变化,减轻数据库压力)
===================================================================================================================
至此,文章终于到了尾声。总结一下,我们谈论了简历制作过程中需要注意的以下三个部分,并分别给出了一些建议:
以及最后为大家准备的福利时间:简历模板+Java面试题+热门技术系列教程视频
/etc/nginx/mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name 47.112.215.6;
location / {
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
root /usr/share/nginx;
index index.html index.html;
}
}
}
复制代码
[](()Spring Boot MyBatis Redis 实现二级缓存(数据不常变化,减轻数据库压力)
===================================================================================================================
至此,文章终于到了尾声。总结一下,我们谈论了简历制作过程中需要注意的以下三个部分,并分别给出了一些建议:
以及最后为大家准备的福利时间:简历模板+Java面试题+热门技术系列教程视频
[外链图片转存中…(img-IEL2PY4s-1649750558082)]
[外链图片转存中…(img-tXqQ2s3d-1649750558083)]
[外链图片转存中…(img-RebvspuY-1649750558084)]
阿里P7熬夜整理的《Java全套学习手册》,火爆IT圈