Falsk session 源碼解析

Falsk框架session請求流程

from?flask?import?Flask

# 1. 實例化Flask對象
app?=?Flask(__name__)

# 2. 設置路由
@app.route('/index')
def?index():
????return?"index"

if?__name__?==?'__main__':
????# 3. 啟動socket服務端
????app.run()
????# 4. 用戶請求到來
????app.__call__
????app.wsgi_app
????app.request_class
????app.session_interface

請求進來之后走run,run最后執行的是run_simple(host, port, self, **options)

####### app.py 文件下的 class Flask(_PackageBoundObject) 下的 def?run ######
### 最后執行了run_simple(host, port, self, **options)
def run(self, host=None, port=None, debug=None,
? ? ? ? load_dotenv=True, **options):
? ??
? ? # Change this into a no-op if the server is invoked from the
? ? # command line. Have a look at cli.py for more information.
? ? if os.environ.get('FLASK_RUN_FROM_CLI') == 'true':
? ? ? ? from .debughelpers import explain_ignored_app_run
? ? ? ? explain_ignored_app_run()
? ? ? ? return

? ? if get_load_dotenv(load_dotenv):
? ? ? ? cli.load_dotenv()

? ? ? ? # if set, let env vars override previous values
? ? ? ? if 'FLASK_ENV' in os.environ:
? ? ? ? ? ? self.env = get_env()
? ? ? ? ? ? self.debug = get_debug_flag()
? ? ? ? elif 'FLASK_DEBUG' in os.environ:
? ? ? ? ? ? self.debug = get_debug_flag()

? ? # debug passed to method overrides all other sources
? ? if debug is not None:
? ? ? ? self.debug = bool(debug)

? ? _host = '127.0.0.1'
? ? _port = 5000
? ? server_name = self.config.get('SERVER_NAME')
? ? sn_host, sn_port = None, None

? ? if server_name:
? ? ? ? sn_host, _, sn_port = server_name.partition(':')

? ? host = host or sn_host or _host
? ? port = int(port or sn_port or _port)

? ? options.setdefault('use_reloader', self.debug)
? ? options.setdefault('use_debugger', self.debug)
? ? options.setdefault('threaded', True)

? ? cli.show_server_banner(self.env, self.debug, self.name, False)

? ? from werkzeug.serving import run_simple

? ? try:
? ? ? ? run_simple(host, port, self, **options)
? ? finally:
? ? ? ? # reset the first request information if the development server
? ? ? ? # reset normally. ?This makes it possible to restart the server
? ? ? ? # without reloader and that stuff from an interactive shell.
? ? ? ? self._got_first_request = False

werkzeug源碼講到,執行run_simple 方法,其實就是 當請求來時 最后會調用第三個參數加括號執行,即執行self的 __call__ 方法

參考:https://blog.csdn.net/fenglepeng/article/details/104676817

請求到來

當請求到來,執行__call__方法。看一下源碼。

####### app.py 文件下的 class Flask(_PackageBoundObject) 下的 ?def?__call__ ######
## 最后執行self.wsgi_app(environ, start_response)
def?__call__(self, environ, start_response):
????"""The WSGI server calls the Flask application object as the
????WSGI application. This calls :meth:`wsgi_app` which can be
????wrapped to applying middleware."""
????
? ? # environ:請求相關的所有數據,wsgi將原生的請求做第一步處理,把字符串分割。(wsgi做了初步封裝)
????# start_response:用于設置響應相關的所有數據。
????return?self.wsgi_app(environ, start_response)

點開?wsgi_app

####### app.py 文件下的 class Flask(_PackageBoundObject) 下的 def?wsgi_app ######
# 這個文件是Flask的整個執行流程的入口
def?wsgi_app(self, environ, start_response):
??????'''
??????1、獲取environ并對其進行再次封裝。就成了我們要的request;并獲取session值,此時為空,獲取self,封裝成app
? ? ? ? ? ?兩個東西app_ctx,request_ctx?放到“某個神奇”的地方。ctx.request = Request(environ) ?ctx.session = None ctx.app=app
??????'''
??????ctx?=?self.request_context(environ)??# 實際執行ctx = RequestContext(self, environ)

??????error?=?None
??????try:
??????????try:
? ? ? ? ? ? ? # 2、把app_ctx,request_ctx?放到“某個神奇”的地方。對于session來說,執行SecureCookieSessionInterface.open_session(),去cookie中獲取session的值,反序列化解密之后給ctx.session重新賦值(默認session的值存在cookie中)。
??????????????ctx.push()

??????????????# 3、執行視圖函數,然后去‘某個神奇’的地方獲取session,加密,序列化,寫入cookie
??????????????response?=?self.full_dispatch_request()

???????????except?Exception as e:
??????????????error?=?e
??????????????response?=?self.handle_exception(e)
??????????except:
??????????????error?=?sys.exc_info()[1]
??????????????raise
??????????return?response(environ, start_response)
??????finally:
??????????if?self.should_ignore_error(error):
??????????????error?=?None

??????????# 4、“某個神奇”的地方位置清空 (請求結束)
??????????ctx.auto_pop(error)

1 、首先查看 request_context 函數

####### app.py 文件下的 class Flask(_PackageBoundObject) 下的 def request_context ######
def request_context(self, environ): ?# self 是app,即Flask的實例化
? ? return RequestContext(self, environ)

RequestContext把我們的對象和請求封裝到了一個類。我們對這個類進行實例化,看一下做了什么事?

####### ctx.py 文件下的 class RequestContext(Object) 下的 def __init__ ######

class RequestContext(object):
? ? """The request context contains all request relevant information. ?It is
? ? created at the beginning of the request and pushed to the
? ? `_request_ctx_stack` and removed at the end of it. ?It will create the
? ? URL adapter and request object for the WSGI environment provided.
? ? """

? ? def __init__(self, app, environ, request=None):
? ? ? ? self.app = app? # 對app進行封裝
? ? ? ? if request is None:??# 對environ進行第二次封裝,封裝成一個Request對象
? ? ? ? ? ? request = app.request_class(environ) ?#?request_class = Request ?實際執行為 request = Request(environ)

? ? ? ? self.request = request
? ? ? ? self.url_adapter = app.create_url_adapter(self.request)
? ? ????self.flashes = None
???? ? ?self.session = None?? ?# 為session 賦值 None
???? ? ?self._implicit_app_ctx_stack = []
???? ? ?self.preserved = False
???? ? ?self._preserved_exc = None
???? ? ?self._after_request_functions = []
???? ? ?self.match_request()

? ? def match_request(self):
? ? ? ? """Can be overridden by a subclass to hook into the matching
? ? ? ? of the request.
? ? ? ? """
? ? ? ? try:
? ? ? ? ? ? url_rule, self.request.view_args = \
? ? ? ? ? ? ? ? self.url_adapter.match(return_rule=True)
? ? ? ? ? ? self.request.url_rule = url_rule
? ? ? ? except HTTPException as e:
? ? ? ? ? ? self.request.routing_exception = e

? ? def push(self):? ? # 點開ctx.push(),實際執行這里
? ? ? ? """Binds the request context to the current context."""
? ? ? ? # If an exception occurs in debug mode or if context preservation is
? ? ? ? # activated under exception situations exactly one context stays
? ? ? ? # on the stack. ?The rationale is that you want to access that
? ? ? ? # information under debug situations. ?However if someone forgets to
? ? ? ? # pop that context again we want to make sure that on the next push
? ? ? ? # it's invalidated, otherwise we run at risk that something leaks
? ? ? ? # memory. ?This is usually only a problem in test suite since this
? ? ? ? # functionality is not active in production environments.
? ? ? ? top = _request_ctx_stack.top
? ? ? ? if top is not None and top.preserved:
? ? ? ? ? ? top.pop(top._preserved_exc)

? ? ? ? # Before we push the request context we have to ensure that there
? ? ? ? # is an application context.
? ? ? ? app_ctx = _app_ctx_stack.top
? ? ? ? if app_ctx is None or app_ctx.app != self.app:
? ? ? ? ? ? app_ctx = self.app.app_context()
? ? ? ? ? ? app_ctx.push()
? ? ? ? ? ? self._implicit_app_ctx_stack.append(app_ctx)
? ? ? ? else:
? ? ? ? ? ? self._implicit_app_ctx_stack.append(None)

? ? ? ? if hasattr(sys, "exc_clear"):
? ? ? ? ? ? sys.exc_clear()

? ? ? ? _request_ctx_stack.push(self)

? ? ? ? # Open the session at the moment that the request context is available.
? ? ? ? # This allows a custom open_session method to use the request context.
? ? ? ? # Only open a new session if this is the first time the request was
? ? ? ? # pushed, otherwise stream_with_context loses the session.
? ? ? ? # 這里這里
? ? ? ? # 當請求進來時,session 肯定為空,因為上面設置的是空。Flask的session加密,序列化之后保存在cookie中

? ? ? ? if self.session is None:
? ? ? ? ? ? session_interface = self.app.session_interface
? ? ? ? ? ? self.session = session_interface.open_session(self.app, self.request)

? ? ? ? ? ? if self.session is None:
? ? ? ? ? ? ? ? self.session = session_interface.make_null_session(self.app)

? ? ? ? if self.url_adapter is not None:
? ? ? ? ? ? self.match_request()

? ? def pop(self, exc=_sentinel):
? ? ? ? """Pops the request context and unbinds it by doing that. ?This will
? ? ? ? also trigger the execution of functions registered by the
? ? ? ? :meth:`~flask.Flask.teardown_request` decorator.

? ? ? ? .. versionchanged:: 0.9
? ? ? ? ? ?Added the `exc` argument.
? ? ? ? """
? ? ? ? app_ctx = self._implicit_app_ctx_stack.pop()

? ? ? ? try:
? ? ? ? ? ? clear_request = False
? ? ? ? ? ? if not self._implicit_app_ctx_stack:
? ? ? ? ? ? ? ? self.preserved = False
? ? ? ? ? ? ? ? self._preserved_exc = None
? ? ? ? ? ? ? ? if exc is _sentinel:
? ? ? ? ? ? ? ? ? ? exc = sys.exc_info()[1]
? ? ? ? ? ? ? ? self.app.do_teardown_request(exc)

? ? ? ? ? ? ? ? # If this interpreter supports clearing the exception information
? ? ? ? ? ? ? ? # we do that now. ?This will only go into effect on Python 2.x,
? ? ? ? ? ? ? ? # on 3.x it disappears automatically at the end of the exception
? ? ? ? ? ? ? ? # stack.
? ? ? ? ? ? ? ? if hasattr(sys, "exc_clear"):
? ? ? ? ? ? ? ? ? ? sys.exc_clear()

? ? ? ? ? ? ? ? request_close = getattr(self.request, "close", None)
? ? ? ? ? ? ? ? if request_close is not None:
? ? ? ? ? ? ? ? ? ? request_close()
? ? ? ? ? ? ? ? clear_request = True
? ? ? ? finally:
? ? ? ? ? ? rv = _request_ctx_stack.pop()

? ? ? ? ? ? # get rid of circular dependencies at the end of the request
? ? ? ? ? ? # so that we don't require the GC to be active.
? ? ? ? ? ? if clear_request:
? ? ? ? ? ? ? ? rv.request.environ["werkzeug.request"] = None

? ? ? ? ? ? # Get rid of the app as well if necessary.
? ? ? ? ? ? if app_ctx is not None:
? ? ? ? ? ? ? ? app_ctx.pop(exc)

? ? ? ? ? ? assert rv is self, "Popped wrong request context. (%r instead of %r)" % (
? ? ? ? ? ? ? ? rv,
? ? ? ? ? ? ? ? self,
? ? ? ? ? ? )

? ? def auto_pop(self, exc):
? ? ? ? if self.request.environ.get("flask._preserve_context") or (
? ? ? ? ? ? exc is not None and self.app.preserve_context_on_exception
? ? ? ? ):
? ? ? ? ? ? self.preserved = True
? ? ? ? ? ? self._preserved_exc = exc
? ? ? ? else:
? ? ? ? ? ? self.pop(exc)

? ? def __enter__(self):
? ? ? ? self.push()
? ? ? ? return self

? ? def __exit__(self, exc_type, exc_value, tb):
? ? ? ? # do not pop the request stack if we are in debug mode and an
? ? ? ? # exception happened. ?This will allow the debugger to still
? ? ? ? # access the request object in the interactive shell. ?Furthermore
? ? ? ? # the context can be force kept alive for the test client.
? ? ? ? # See flask.testing for how this works.
? ? ? ? self.auto_pop(exc_value)

? ? ? ? if BROKEN_PYPY_CTXMGR_EXIT and exc_type is not None:
? ? ? ? ? ? reraise(exc_type, exc_value, tb)

? ? def __repr__(self):
? ? ? ? return "<%s '%s' [%s] of %s>" % (
? ? ? ? ? ? self.__class__.__name__,
? ? ? ? ? ? self.request.url,
? ? ? ? ? ? self.request.method,
? ? ? ? ? ? self.app.name,
? ? ? ? )

回到wsgi_app類中,我們會得到:

  1. ctx.request=Request(environ)。environ是一個原始的請求對象,但是現在被Request包裹,就不是原始的了。我們就可以執行".args",".form",".method"等。會自動幫我們去原始的數據解析。
  2. ctx.session=None.
  3. ctx.app=app

點擊進入 session_interface

####### app.py 文件下的 class Flask(_PackageBoundObject) 下的 def request_context ######
class Flask(_PackageBoundObject)
? ? session_interface = SecureCookieSessionInterface()

?查看open_session

## sessions.py 文件下的 class SecureCookieSessionInterface(SessionInterface) 下的 def?open_session ######
# 在cookie中取出session的key,然后獲取對應的session值,并返回
def?open_session(self, app, request):
????s?=?self.get_signing_serializer(app)??# 加密
????if?s?is?None:
????????return?None
????val?=?request.cookies.get(app.session_cookie_name)??# 去cookie中取值
????if?not?val:??# 第一次訪問為空執行
????????return?self.session_class()??# 返回{}
????max_age?=?total_seconds(app.permanent_session_lifetime)
????try:
????????data?=?s.loads(val, max_age=max_age)?# loads:反序列化 val:原來的值
????????return?self.session_class(data)?# {"k1":123}
????except?BadSignature:
????????return?self.session_class()

open_session返回啥self.session中就是啥。

現在回到我們的wsgi_app類中,ctx.push() 對于session的作用:執行SecureCookieSessionInterface.open_session(),去cookie中獲取值,并反序列化解密之后給ctx.session重新賦值。

3、現在才開始真正走視圖函數full_dispatch_request

######################## app.py 文件下的 class Flask 下的 full_dispatch_request ####################
def full_dispatch_request(self):
? ? self.try_trigger_before_first_request_functions()
? ? try:
? ? ? ? request_started.send(self)
? ? ? ? rv = self.preprocess_request()? # 獲取request
? ? ? ? if rv is None:
? ? ? ? ? ? rv = self.dispatch_request() ? # 調用視圖函數
? ? except Exception as e:
? ? ? ? rv = self.handle_user_exception(e)?
? ? return self.finalize_request(rv) ? ? ? # 視圖函數執行完畢的善后工作

?點擊進入 finalize_request

######################## app.py 文件下的 class Flask 下的 finalize_request ####################
def finalize_request(self, rv, from_error_handler=False):

? ? response = self.make_response(rv)
? ? try:
? ? ? ? response = self.process_response(response) ?# 觸發函數
? ? ? ? request_finished.send(self, response=response)
? ? except Exception:
? ? ? ? if not from_error_handler:
? ? ? ? ? ? raise
? ? ? ? self.logger.exception('Request finalizing failed with an '
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'error while handling an error')
? ? return response

點擊進入 process_response

######################## app.py 文件下的 class Flask 下的 process_response ####################
def process_response(self, response):
? ? ctx = _request_ctx_stack.top
? ? bp = ctx.request.blueprint
? ? funcs = ctx._after_request_functions
? ? if bp is not None and bp in self.after_request_funcs:
? ? ? ? funcs = chain(funcs, reversed(self.after_request_funcs[bp]))
? ? if None in self.after_request_funcs:
? ? ? ? funcs = chain(funcs, reversed(self.after_request_funcs[None]))
? ? for handler in funcs:
? ? ? ? response = handler(response)
? ? if not self.session_interface.is_null_session(ctx.session):
? ? ? ? self.session_interface.save_session(self, ctx.session, response) ?# 保存session
? ? return response

看一下save_session:

def save_session(self, app, session, response):
? ? domain = self.get_cookie_domain(app)
? ? path = self.get_cookie_path(app)

? ? # If the session is modified to be empty, remove the cookie.
? ? # If the session is empty, return without setting the cookie.
? ? if not session:
? ? ? ? if session.modified:
? ? ? ? ? ? response.delete_cookie(
? ? ? ? ? ? ? ? app.session_cookie_name,
? ? ? ? ? ? ? ? domain=domain,
? ? ? ? ? ? ? ? path=path
? ? ? ? ? ? )

? ? ? ? return

? ? # Add a "Vary: Cookie" header if the session was accessed at all.
? ? if session.accessed:
? ? ? ? response.vary.add('Cookie')

? ? if not self.should_set_cookie(app, session):
? ? ? ? return

? ? httponly = self.get_cookie_httponly(app)
? ? secure = self.get_cookie_secure(app)
? ? samesite = self.get_cookie_samesite(app)
? ? expires = self.get_expiration_time(app, session)

? ? # 前面不看,暫時用不到
? ? val = self.get_signing_serializer(app).dumps(dict(session)) ?# 加密序列化成字符串

? ? response.set_cookie( ? ? ? ?# 設置cookie
? ? ? ? app.session_cookie_name,
? ? ? ? val,
? ? ? ? expires=expires,
? ? ? ? httponly=httponly,
? ? ? ? domain=domain,
? ? ? ? path=path,
? ? ? ? secure=secure,
? ? ? ? samesite=samesite
? ? )

最后執行?ctx.auto_pop(error)

這就是Flask框架中sesion的請求流程。說了這么多,其實真正實現咱們想要的功能的就是兩個方法:open_session,save_session.請求進來執行open_session,請求走的時候執行save_session。

默認都是調用app.session_interface。

流程:請求到來:請求到來之后wsgi會觸發__call__方法,由__call__方法再次調用wsgi_app方法,將請求和session相關封裝到ctx = RequestContext對象中,此時session為空,request二次封裝,可以使用將app和g封裝到app_ctx = AppContext對象中。再通過LocalStack對象將ctx、app_ctx封裝到Local對象中。獲取數據:通過LocalProxy對象+偏函數,調用LocalStack去Local中獲取響應ctx、app_ctx中封裝的值。請求結束:調用LocalStack的pop方法,將ctx和app_ctx移除。

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/454482.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/454482.shtml
英文地址,請注明出處:http://en.pswp.cn/news/454482.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

vlc內部運行機制以及架構分析

VLC架構剖析1. VideoLan簡介1.1 videolan組成Videolan有以下兩部分組成:VLC:一個最主要的部分&#xff0c;它可以播放各種類型的媒體文件和流vlc架構剖析 1. VideoLan簡介 1.1 videolan組成 Videolan有以下兩部分組成: VLC:一個最主要的部分&#xff0c;它可以播放各種類型的媒…

visio中公式太小_visio繪圖中的數據計算

在繪流程圖時&#xff0c;我們有時候會想直接在流程圖上做計算&#xff0c;比如化工設計時精餾塔計算理論塔板數。在VISIO中&#xff0c;實現這個功能還是比較容易&#xff0c;舉一個最簡單的例子。如下圖所示&#xff0c;等號后面的數字可以根據前面的數字變化。實現過程如下&…

Django syncdb mysql error on localhost - (1045, Access denied for user 'ODBC'@'

環境&#xff1a;WINDOWS系統 將數據庫配置 DATABASES { default: { ENGINE: django.db.backends.mysql, HOST: localhost, PORT: 3306, NAME: yunwei, USERNAME: root, PASSWORD: mysql, } } 改為 DATABASES { default: { ENGINE: django.db.backends.mysql, HOST: localhos…

銀行招計算機專業算什么崗,銀行計算機專業崗位全方位分析

黑龍江銀行招聘信息陸續發布&#xff0c;中公教育專家為各位考生提供&#xff1a;銀行計算機專業崗位全方位分析&#xff01;供大家參考&#xff0c;預祝大家取得好成績&#xff0c;更多黑龍江人民銀行招聘相關資料請關注黑龍江銀行招聘網。金融銀行部門一直是一個朝陽產業&…

【47.92%】【hdu 5763】Another Meaning

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1440 Accepted Submission(s): 690 Problem DescriptionAs is known to all, in many cases, a word has two meanings. Such as “hehe”, which not only mea…

root用戶登錄mysql后新建用戶提示1045錯誤

執行以下命令查看root權限 show grants for rootlocalhost; 如果沒有顯示with grant option,說明是root沒有擁有新建授權用戶的權限&#xff08;為什么會這樣呢&#xff0c;因為我把userroot and hostlocalhost給刪掉了&#xff0c;然后重新授權all privileges給新建root用戶&a…

Flask werkzeug 源碼解析

Flask werkzeug流程大概&#xff1a;執行run_simple &#xff0c;實際執行為先用make_server 創建一個 BaseServer 實例&#xff0c;然后執行 實例的serve_forever 方法, serve_forever 調用 run_simple 傳入的第三個參數&#xff0c;執行(self, environ, start_response) &am…

AVS 幀內預測模式的匯編優化

王瑞&#xff0a;基金項目&#xff1a;本課題得到國家自然科學基金資助項目基金&#xff08;項目編號&#xff1a;60772101&#xff09;的資助。作者簡介&#xff1a;王瑞&#xff08;1986—&#xff09;, 男, 山東萊蕪人, 碩士, 主要從事視頻壓縮方面的研究. E&#xff0d;mai…

ltsc系統激活_WIN10_X64企業版LTSC 電腦公司裝機版 202008

文件: WIN10_X64_LTSC_ZJ202008.esd大小: 7431429353 字節(6.92G)MD5: A3A3B15ED47216E177C924D2E07E0799SHA1: 3A647265E0C8234225C633407093BAA07253FB34CRC32: 32E791E9(注意&#xff0c;下載文件有一定幾率損壞&#xff0c;如文件值不對請重新下載&#xff01;)360安全云盤…

大學計算機應用基礎考試題庫,大學計算機應用基礎考試題庫

綜合模擬(四)一、選擇題。1、完整的計算機硬件系統一般包括外部設備和 C 。A、運算器的控制器 B、存儲器 C、主機 D、中央處理器2、計算機能夠自動工作&#xff0c;主要是因為采用了 D 。A、二進制數制 B、高速電子元件 C、存儲程序控制 D、程序設計語言3、下面哪能一組是系統軟…

Lombok 使用小結

Lombok 使用小結 Lombok 簡介Lombok 安裝Lombok 使用 API示例示例源碼引用和引申Lombok 簡介 Lombok 是一種 Java 實用工具&#xff0c;可用來幫助開發人員消除 Java 的冗長&#xff0c;尤其是對于簡單的 Java 對象&#xff08;POJO&#xff09;。它通過注釋實現這一目的。通過…

html表單input file,input標簽type=file的文件上傳

一&#xff0c;通過表單提交的方式該提交方式只是提交普通表單&#xff1b;對于file組所選中的文件內容是不上傳的&#xff0c;因此需要設置&#xff1a;enctype屬性enctype"multipart/form-data"如果想上傳多文件&#xff0c;可添加multiple二&#xff0c;通過Ajax異…

AVS游程解碼、反掃描、反量化和反變換優化設計

中圖分類號:TN919.81   文獻標識碼:A   文章編號:1009-2552 (2007) 02-0054-04AVS游程解碼、反掃描、反量化和反變換優化設計趙 策, 劉佩林(上海交通大學電子工程系, 上海200240)摘 要: 提出了一種適用于AVS的游程解碼、反掃描、反量化和反變換硬件結構優化設計方案。根據…

Django REST framework介紹

現在前后端分離的架構設計越來越流行&#xff0c;業界甚至出現了API優先的趨勢。 顯然API開發已經成為后端程序員的必備技能了&#xff0c;那作為Python程序員特別是把Django作為自己主要的開發框架的程序員&#xff0c;Django REST framework&#xff08;DRF&#xff09;這個…

zabbix 安裝_安裝zabbix

準備一個純凈環境10.0.0.99首先修改yum源&#xff0c;修改為zabbix清華源&#xff0c;清華源玉zabbix官方源都是同步的&#xff0c;下載速度更快&#xff01;zabbix官方Download Zabbix?www.zabbix.com點擊下載&#xff0c;下面有zabbix的歷史版本以及官方安裝文檔可以查看到不…

拓展歐幾里得 [Noi2002]Savage

對于一個野人&#xff0c;他&#xff08;她&#xff1f;&#xff09;所在的位置&#xff0c;&#xff08;C[i]x*p[i]&#xff09;%ans,是的&#xff0c;暴力枚舉每一個ans&#xff0c;用拓展歐幾里得求出每兩個wildpeople(wildrage?)相遇的年份&#xff0c;如果小于最小的壽限…

CCNP-19 IS-IS試驗2(BSCI)

CCNP-19 IS-IS試驗2 實驗拓撲&#xff1a;試驗要求&#xff1a;R1 R2 R3全部采用集成的ISIS路由協議&#xff0c;R1 R2在區域49.0001內&#xff0c;R3在區域49.0002內&#xff0c;R1與R2之間的鏈路類型為L1&#xff0c;R2與R3之間的鏈路類型為L2。 試驗目的&#xff1a;掌握基…

正道的光用計算機,正道的光作文500字

當那熟悉的轟天巨雷般的呼嚕聲響起&#xff0c;我就知道&#xff0c;這又是睡不著的一天。同樣在宿舍&#xff1b;同樣是小翟&#xff1b;同樣的時間&#xff1b;同樣在我昏昏欲睡的時候&#xff0c;那個熟悉的呼嚕聲&#xff0c;它又來了。它將我從即將到來的美夢中驚醒了&…

AVS高清立體視頻編碼器

一、成果項目背景 電視技術在經歷了從黑白到彩色、從模擬到數字的技術變革之后正在醞釀另一場技術革命&#xff0c;從單純觀看二維場景的平面電視跨越到展現三維場景的立體電視。立體電視&#xff0c;又稱三維電視(3DTV)&#xff0c;提供了更為豐富的視覺信息和更具臨場感的觀…

RESTful介紹

RESTful介紹 REST與技術無關&#xff0c;代表的是一種軟件架構風格&#xff0c;REST是Representational State Transfer的簡稱&#xff0c;中文翻譯為“表征狀態轉移”或“表現層狀態轉化”。阮一峰 理解RESTful架構 RESTful API設計指南 阮一峰 RESTful設計指南 API與用戶…