当前位置: 首页 > news >正文

Redis部署

JAVA安装

mkdir /usr/local/javacd /usr/local/java/wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"  http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gzwget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"  http://download.oracle.com/otn-pub/java/jdk/8u211-b12/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u211-linux-x64.tar.gz
tar -zxvf jdk-8u211-linux-x64.tar.gz 

vi /etc/profile

export JAVA_HOME=/usr/local/java/jdk1.8.0_211
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.14
export NODE_HOME=/usr/local/elasticsearch-6.3.2/node-v10.1.0-linux-x64
export JRE_HOME=/usr/local/java/jdk1.8.0_211/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$ZOOKEEPER_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$NODE_HOME/bin:$ZOOKEEPER_HOME/bin:$PATHexport NODE_PATH=$NODE_HOME/lib/node_modules

source /etc/profile
java -version

Reids安装 —> 内存优化 —> 雪崩

mkdir /usr/local/redis

chmod 777 /usr/local/redis/

cd /usr/local/redis

wget http://download.redis.io/releases/redis-4.0.12.tar.gz

tar -zxvf redis-4.0.12.tar.gz

cd redis-4.0.12

yum -y install tcl

如果提示cc没有找到:yum -y install gcc gcc-c++ libstdc+±devel

如果提示/deps/hiredis/libhiredis.a:cd ./deps make lua hiredis linenoise

make MALLOC=libc

make test

make install

vim redis.conf

daemonize yes
bind 0.0.0.0
port  6379requirepass 1111111111

./src/redis-server ./redis.conf

vim /etc/systemd/system/redis-server.service

[Unit]
Description=Redis Server Manager
After=syslog.target
After=network.target[Service]
#Type=simple
#User=redis
#Group=redis
Type=forking
#PIDFile=/var/run/redis_6902.pid
#ExecStart=/usr/local/redis/redis-4.0.12/src/redis-server /usr/local/redis/redis-4.0.12/redis.conf
#ExecReload=/usr/local/redis/redis-4.0.12/src/redis-server -s reload
#ExecStop=/usr/local/redis/redis-4.0.12/src/redis-cli shutdown
#Restart=always
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis/redis-4.0.12/src/redis-server /usr/local/redis/redis-4.0.12/redis.conf
ExecReload=/usr/local/redis/redis-4.0.12/src/redis-server -s reload
ExecStop=/usr/local/redis/redis-4.0.12/src/redis-server -s quit
PrivateTmp=true[Install]
WantedBy=multi-user.target

systemctl enable redis-server.service
systemctl status redis-server.service

systemctl restart redis-server.service

systemctl list-unit-files |grep redis

systemctl start redis-service

Nginx安装

mkdir /usr/local/nginx

cd /usr/local/nginx/

wget -c https://nginx.org/download/nginx-1.15.8.tar.gz

yum install gcc-c++

yum install -y pcre pcre-devel

yum install -y zlib zlib-devel

yum install -y openssl openssl-devel

tar -zxvf nginx-1.15.8.tar.gz

cd nginx-1.15.8

./configure --with-http_ssl_module

./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module

make

make install

cd …/sbin/

./nginx

ps aux|grep nginx

vim /usr/local/nginx/conf/nginx.conf

server {listen  80;server_name xxx.xxx.xxx;location / {proxy_set_header Host $host;proxy_pass http://localhost:8689/website/;}location /website/ {proxy_pass http://localhost:8689/website/;proxy_cookie_path /website/ /;proxy_set_header   Host    $host;proxy_set_header   X-Real-IP   $remote_addr;proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;}}server {listen       80;server_name  api.wechat.smart.chenghong.tech;rewrite ^(.*) https://$server_name$1 permanent;location / {proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://api_wechat_smart;}}server {listen       443 ssl;server_name  api.wechat.smart.chenghong.tech;ssl_certificate      /usr/local/nginx/cert2/3232530_api.wechat.smart.chenghong.tech.pem;ssl_certificate_key  /usr/local/nginx/cert2/3232530_api.wechat.smart.chenghong.tech.key;ssl_session_cache    shared:SSL:1m;ssl_session_timeout  5m;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_prefer_server_ciphers  on;location / {proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://api_wechat_smart;}}upstream api_wechat_smart{server localhost:8689;}

/usr/local/nginx/sbin/nginx -s reload

附加

cd nginx-1.16.0

./configure
make
make install
netstat -ano|grep 80
cd configure
ls
wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure=====================================================
make
make install

cd /usr/local/src
wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz
tar -zxvf openssl-1.0.1t.tar.gz
cd /usr/local/nginx-1.16.0
./configure
make
make install

zk安装

mkdir /usr/local/zk

cd /usr/local/zk

wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz
java -version
tar -xvzf zookeeper-3.4.14.tar.gz

cd zookeeper-3.4.14

cd bin/
./zkServer.sh start

开放服务器端口(如80)

firewall-cmd --zone=public --add-port=80/tcp --permanent

命令含义: --zone #作用域 --add-port=80/tcp #添加端口,格式为:端口/通讯协议 --permanent #永久生效,没有此参数重启后失效

firewall-cmd --reload

firewall-cmd --list-ports

http://www.lryc.cn/news/36917.html

相关文章:

  • AT32F437制作Bootloader然后实现Http OTA升级
  • Springboot项目启动初始化数据缓存
  • 深度学习必备知识——模型数据集Yolo与Voc格式文件相互转化
  • 数据、数据资源及数据资产管理的区别
  • 标度不变性(scale invariance)与无标度(scale-free)概念辨析
  • WMS仓库管理系统解决方案,实现仓库管理一体化
  • css常见定位、居中方案_css定位居中
  • 【微信小程序】-- 自定义组件 -- 创建与引用 样式(三十二)
  • ArangoDB——AQL编辑器
  • Lesson 9.1 集成学习的三大关键领域、Bagging 方法的基本思想和 RandomForestRegressor 的实现
  • basic1.0链码部署(基于test-network 环境ubuntu20.04腾讯云)
  • Android---系统启动流程
  • 【网络】http协议
  • Thread::interrupted() 什么意思? 如何中断线程?
  • Oracle OCP 19c 考试(1Z0-083)中关于Oracle不完全恢复的考点(文末附录像)
  • 一起来学习配置Combo接口吧!
  • C++模拟实现红黑树
  • HTTPS协议之SSL/TLS详解(下)
  • OLE对象是什么?为什么要在CAD图形中插入OLE对象?
  • 【微信小程序】-- 自定义组件 -- 数据、方法和属性(三十三)
  • 【Spring 深入学习】AOP的前世今生之代理模式
  • 操作系统复试
  • 藏经阁(五)温湿度传感器 SHT3x-DIS 手册 解析
  • PCB焊盘设计基本原则
  • mysql锁分类大全
  • 推荐几款主流好用的远程终端连接管理软件
  • 描述性统计
  • 第十四届蓝桥杯三月真题刷题训练——第 7 天
  • 剑指 Offer 57. 和为s的两个数字
  • PDF转word在线转换方法!操作简单又高效