一个计算机技术爱好者与学习者

0%

问题描述

使用docker run启动一个beego服务,命令为:

1
docker run --name bservice -d -p 8080:8080 voidking/bservice:v1 "/bin/bash" "-c" "cd /opt/bservice && nohup ./bservice"

启动后,beego服务是容器内PID为1的前台进程。假设该服务不是那么健壮,出了bug会停止服务,那么容器也会随之停止。
如果想要服务停止后自动启动,那么就需要supervisor出马了。

阅读全文 »

前言

Python 2.6 is no longer supported by the Python core team, please upgrade your Python.

虽然Python2.6已经不再维护,但是CentOS6.8系统里默认的Python版本依然是2.6.6。
这就很尴尬了,要么凑合用,但是没有pip命令,常规安装pip的方法还会失败。要么进行升级,但是整个过程很麻烦。
本文记录一下2.6.6凑合用的方法,以及升级2.7.15的方法。

阅读全文 »

ldap简介

The LDAP(Lightweight Directory Access Protocol) is an open, vendor-neutral, industry standard application protocol for accessing and maintaining distributed directory information services over an Internet Protocol (IP) network. Directory services play an important role in developing intranet and Internet applications by allowing the sharing of information about users, systems, networks, services, and applications throughout the network. As examples, directory services may provide any organized set of records, often with a hierarchical structure, such as a corporate email directory. Similarly, a telephone directory is a list of subscribers with an address and a phone number.

简单来说,LDAP(轻量目录访问协议)是一个协议,用来解决多个系统的统一权限管理问题。

参考文档:

阅读全文 »

Redis集群模式简介

Redis集群是Redis的一种高可用解决方案,它通过在多个节点上分片存储数据,实现数据的高可用和扩展。Redis集群最初是在Redis 3.0版本中引入的。

Redis集群的节点由多个主节点和从节点组成,每个主节点都有多个从节点。集群中的每个节点都维护了整个集群的状态信息,节点之间通过Gossip协议进行通信,通过相互交换状态信息来保持集群中节点的一致性。Redis集群使用的哈希槽(hash slot)将键映射到不同的节点,实现了数据的分布式存储。

Redis集群的优点包括:

  • 高可用:当集群中的某个节点故障时,集群仍然可以正常运行。
  • 扩展性:Redis集群可以支持更多的数据和客户端请求,可以通过增加节点来实现横向扩展。
  • 分布式:Redis集群可以将数据分散在不同的节点上,使得数据的读写负载得到了平衡,提高了Redis的性能。

但是Redis集群也存在一些限制和注意事项,例如:

  • Redis集群只能支持单个数据库空间,不能在不同节点之间存储不同的数据库。
  • Redis集群不支持事务嵌套和 Lua 脚本中的事务操作。
  • Redis集群使用的是哈希槽分片,因此在集群运行过程中,不能动态添加或删除哈希槽,否则会导致数据的迁移,对集群性能产生影响。

在实际应用中,如果需要使用Redis集群,需要对集群中的节点进行适当的配置和调优,以确保集群的高可用性、性能和可靠性。

本节内容来自ChatGPT。

阅读全文 »