Python 第三方库之 Celery 分布式任务队列

一、Celery介绍和使用:

Celery 是一个 基于python开发的分布式异步消息任务队列,通过它可以轻松的实现任务的异步处理, 如果你的业务场景中需要用到异步任务,就可以考虑使用celery, 举几个实例场景中可用的例子:

  • 你想对100台机器执行一条批量命令,可能会花很长时间 ,但你不想让你的程序等着结果返回,而是给你返回 一个任务ID,你过一段时间只需要拿着这个任务id就可以拿到任务执行结果, 在任务执行ing进行时,你可以继续做其它的事情
  • 你想做一个定时任务,比如每天检测一下你们所有客户的资料,如果发现今天是客户的生日,就给他发个短信祝福

Celery 在执行任务时需要通过一个消息中间件来接收和发送任务消息,以及存储任务结果, 一般使用rabbitMQ or Redis

1.1Celery有以下优点:

  • 简单:一旦熟悉了celery的工作流程后,配置和使用还是比较简单的
  • 高可用:当任务执行失败或执行过程中发生连接中断,celery 会自动尝试重新执行任务
  • 快速:一个单进程的celery每分钟可处理上百万个任务
  • 灵活: 几乎celery的各个组件都可以被扩展及自定制

Celery基本工作流程图:

  • Producer:任务委托方
  • Broker:任务中心(中介),如RabbitMQ、Redis等1
  • Beat:任务调度器
  • Worker:任务执行者,可以有多个(分布式)
  • Result:任务中心的数据库,储存任务执行结果2
  • Backend:因为任务经由中介,而非直接委派到Worker手上,所以Producer并不知道任务被委派给了谁,以及任务的完成结果,所以这时候需要一个Backend(理解成手机,通过手机查看任务完成情况)
     

1.2 Celery安装使用

Celery的默认broker是RabbitMQ, 仅需配置一行就可以

broker_url = 'amqp://guest:guest@localhost:5672//'

rabbitMQ 没装的话请装一下,安装看这里

http://docs.celeryproject.org/en/latest/getting-started/brokers/rabbitmq.html#id3

使用Redis做broker也可以,安装redis组件

$ pip install -U "celery[redis]"

配置redis

# Configuration is easy, just configure the location of your Redis database:
app.conf.broker_url = 'redis://localhost:6379/0'# Where the URL is in the format of:
redis://:password@hostname:port/db_number# all fields after the scheme are optional, and will default to localhost on port 6379, using database 0.

如果想获取每个任务的执行结果,还需要配置一下把任务结果存在哪

# If you also want to store the state and return values of tasks in Redis, you should configure these settings:
app.conf.result_backend = 'redis://localhost:6379/0'

1. 3 使用Celery

安装celery模块

$ pip install celery

创建一个celery application 用来定义你的任务列表

创建一个任务文件tasks.py

from celery import Celeryapp = Celery('tasks',                     # 随便broker='redis://localhost',  # 中间件backend='redis://localhost') # 存储# 弱如果redis 有密码,改成下面的方式,password前面有冒号
# redis://:password@127.0.0.1:6379/2@app.task
def add(x,y):print("running...",x,y)return x+y

启动Celery Worker来开始监听并执行任务

$ celery -A tasks worker --loglevel=info

调用任务,再打开一个终端, 进行命令行模式,调用任务

[root@localhost celerys]# python3
Python 3.5.2 (default, Jul  7 2017, 23:36:01)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from tasks import add                   # import add
>>> add.delay(4,6)                          # 执行函数
<AsyncResult: 4b5a8ab6-693c-4ce5-b779-305cfcdf70cd>   # 返回taskid>>> result.ready()                          # 是否运行完成
False>>> result = add.delay(4,6)                 # 执行函数
>>> result.get()                            # 同步获取结果,一直等待
10>>> result.get(timeout=1)                   # 设置超时时间,过期错误异常
Traceback (most recent call last):--strip--
celery.exceptions.TimeoutError: The operation timed out.>>> result = add.delay(4,'a')               # 执行错误命令
>>> result.get()                            # get后获取到错误信息,触发异常
Traceback (most recent call last):--strip--
celery.backends.base.TypeError: unsupported operand type(s) for +: 'int' and 'str'>>> result = add.delay(4,'a')
>>> result.get(propagate=False)             # propagate=False 不触发异常,获取错误信息
TypeError("unsupported operand type(s) for +: 'int' and 'str'",)
>>> result.traceback                        # 获取具体错误信息 log打印用
'Traceback (most recent call last):\n  File "/usr/local/python3.5/lib/python3.5/site-packages/celery/app/trace.py", line 367, in trace_task\n    R = retval = fun(*args, **kwargs)\n  File "/usr/local/python3.5/lib/python3.5/site-packages/celery/app/trace.py", line 622, in __protected_call__\n    return self.run(*args, **kwargs)\n  File "/data/celerys/tasks.py", line 12, in add\n    return x+y\nTypeError: unsupported operand type(s) for +: \'int\' and \'str\'\n'

二、在项目中如何使用celery

可以把celery配置成一个应用,目录格式如下

proj/__init__.py/celery.py/tasks.py

proj/celery.py内容

from __future__ import absolute_import, unicode_literals
from celery import Celeryapp = Celery('proj',broker='amqp://',backend='amqp://',include=['proj.tasks'])# Optional configuration, see the application user guide.
app.conf.update(result_expires=3600,
)if __name__ == '__main__':app.start()

proj/tasks.py中的内容

from __future__ import absolute_import, unicode_literals
from .celery import app@app.task
def add(x, y):return x + y@app.task
def mul(x, y):return x * y@app.task
def xsum(numbers):return sum(numbers)

启动worker 

$ celery -A proj worker -l info

输出,像不像一个c

-------------- celery@Alexs-MacBook-Pro.local v4.0.2 (latentcall)
---- **** -----
--- * ***  * -- Darwin-15.6.0-x86_64-i386-64bit 2017-01-26 21:50:24
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app:         proj:0x103a020f0
- ** ---------- .> transport:   redis://localhost:6379//
- ** ---------- .> results:     redis://localhost/
- *** --- * --- .> concurrency: 8 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ------------------- [queues].> celery           exchange=celery(direct) key=celery

后台启动worker

In production you’ll want to run the worker in the background, this is described in detail in the daemonization tutorial.

The daemonization scripts uses the celery multi command to start one or more workers in the background:

$ celery multi start w1 -A proj -l info
celery multi v4.0.0 (latentcall)
> Starting nodes...> w1.halcyon.local: OK

You can restart it too:

$ celery  multi restart w1 -A proj -l info
celery multi v4.0.0 (latentcall)
> Stopping nodes...> w1.halcyon.local: TERM -> 64024
> Waiting for 1 node.....> w1.halcyon.local: OK
> Restarting node w1.halcyon.local: OK
celery multi v4.0.0 (latentcall)
> Stopping nodes...> w1.halcyon.local: TERM -> 64052

or stop it:

$ celery multi stop w1 -A proj -l info

The stop command is asynchronous so it won’t wait for the worker to shutdown. You’ll probably want to use the stopwait command instead, this ensures all currently executing tasks is completed before exiting:

$ celery multi stopwait w1 -A proj -l info

三、Celery 定时任务

celery支持定时任务,设定好任务的执行时间,celery就会定时自动帮你执行, 这个定时任务模块叫celery beat

写一个脚本periodic_task.py

from celery import Celery
from celery.schedules import crontabapp = Celery()@app.on_after_configure.connect
def setup_periodic_tasks(sender, **kwargs):# Calls test('hello') every 10 seconds.# add_periodic_task 会添加一条定时任务sender.add_periodic_task(10.0, test.s('hello'), name='add every 10')# Calls test('world') every 30 secondssender.add_periodic_task(30.0, test.s('world'), expires=10)# Executes every Monday morning at 7:30 a.m.sender.add_periodic_task(crontab(hour=7, minute=30, day_of_week=1),test.s('Happy Mondays!'),)@app.task
def test(arg):print(arg)

上面是通过调用函数添加定时任务,也可以像写配置文件 一样的形式添加, 下面是每30s执行的任务

app.conf.beat_schedule = {'add-every-30-seconds': {'task': 'tasks.add','schedule': 30.0,'args': (16, 16)},
}
app.conf.timezone = 'UTC'

任务添加好了,需要让celery单独启动一个进程来定时发起这些任务, 注意, 这里是发起任务,不是执行,这个进程只会不断的去检查你的任务计划, 每发现有任务需要执行了,就发起一个任务调用消息,交给celery worker去执行

启动任务调度器 celery beat

$ celery -A periodic_task beat

输出like below

celery beat v4.0.2 (latentcall) is starting.
__    -    ... __   -        _
LocalTime -> 2017-02-08 18:39:31
Configuration ->. broker -> redis://localhost:6379//. loader -> celery.loaders.app.AppLoader. scheduler -> celery.beat.PersistentScheduler. db -> celerybeat-schedule. logfile -> [stderr]@%WARNING. maxinterval -> 5.00 minutes (300s)

此时还差一步,就是还需要启动一个worker,负责执行celery beat发起的任务

启动celery worker来执行任务

$ celery -A periodic_task worker-------------- celery@Alexs-MacBook-Pro.local v4.0.2 (latentcall)
---- **** -----
--- * ***  * -- Darwin-15.6.0-x86_64-i386-64bit 2017-02-08 18:42:08
-- * - **** ---
- ** ---------- [config]
- ** ---------- .> app:         tasks:0x104d420b8
- ** ---------- .> transport:   redis://localhost:6379//
- ** ---------- .> results:     redis://localhost/
- *** --- * --- .> concurrency: 8 (prefork)
-- ******* ---- .> task events: OFF (enable -E to monitor tasks in this worker)
--- ***** ------------------- [queues].> celery           exchange=celery(direct) key=celery

此时观察worker的输出,是不是每隔一小会,就会执行一次定时任务呢!

# Beat needs to store the last run times of the tasks in a local database file (named celerybeat-schedule by default), so it needs access to write in the current directory, or alternatively you can specify a custom location for this file:
# beat需要将任务的最后运行时间存储在本地数据库文件中(默认情况下名为celerybeat schedule),自定义 
$ celery -A periodic_task beat -s /home/celery/var/run/celerybeat-schedule

更复杂的定时配置

上面的定时任务比较简单,只是每多少s执行一个任务,但如果你想要每周一三五的早上8点给你发邮件怎么办呢?哈,其实也简单,用crontab功能,跟linux自带的crontab功能是一样的,可以个性化定制任务执行时间

linux crontab http://www.cnblogs.com/peida/archive/2013/01/08/2850483.html 

from celery.schedules import crontabapp.conf.beat_schedule = {# Executes every Monday morning at 7:30 a.m.'add-every-monday-morning': {   # 给任务起个名字'task': 'tasks.add',        # 任务调用的函数'schedule': crontab(hour=7, minute=30, day_of_week=1),   # 定时任务'args': (16, 16),           # 任务调用的参数},
}

上面的这条意思是每周1的早上7.30执行tasks.add任务。还有更多定时配置方式如下:

ExampleMeaning
crontab()Execute every minute.
crontab(minute=0, hour=0)Execute daily at midnight.
crontab(minute=0, hour='*/3')Execute every three hours: midnight, 3am, 6am, 9am, noon, 3pm, 6pm, 9pm.
crontab(minute=0,hour='0,3,6,9,12,15,18,21')Same as previous.
crontab(minute='*/15')Execute every 15 minutes.
crontab(day_of_week='sunday')Execute every minute (!) at Sundays.
crontab(minute='*',
hour='*',day_of_week='sun')
Same as previous.
crontab(minute='*/10',
hour='3,17,22',day_of_week='thu,fri')
Execute every ten minutes, but only between 3-4 am, 5-6 pm, and 10-11 pm on Thursdays or Fridays.
crontab(minute=0,hour='*/2,*/3')Execute every even hour, and every hour divisible by three. This means: at every hour except: 1am, 5am, 7am, 11am, 1pm, 5pm, 7pm, 11pm
crontab(minute=0, hour='*/5')Execute hour divisible by 5. This means that it is triggered at 3pm, not 5pm (since 3pm equals the 24-hour clock value of “15”, which is divisible by 5).
crontab(minute=0, hour='*/3,8-17')Execute every hour divisible by 3, and every hour during office hours (8am-5pm).
crontab(0, 0,day_of_month='2')Execute on the second day of every month.
crontab(0, 0,day_of_month='2-30/3')Execute on every even numbered day.
crontab(0, 0,day_of_month='1-7,15-21')Execute on the first and third weeks of the month.
crontab(0, 0,day_of_month='11',month_of_year='5')Execute on the eleventh of May every year.
crontab(0, 0,month_of_year='*/3')Execute on the first month of every quarter.

上面能满足你绝大多数定时任务需求了,甚至还能根据潮起潮落来配置定时任务, 具体看 http://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html#solar-schedules

四、最佳实践之与django结合

django 可以轻松跟celery结合实现异步任务,只需简单配置即可。If you have a modern Django project layout like:

- proj/- proj/__init__.py- proj/settings.py- proj/urls.py
- manage.py

then the recommended way is to create a new proj/proj/celery.py module that defines the Celery instance:

file: proj/proj/celery.py  

from __future__ import absolute_import, unicode_literals
import os
from celery import Celery# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings')app = Celery('proj')# Using a string here means the worker don't have to serialize
# the configuration object to child processes.
# - namespace='CELERY' means all celery-related configuration keys
#   should have a `CELERY_` prefix.
app.config_from_object('django.conf:settings', namespace='CELERY')# Load task modules from all registered Django app configs.
app.autodiscover_tasks()@app.task(bind=True)
def debug_task(self):print('Request: {0!r}'.format(self.request))

Then you need to import this app in your proj/proj/__init__.py module. This ensures that the app is loaded when Django starts so that the @shared_task decorator (mentioned later) will use it:

proj/proj/__init__.py:

from __future__ import absolute_import, unicode_literals  # 绝对导入# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app__all__ = ['celery_app']

Note that this example project layout is suitable for larger projects, for simple projects you may use a single contained module that defines both the app and tasks, like in the First Steps with Celery tutorial.

Let’s break down what happens in the first module, first we import absolute imports from the future, so that our celery.py module won’t clash with the library:

from __future__ import absolute_import   # 绝对导入

Then we set the default DJANGO_SETTINGS_MODULE environment variable for the celery command-line program:

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'proj.settings')  # 设置环境

You don’t need this line, but it saves you from always passing in the settings module to the celery program. It must always come before creating the app instances, as is what we do next:

app = Celery('proj')

This is our instance of the library.

We also add the Django settings module as a configuration source for Celery. This means that you don’t have to use multiple configuration files, and instead configure Celery directly from the Django settings; but you can also separate them if wanted.

The uppercase name-space means that all Celery configuration options must be specified in uppercase instead of lowercase, and start with CELERY_, so for example the task_always_eager` setting becomes CELERY_TASK_ALWAYS_EAGER, and the broker_url setting becomes CELERY_BROKER_URL.

You can pass the object directly here, but using a string is better since then the worker doesn’t have to serialize the object.

app.config_from_object('django.conf:settings', namespace='CELERY')

Next, a common practice for reusable apps is to define all tasks in a separate tasks.pymodule, and Celery does have a way to  auto-discover these modules:

app.autodiscover_tasks()

With the line above Celery will automatically discover tasks from all of your installed apps, following the tasks.py convention:

celery 会自动发现目录下的所有task

- app1/- tasks.py- models.py
- app2/- tasks.py- models.py

Finally, the debug_task example is a task that dumps its own request information. This is using the new bind=True task option introduced in Celery 3.1 to easily refer to the current task instance.

然后在具体的app里的tasks.py里写你的任务

# Create your tasks here
from __future__ import absolute_import, unicode_literals
from celery import shared_task@shared_task
def add(x, y):return x + y@shared_task
def mul(x, y):return x * y@shared_task
def xsum(numbers):return sum(numbers)

在你的django views里调用celery task

from django.shortcuts import render,HttpResponse# Create your views here.from  bernard import tasksdef task_test(request):res = tasks.add.delay(228,24)print("start running task")print("async task res",res.get() )return HttpResponse('res %s'%res.get())

五、在django中使用计划任务功能

There’s  the django-celery-beat extension that stores the schedule in the Django database, and presents a convenient admin interface to manage periodic tasks at runtime.

To install and use this extension:

Use pip to install the package:

$ pip install django-celery-beat

Add the django_celery_beat module to INSTALLED_APPS in your Django project’ settings.py:

    INSTALLED_APPS = (...,'django_celery_beat',)Note that there is no dash in the module name, only underscores.

Apply Django database migrations so that the necessary tables are created:

$ python manage.py migrate

Start the celery beat service using the django scheduler:

$ celery -A proj beat -l info -S django

Visit the Django-Admin interface to set up some periodic tasks.

在admin页面里,有3张表

配置完长这样

 

此时启动你的celery beat 和worker,会发现每隔2分钟,beat会发起一个任务消息让worker执行scp_task任务

注意,经测试,每添加或修改一个任务,celery beat都需要重启一次,要不然新的配置不会被celery beat进程读到

文章链接https://www.cnblogs.com/alex3714/p/6351797.html

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/454559.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

windows server 2008 (五)web服务器的搭建和部署

Windows server 2008 web服务器的搭建和部署相对于windows server 2003的IIS6来说&#xff0c;windows server 2008推出的IIS7.0为管理员提供了统一的web平台&#xff0c;为管理员和开发人员提供了一个一致的web解决方案。并针对安全方面做了改进&#xff0c;可以减少利用自定义…

改装摩托车

摩托车发动机就是将进入气缸中的燃料混合气点燃使其燃烧所产生的热能变为机械能&#xff0c;并由曲轴将动力通过传动机构传给摩托车后轮而变为车辆行驶动力的机械。发动机的进排气量和气流速是影响高转速&#xff08;功率&#xff09;输出的关键因素之一。 发动机工作时气流的路…

华为鸿蒙os logo,华为鸿蒙OS Logo曝光:Powered by HarmonyOS

IT之家 9 月 13 日消息 9 月 10 日&#xff0c;鸿蒙 OS 2.0 亮相华为开发者大会的主舞台上&#xff0c;华为常务董事、消费者业务 CEO 余承东表示&#xff0c;鸿蒙 OS 是首个真正为全场景时代打造的分布式操作系统&#xff0c;鸿蒙 OS 2.0 全面使能全场景生态。现在博主 勇气数…

python判断语句_详解Python判断语句的使用方法

本篇介绍Python判断语句的使用&#xff0c;主要讨论简单条件语句、多重条件语句和嵌套条件语句&#xff0c;在讲解的每个案例中都配有流程图和代码说明。通过本篇的学习&#xff0c;可以达成如下目标。 ● 掌握判断语句的使用规则 ● 判断语句流程图的画法 前面我们学习了Pytho…

js setTimeout 使用方法

在项目过程中遇到一些异步加载和其他js方法冲突的问题&#xff1a; 如图初始化的时候会加载“商户基本信息”,修改商户名称字段第二个页面也需要修改&#xff1a; function setSeqAndName(){var pritab2 $("#allTabs").tabs("getTab", 1).find("ifra…

机器学习算法之 logistic、Softmax 回归

逻辑回归本质是分类问题&#xff0c;而且是二分类问题&#xff0c;不属于回归&#xff0c;但是为什么又叫回归呢。我们可以这样理解&#xff0c;逻辑回归就是用回归的办法来做分类。它是在线性回归的基础上&#xff0c;通过Sigmoid函数进行了非线性转换&#xff0c;从而具有更强…

程序员成功之路

程序员成功之路 ——The road ahead for programmer&#xff08;演讲稿&#xff09; 一、我很羡慕在座的各位同学&#xff0c;因为你们是中国未来的程序员&#xff0c;而我不是&#xff0c;我一直很遗憾。 比尔盖茨曾经写过一本书叫做《未来之路》The road ahead, 那么今天我选…

部署egg需要用到pm2吗_使用宝塔面板部署校园综合服务平台项目

本文档为校园综合服务平台服务端的安装部署教程&#xff0c;欢迎star小程序端下载地址&#xff1a;https://github.com/landalfYao/help.git后台服务端下载地址&#xff1a;https://github.com/landalfYao/helpserver.git后台客户端下载地址&#xff1a;https://github.com/lan…

机器学习算法之线性回归

一、什么是回归算法 回归算法是一种有监督算法 回归算法是一种比较常用的机器学习算法&#xff0c;用来建立“解释”变量(自变量X)和观测值(因变量Y)之间的关系&#xff1b;从机器学习的角度来讲&#xff0c;用于构建一个算法模型(函数)来做属性(X)与标签(Y)之间的映射关系&a…

Console-算法[for]-国王与老人的六十四格

ylbtech-Arithmetic:Console-算法[for]-国王与老人的六十四格1.A&#xff0c;案例-- -- ylb&#xff1a;算法-- Type:算法[for]-- munu:国王与老人的六十四格-- 20:32 2012/3/16-- 案例&#xff1a;印度有个国王&#xff0c;他拥有超人的权力和巨大的财富。但权力和财富最终让他…

在OOW2009上寻宝撞大运续(床上篇)

历时5天的Oracle Open World 2009终于&#xff0c;终于结束了。今天最后的节目是去听一场金融分析师的会议&#xff0c;“只”开了不到6个钟。去的时候是毛毛雨&#xff0c;回来的时候终于看到了一缕阳光。说夕阳无限好不大合适。用Larry Ellison的说法是“太阳落下的地方也是太…

特征图注意力_从数据结构到算法:图网络方法初探

作者 | 朱梓豪来源 | 机器之心原文 | 从数据结构到算法&#xff1a;图网络方法初探如果说 2019 年机器学习领域什么方向最火&#xff0c;那么必然有图神经网络的一席之地。其实早在很多年前&#xff0c;图神经网络就以图嵌入、图表示学习、网络嵌入等别名呈现出来&#xff0c;其…

FFMPEG 源码分析

FFMPEG基本概念&#xff1a; ffmpeg是一个开源的编解码框架&#xff0c;它提供了一个音视频录制&#xff0c;解码和编码库。FFMPEG是在linux下开发的&#xff0c;但也有windows下的编译版本。 ffmpeg项目由以下几部分组成: ffmpeg 视频文件转换命令行工具,也支持经过实时电视…

面试之 Redis汇总

简介 Redis 持久化机制 RDB&#xff08;Redis DataBase&#xff09; AOF&#xff08;Append-only file&#xff09; Redis 4.0 对于持久化机制的优化 补充&#xff1a;AOF 重写 二者的区别 二者优缺点 Memcache与Redis的区别都有哪些&#xff1f; 缓存雪崩、缓存穿透、…

Oracle 10g 问题集锦

监听服务中Oracle数据库之中使用最主要的一个服务&#xff0c;但是这个服务经常会出现错误&#xff0c;包括以后在工作之中此服务也会出现错误&#xff0c;故给出两种常见错误的解决方案&#xff08;故障1、故障2&#xff09; 故障1: 注册表使用了优化软件&#xff08;如&#…

iOS linker command failed with exit code 1 (use -v to see invocation)多种解决方案汇总

有时可能会遇到这种错误&#xff0c;关键是这种错误&#xff0c;有时只有这一句话&#xff0c;也不会给更多错误信息。 网上找了一些&#xff0c;总结了如下&#xff1a;&#xff08;PS&#xff1a;以下是按照解决简易程度排序&#xff0c;不代表出现概率&#xff09; 1、bitco…

面试之 Mysql 汇总

事务相关 什么是事务&#xff1f; 事务&#xff1a;是由一组SQL语句组成的逻辑处理单元&#xff0c;事务具有以下4个属性&#xff0c;通常简称为事务。事务的ACID属性&#xff1a; &#xff08;1&#xff09;原子性&#xff08;Atomicity&#xff09;&#xff1a;   事务是一…

Exchange Server 2003 部署手册

1. 环境需求服务器: 域控制器1台; Exchange Server服务器1台。 IP和机器名配置&#xff1a; 域控制器&#xff1a;机器名&#xff1a;dc IP&#xff1a; 10.10.10.200 掩码&#xff1a;255.255.255.0 网关&#xff1a;10.10.10.254 DNS&#xff1a;127.0.0.1 Exchange&#xff…

html浏览器的区别是什么意思,不同浏览器对css的识别有区别吗?

不同浏览器对css的识别是有区别&#xff0c;因此针对不同的浏览器去写不同的CSS。下面本篇文章给大家介绍一些常用CSS书写技巧(不同浏览器之间的差异)。有一定的参考价值&#xff0c;有需要的朋友可以参考一下&#xff0c;希望对大家有所帮助。不同的浏览器&#xff0c;比如Int…

面试之 Python 进阶

前端相关 1.谈谈你对http协议的认识。 浏览器本质&#xff0c;socket客户端遵循Http协议   HTTP协议本质&#xff1a;通过\r\n分割的规范 请求响应之后断开链接 > 无状态、 短连接 具体&#xff1a;   Http协议是建立在tcp之上的&#xff0c;是一种规范&#xff0c;它…