推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
xoxoj
V2EX  ›  Python

服务器之间传输数据的问题。

  •  
  •   xoxoj · Jun 10, 2015 · 3609 views
    This topic created in 4014 days ago, the information mentioned may be changed or developed.

    大家好,现在有这么一个业务需求,A(IP:218.13.221.160)服务器是主服务器,用户注册都是通过这个服务器进行注册的,然后我需要把用户的注册信息,传给B(IP:218.33.122.132)服务器、C(IP:218.33.122.133)服务器、D(IP:218.33.122.134)服务器...、H服务器...,这些服务器需要把收到的数据写入到本机的数据库里去,例如B服务器收到数据库后,就需要把收到的数据,写入到本地的Redis活着Mysql数据库里去。

    请问像这样的业务该如何设计实现比较好。

    8 replies    2015-06-11 11:08:01 +08:00
    justfly
        1
    justfly  
       Jun 10, 2015
    消息队列咯
    momo1999
        2
    momo1999  
       Jun 10, 2015
    zeromq特别简单
    jnduan
        3
    jnduan  
       Jun 10, 2015
    MQ+1
    fangjinmin
        4
    fangjinmin  
       Jun 10, 2015
    做redis和mysql的replication不就行了?
    whahugao
        5
    whahugao  
       Jun 10, 2015
    表结构一样 就直接主从库好了。
    需要中途修改加工,用消息队列咯。
    xoxoj
        6
    xoxoj  
    OP
       Jun 10, 2015
    恕小弟愚钝,别直接说消息队列,能说说具体实现的过程,我想知道,我该怎么做?
    xionghengheng
        7
    xionghengheng  
       Jun 10, 2015
    有个简单的方法,主服务器每来一条记录(用户注册信息),直接写到本地文件里,然后用类似scp,wget之类的命令,把文件分发到各个服务器即可,接着写个脚本解析文件然后写数据库就ok
    ps 不知道利不利于维护
    repus911
        8
    repus911  
       Jun 11, 2015
    注册信息?session?还是说用户在一个你每个服务器自己一个数据库需要数据同步?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   876 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 38ms · UTC 21:59 · PVG 05:59 · LAX 14:59 · JFK 17:59
    ♥ Do have faith in what you're doing.