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

怎样用php做动态网站西安百度竞价开户

怎样用php做动态网站,西安百度竞价开户,网站源码模块,asp.net网站运行助手小伙伴们好,欢迎关注,一起学习,无限进步 Redis安装和配置 1、首先在官网下载好redis-6.0.9.tar.gzhttp://redis.io/ 或者使用 wget 命令下载:wget http://download.redis.io/releases/redis-6.0.9.tar.gz 2、下载使用上传到阿里…

小伙伴们好,欢迎关注,一起学习,无限进步

Redis安装和配置

1、首先在官网下载好redis-6.0.9.tar.gzhttp://redis.io/

或者使用 wget 命令下载:wget http://download.redis.io/releases/redis-6.0.9.tar.gz

2、下载使用上传到阿里云

在这里插入图片描述

3、进入到 /usr/localhost/java/ 目录,开始解压安装

tar -zxvf redis-6.0.9.tar.gz#进入到redis-6.0.9目录执行make命令
make
#注意:这里执行make的时候可能会报错,这是可能没有gcc的原因,需要安装,命令为
yum install gcc-c++#再次执行make命令,执行时先清除上次没安装成功的一些make内容
make distclean
make 
make install#注意:这里gcc版本过低,也会导致安装不成功#查看gcc版本
gcc -v  
#升级gcc版本,依次执行已下命令升级gcc
yum -y install centos-release-scl
yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils
#以上为临时使用,需要长期使用需要执行一下命令
echo "source /opt/rh/devtoolset-9/enable" >>/etc/profile

4、安装完成之后会默认在/usr/local/bin下生成一下redis的可执行文件,为了方便可以在 redis-6.0.9 建一个 bin 目录,把 redis 这些可执行文件都放到bin目录下,方便执行。

在这里插入图片描述

执行./redis-server命令

出现 Ready to accept connections,说明已经启动成功

在这里插入图片描述

5、连接redis执行./redis-cli

在这里插入图片描述

6、这时redis已经安装成功,我们来进行设置redis.conf配置文件:

  • redis 默认是本机访问,其他地方无法连接,需要把这个注释掉#bind 127.0.0.1改成bind 0.0.0.0

    在这里插入图片描述

  • 设置后台启动 redis 服务 设置为 yes

在这里插入图片描述

  • 执行后台启动./redis-server redis.conf

在这里插入图片描述

  • 这是 redis 持久化默认为 no,需要改为 yes

在这里插入图片描述

  • redis远程连接后,输入命令出现 Error:Server closed the connection,不需要登陆密码,改为no

在这里插入图片描述

#常用命令
#后台启动的两种方式
./redis-server redis.conf 
nohup ./redis-server redis.conf &
nohup ./redis-server  redis.conf  >> /usr/local/java/redis-6.0.9/logs/redis.log  2>&1 &
#后台验证redis是否在启动
ps -ef |grep redis 或 ps aux | grep redis
#查看端口是否在监听
netstat -lntp | grep 6379
#关闭客户端
redis-cli shutdown
  • Redis 持久化报错
redis.exceptions.ResponseError: MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.
#将stop-writes-on-bgsave-error设置为no
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
或者进入redis.conf改no

在这里插入图片描述

  • 注意:如果 redis 不设置登录密码在服务器上会出现key丢失情况,设置密码
    在这里插入图片描述

  • 在 redis 中所有的 key 都变成 backup 是因为 redis 暴漏在公网ip下,没有设置密码,遭到恶意请求

在这里插入图片描述

  • 如果出现一下错误修改 protected-mode yes 改为:protected-mode no,密码太短也有可能会出现这个问题
org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 192.168.43.129:6379at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:132)at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:95)at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:82)at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:211)at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184)at org.springframework.data.redis.core.AbstractOperations.execute(AbstractOperations.java:95)at org.springframework.data.redis.core.DefaultValueOperations.set(DefaultValueOperations.java:198)at com.leyou.test.RedisTest.testRedis(RedisTest.java:25)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)at org.junit.runners.ParentRunner.run(ParentRunner.java:363)at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)at org.junit.runner.JUnitCore.run(JUnitCore.java:137)at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: io.lettuce.core.RedisConnectionException: Unable to connect to 192.168.43.129:6379at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:56)at io.lettuce.core.AbstractRedisClient.getConnection(AbstractRedisClient.java:233)at io.lettuce.core.RedisClient.connectStandalone(RedisClient.java:253)at io.lettuce.core.RedisClient.connect(RedisClient.java:202)at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.getConnection(StandaloneConnectionProvider.java:56)at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:959)... 41 more

Redis Docker 安装测试

docker 安装详细说明:链接

docker 官方文档安装方式:https://hub.docker.com/_/redis

redis.conf 配置文件修改

# 将bind 127.0.0.1 -::1修改为 bind 0.0.0.0,监听来自任意网络接口的连接。
bind 0.0.0.0# 将protected-mode设置为no,关闭保护模式,接收远程连接。
protected-mode no# appendonly 设置为yes redis持久化
appendonly yes# 将requirepass设置为 adminer,客户端连接到节点的认证密码
requirepass 123456

启动命令

# 拉取最新镜像
docker pull redis:latest
# 启动
docker run --name myredis -p6379:6379 --restart=always -d redis:latest --requirepass "test123456"
# redis 使用命令行设置密码和持久化方式
docker run --name myredis -v /data/redis/data:/data \
-p 6379:6379 -d redis:latest --requirepass "test123456" --appendonly yes # 指定配置文件启动 如果要挂载配置文件,先把提前准备好的 redis.conf 配置文件放到 /data/redis/conf 目录下(或者先启动一个 redis 镜像,把容器内的配置文件复制到容器外部)
docker cp myredis:/etc/redis/redis.conf /data/redis/conf/redis.confdocker run --name myredis -v /data/redis/conf/redis.conf:/etc/redis/redis.conf \
-v /data/redis/data:/data -p 6379:6379 --restart=always -d redis:latest redis-server /etc/redis/redis.conf --requirepass "123456" --appendonly yes # redis 使用自定义配置方式启动,如果要修改配置文件直接修改
docker run --name myredis \
-v /data/redis/conf/redis.conf:/etc/redis/redis.conf \
-v /data/redis/data:/data -p 6379:6379 -d redis:latest redis-server /etc/redis/redis.conf 
http://www.mnyf.cn/news/44109.html

相关文章:

  • 国内外网站开发技术有哪些网络营销的主要手段
  • 有哪些做鸭子网站联合早报 即时消息
  • 网站视频是什么软件做的站长工具seo综合查询广告
  • b s架构网站开发seo的公司排名
  • 万寿路网站建设会计培训班一般多少钱
  • 沈阳建设工程交易中心windows10优化软件
  • 自已的电脑怎么做网站网站源码
  • 网站建设综合中国科技新闻网
  • 个人做网站怎么盈利湖北最新消息
  • 合肥网站建站小红书kol推广
  • 局域网内部如何做网站国际要闻
  • 婚庆网站名字品牌推广策略有哪几种
  • 鹤壁专业做网站公司蚌埠seo外包
  • 阿里巴巴网站推广怎么做自己怎样开网站
  • wordpress直接访问站点软文广告示范
  • 做ppt的兼职网站深圳seo推广
  • mini主机做网站服务器国内网络营销公司排名
  • 大连模板网站制作公司电话电商平台怎么推广
  • 网站建设工作室需要哪些设备搜索引擎排名机制
  • 制作彩票网站需要多少钱西安区seo搜索排名优化
  • 网站建设专业团队竞价排名广告
  • 修改网站图片西安seo和网络推广
  • 蚌埠企业网站建设会计培训班的费用是多少
  • 八年级信息所用软件做网站外包
  • 在线考试系统网站开发全自动引流推广软件
  • 甘肃省住房和城乡建设厅执业资格注册中心网站b站推广网站入口
  • 网页制作素材打包下载北京seo顾问
  • 你的安全设置不允许网站2024年8月爆发新的大流行病毒吗
  • app找什么公司seo的课谁讲的好
  • 美食网站网页设计东莞市网络营销公司