017_Cookie

一. Cookie介绍

1. Cookie其实是一份小数据, 是服务器给客户端, 并且存储在客户端上的一份小数据。

2. 应用场景: 自动登录、浏览记录、购物车。

3. 为什么要有这个Cookie: http的请求是无状态。 客户端与服务器在通讯的时候, 是无状态的, 其实就是客户端在第二次来访的时候, 服务器根本就不知道这个客户端以前有没有来访问过。 Cooke就是为了更好的用户体验, 更好的交互[自动登录], 其实从公司层面讲, 就是为了更好的收集用户习惯[大数据]。

4. 创建Cookie并发送给浏览器

4.1. 创建Cookie并发送给浏览器

4.2. 客户端收到的信息里面, 响应头中多了一个字段Set-Cookie。

4.2. 添加多个Cookie创建多个就行, 一个服务器最多添加20个Cookie。

5. 获取Cookie

6. 清除Cookie

 

7. Cookie的常用方法

7.1.创建Cookie: new Cookie(“name”, “value”);

7.2.设置Cookie有效期: cookie.setMaxAge(60 * 60 * 24 * 30);

7.3.设置路径, 只有访问/UseCookie/LoginFilter.action这个路径地址才会带cookie: cookie.setPath("/UseCookie/LoginFilter.action");

7.4.设置域, 只有访问localhost域, 所有向该域发送的请求中都会包含这个cookie信息cookie.setDomain("localhost");

7.5.使用HttpServletResponse的addCookie()方法, 服务器响应浏览器的时候把cookie发送给浏览器: resp.addCookie(cookie);

7.6.使用HttpServletRequest的getCookies()获取请求中携带的Cookie数组: Cookie[] cookies = req.getCookies();

二. 使用Cookie获取用户上次登录时间

1. 创建一个UseCookie的Web工程

2. 在WebContent下创建一个index.html

3. 编写index.html

<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>登录界面</title>
	</head>
	<body>
		<form action="LoginFilter.action" method="post">
			账号:<input type="text" name="username"/><br>
			密码:<input type="text" name="password"/><br>
			<input type="submit" value="登录"/>
		</form>
	</body>
</html>

4. 创建LoginFilter.java

5. 编写LoginFilter.java

package com.lywgames.myservlet;

import java.io.IOException;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class LoginFilter extends HttpServlet {
	private static final long serialVersionUID = 1L;

	public Cookie getCookie(HttpServletRequest req, String name) {
		// 使用HttpServletRequest的getCookies()获取Cookie
		Cookie[] cookies = req.getCookies();
		if(cookies != null){
			for (Cookie cookie : cookies) {
				if(cookie.getName().equals(name)){
					return cookie;	
				}
			}
		}
		
		return null;
	}
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		resp.setContentType("text/html;charset=utf-8");
		
		String userName = req.getParameter("username");
		String password = req.getParameter("password");
		
		if("admin".equals(userName) && "123".equals(password)){
			// 获取lastLoginTime的Cookie
			Cookie lastLoginTime = getCookie(req, "lastLoginTime");
			// 如果lastLoginTime为空, 说明是第一次登录
			if(lastLoginTime == null){
				// 创建一个新的cookie
				Cookie cookie = new Cookie("lastLoginTime", String.valueOf(System.currentTimeMillis()));
				// 设置cookie有效期为30天
				cookie.setMaxAge(60 * 60 * 24 * 30); 
				// 只有访问/UseCookie/LoginFilter.action这个路径地址才会带cookie
				cookie.setPath("/UseCookie/LoginFilter.action");
				// cookie对于哪个域是有效的。
				cookie.setDomain("localhost");
				// 添加cookie, 响应给浏览器
				resp.addCookie(cookie);
				
				// 向客户端输出登录信息
				resp.getWriter().println("欢迎您, " + userName);
			}else{
				// 向客户端输出登录信息
				Date date = new Date(Long.parseLong(lastLoginTime.getValue()));

				// 更新cookie
				lastLoginTime.setValue(String.valueOf(System.currentTimeMillis()));
				resp.addCookie(lastLoginTime);
				
//				// 删除cookie, 需要关闭浏览器, 防止有缓存
//				lastLoginTime.setValue(null); // 设置cookie为空
//				lastLoginTime.setMaxAge(0); // 立即失效
//				// 如果你在创建cookie的时候加上了路径, 删除cookie的时候也要带路径
//				lastLoginTime.setPath("/UseCookie/LoginFilter.action"); 
//				// cookie对于哪个域是有效的。
//				lastLoginTime.setDomain("localhost");
//				// 从新添加
//				resp.addCookie(lastLoginTime);

				resp.getWriter().println("欢迎您, " + userName + ",上次登录时间是:" + date);
			}
		}else{
			// 向客户端输出登录失败
			resp.getWriter().println("登录失败");
		}
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		doGet(req, resp);
	}
}

6. 编写web.xml

7. 部署运行

8. 点击登录, 首次登录没有上次登录时间, 之后登录有上次登录时间

三. Cookie的安全问题

1. 由于Cookie会保存在客户端上, 所以有安全隐患问题。还有一个问题, Cookie的大小与个数有限制。为了解决这个问题, 就出现了Session。

运行rabbitmq日志2025-07-30 08:44:54.598 [debug] <0.287.0> Lager installed handler {lager_file_backend, "d:/Downloads/RabbitMQData/log/rabbit@LAPTOP-FU2L4D12.log"} into lager_event 2025-07-30 08:44:54.598 [debug] <0.290.0> Lager installed handler error_logger_lager_h into error_logger 2025-07-30 08:44:54.608 [debug] <0.293.0> Lager installed handler lager_forwarder_backend into error_logger_lager_event 2025-07-30 08:44:54.608 [debug] <0.296.0> Lager installed handler lager_forwarder_backend into rabbit_log_lager_event 2025-07-30 08:44:54.608 [debug] <0.299.0> Lager installed handler lager_forwarder_backend into rabbit_log_channel_lager_event 2025-07-30 08:44:54.608 [debug] <0.302.0> Lager installed handler lager_forwarder_backend into rabbit_log_connection_lager_event 2025-07-30 08:44:54.608 [debug] <0.305.0> Lager installed handler lager_forwarder_backend into rabbit_log_feature_flags_lager_event 2025-07-30 08:44:54.608 [debug] <0.308.0> Lager installed handler lager_forwarder_backend into rabbit_log_federation_lager_event 2025-07-30 08:44:54.608 [debug] <0.311.0> Lager installed handler lager_forwarder_backend into rabbit_log_ldap_lager_event 2025-07-30 08:44:54.608 [debug] <0.317.0> Lager installed handler lager_forwarder_backend into rabbit_log_prelaunch_lager_event 2025-07-30 08:44:54.608 [debug] <0.314.0> Lager installed handler lager_forwarder_backend into rabbit_log_mirroring_lager_event 2025-07-30 08:44:54.608 [debug] <0.320.0> Lager installed handler lager_forwarder_backend into rabbit_log_queue_lager_event 2025-07-30 08:44:54.608 [debug] <0.323.0> Lager installed handler lager_forwarder_backend into rabbit_log_ra_lager_event 2025-07-30 08:44:54.608 [debug] <0.326.0> Lager installed handler lager_forwarder_backend into rabbit_log_shovel_lager_event 2025-07-30 08:44:54.608 [debug] <0.329.0> Lager installed handler {lager_file_backend, "d:/Downloads/RabbitMQData/log/rabbit@LAPTOP-FU2L4D12_upgrade.log"} into rabbit_log_upgrade_lager_event 2025-07-30 08:44:54.619 [info] <0.44.0> Application lager started on node 'rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:44:54.633 [info] <0.273.0> Log file opened with Lager 2025-07-30 08:44:54.996 [info] <0.44.0> Application mnesia started on node 'rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:44:54.998 [info] <0.273.0> Starting RabbitMQ 3.8.8 on Erlang 23.3.4.18 Copyright (c) 2007-2020 VMware, Inc. or its affiliates. Licensed under the MPL 2.0. Website: https://rabbitmq.com 2025-07-30 08:44:54.998 [info] <0.273.0> node : rabbit@LAPTOP-FU2L4D12 home dir : C:\Users\小橙 config file(s) : (none) cookie hash : mkQxrMfpOoR5L3HCS5ZoGA== log(s) : d:/Downloads/RabbitMQData/log/rabbit@LAPTOP-FU2L4D12.log : d:/Downloads/RabbitMQData/log/rabbit@LAPTOP-FU2L4D12_upgrade.log database dir : d:/Downloads/RabbitMQData/db/rabbit@LAPTOP-FU2L4D12-mnesia 2025-07-30 08:44:55.053 [debug] <0.285.0> Lager installed handler lager_backend_throttle into lager_event 2025-07-30 08:44:59.279 [info] <0.273.0> Running boot step pre_boot defined by app rabbit 2025-07-30 08:44:59.279 [info] <0.273.0> Running boot step rabbit_core_metrics defined by app rabbit 2025-07-30 08:44:59.279 [info] <0.273.0> Running boot step rabbit_alarm defined by app rabbit 2025-07-30 08:44:59.281 [info] <0.361.0> Memory high watermark set to 6473 MiB (6787769958 bytes) of 16183 MiB (16969424896 bytes) total 2025-07-30 08:44:59.480 [info] <0.363.0> Enabling free disk space monitoring 2025-07-30 08:44:59.480 [info] <0.363.0> Disk free limit set to 50MB 2025-07-30 08:44:59.524 [info] <0.273.0> Running boot step code_server_cache defined by app rabbit 2025-07-30 08:44:59.524 [info] <0.273.0> Running boot step file_handle_cache defined by app rabbit 2025-07-30 08:44:59.524 [info] <0.366.0> Limiting to approx 65439 file handles (58893 sockets) 2025-07-30 08:44:59.524 [info] <0.367.0> FHC read buffering: OFF 2025-07-30 08:44:59.524 [info] <0.367.0> FHC write buffering: ON 2025-07-30 08:44:59.525 [info] <0.273.0> Running boot step worker_pool defined by app rabbit 2025-07-30 08:44:59.525 [info] <0.351.0> Will use 8 processes for default worker pool 2025-07-30 08:44:59.525 [info] <0.351.0> Starting worker pool 'worker_pool' with 8 processes in it 2025-07-30 08:44:59.525 [info] <0.273.0> Running boot step database defined by app rabbit 2025-07-30 08:44:59.526 [info] <0.273.0> Node database directory at d:/Downloads/RabbitMQData/db/rabbit@LAPTOP-FU2L4D12-mnesia is empty. Assuming we need to join an existing cluster or initialise from scratch... 2025-07-30 08:44:59.526 [info] <0.273.0> Configured peer discovery backend: rabbit_peer_discovery_classic_config 2025-07-30 08:44:59.526 [info] <0.273.0> Will try to lock with peer discovery backend rabbit_peer_discovery_classic_config 2025-07-30 08:44:59.526 [info] <0.273.0> Peer discovery backend does not support locking, falling back to randomized delay 2025-07-30 08:44:59.526 [info] <0.273.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping randomized startup delay. 2025-07-30 08:44:59.526 [info] <0.273.0> All discovered existing cluster peers: 2025-07-30 08:44:59.526 [info] <0.273.0> Discovered no peer nodes to cluster with. Some discovery backends can filter nodes out based on a readiness criteria. Enabling debug logging might help troubleshoot. 2025-07-30 08:44:59.533 [info] <0.44.0> Application mnesia exited with reason: stopped 2025-07-30 08:44:59.533 [info] <0.44.0> Application mnesia exited with reason: stopped 2025-07-30 08:44:59.553 [info] <0.44.0> Application mnesia started on node 'rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:44:59.608 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.608 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.622 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.622 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.622 [info] <0.273.0> Feature flag `implicit_default_bindings`: supported, attempt to enable... 2025-07-30 08:44:59.622 [info] <0.273.0> Feature flag `implicit_default_bindings`: mark as enabled=state_changing 2025-07-30 08:44:59.626 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.626 [info] <0.273.0> Feature flags: [~] implicit_default_bindings 2025-07-30 08:44:59.627 [info] <0.273.0> Feature flags: [ ] maintenance_mode_status 2025-07-30 08:44:59.627 [info] <0.273.0> Feature flags: [ ] quorum_queue 2025-07-30 08:44:59.627 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.627 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.643 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 0 retries left 2025-07-30 08:44:59.643 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.643 [info] <0.273.0> Feature flag `implicit_default_bindings`: mark as enabled=true 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: [ ] maintenance_mode_status 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: [ ] quorum_queue 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.649 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.661 [info] <0.273.0> Feature flag `maintenance_mode_status`: supported, attempt to enable... 2025-07-30 08:44:59.661 [info] <0.273.0> Feature flag `maintenance_mode_status`: mark as enabled=state_changing 2025-07-30 08:44:59.665 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.665 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.666 [info] <0.273.0> Feature flags: [~] maintenance_mode_status 2025-07-30 08:44:59.666 [info] <0.273.0> Feature flags: [ ] quorum_queue 2025-07-30 08:44:59.666 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.666 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.677 [info] <0.273.0> Creating table rabbit_node_maintenance_states for feature flag `maintenance_mode_status` 2025-07-30 08:44:59.680 [info] <0.273.0> Feature flag `maintenance_mode_status`: mark as enabled=true 2025-07-30 08:44:59.686 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.687 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.687 [info] <0.273.0> Feature flags: [x] maintenance_mode_status 2025-07-30 08:44:59.687 [info] <0.273.0> Feature flags: [ ] quorum_queue 2025-07-30 08:44:59.687 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.687 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.699 [info] <0.273.0> Feature flag `quorum_queue`: supported, attempt to enable... 2025-07-30 08:44:59.699 [info] <0.273.0> Feature flag `quorum_queue`: mark as enabled=state_changing 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: [x] maintenance_mode_status 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: [~] quorum_queue 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.704 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.718 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.718 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.718 [info] <0.273.0> Feature flag `quorum_queue`: migrating Mnesia table rabbit_queue... 2025-07-30 08:44:59.734 [info] <0.273.0> Feature flag `quorum_queue`: migrating Mnesia table rabbit_durable_queue... 2025-07-30 08:44:59.751 [info] <0.273.0> Feature flag `quorum_queue`: Mnesia tables migration done 2025-07-30 08:44:59.751 [info] <0.273.0> Feature flag `quorum_queue`: mark as enabled=true 2025-07-30 08:44:59.755 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.756 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.756 [info] <0.273.0> Feature flags: [x] maintenance_mode_status 2025-07-30 08:44:59.756 [info] <0.273.0> Feature flags: [x] quorum_queue 2025-07-30 08:44:59.756 [info] <0.273.0> Feature flags: [ ] virtual_host_metadata 2025-07-30 08:44:59.756 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.772 [info] <0.273.0> Feature flag `virtual_host_metadata`: supported, attempt to enable... 2025-07-30 08:44:59.772 [info] <0.273.0> Feature flag `virtual_host_metadata`: mark as enabled=state_changing 2025-07-30 08:44:59.775 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.775 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.775 [info] <0.273.0> Feature flags: [x] maintenance_mode_status 2025-07-30 08:44:59.775 [info] <0.273.0> Feature flags: [x] quorum_queue 2025-07-30 08:44:59.775 [info] <0.273.0> Feature flags: [~] virtual_host_metadata 2025-07-30 08:44:59.776 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.786 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.786 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.807 [info] <0.273.0> Feature flag `virtual_host_metadata`: mark as enabled=true 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: list of feature flags found: 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: [x] implicit_default_bindings 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: [x] maintenance_mode_status 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: [x] quorum_queue 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: [x] virtual_host_metadata 2025-07-30 08:44:59.812 [info] <0.273.0> Feature flags: feature flag states written to disk: yes 2025-07-30 08:44:59.823 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.824 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.842 [info] <0.273.0> Waiting for Mnesia tables for 30000 ms, 9 retries left 2025-07-30 08:44:59.842 [info] <0.273.0> Successfully synced tables from a peer 2025-07-30 08:44:59.842 [info] <0.273.0> Peer discovery backend rabbit_peer_discovery_classic_config does not support registration, skipping registration. 2025-07-30 08:44:59.842 [info] <0.273.0> Running boot step database_sync defined by app rabbit 2025-07-30 08:44:59.842 [info] <0.273.0> Running boot step feature_flags defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step codec_correctness_check defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step external_infrastructure defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_registry defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_auth_mechanism_cr_demo defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_queue_location_random defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_event defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_auth_mechanism_amqplain defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_auth_mechanism_plain defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_exchange_type_direct defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_exchange_type_fanout defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_exchange_type_headers defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_exchange_type_topic defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_mirror_queue_mode_all defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_mirror_queue_mode_exactly defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_mirror_queue_mode_nodes defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_priority_queue defined by app rabbit 2025-07-30 08:44:59.843 [info] <0.273.0> Priority queues enabled, real BQ is rabbit_variable_queue 2025-07-30 08:44:59.843 [info] <0.273.0> Running boot step rabbit_queue_location_client_local defined by app rabbit 2025-07-30 08:44:59.844 [info] <0.273.0> Running boot step rabbit_queue_location_min_masters defined by app rabbit 2025-07-30 08:44:59.844 [info] <0.273.0> Running boot step kernel_ready defined by app rabbit 2025-07-30 08:44:59.844 [info] <0.273.0> Running boot step rabbit_sysmon_minder defined by app rabbit 2025-07-30 08:44:59.844 [info] <0.273.0> Running boot step rabbit_epmd_monitor defined by app rabbit 2025-07-30 08:44:59.845 [info] <0.605.0> epmd monitor knows us, inter-node communication (distribution) port: 25672 2025-07-30 08:44:59.845 [info] <0.273.0> Running boot step guid_generator defined by app rabbit 2025-07-30 08:44:59.848 [info] <0.273.0> Running boot step rabbit_node_monitor defined by app rabbit 2025-07-30 08:44:59.848 [info] <0.609.0> Starting rabbit_node_monitor 2025-07-30 08:44:59.848 [info] <0.273.0> Running boot step delegate_sup defined by app rabbit 2025-07-30 08:44:59.848 [info] <0.273.0> Running boot step rabbit_memory_monitor defined by app rabbit 2025-07-30 08:44:59.849 [info] <0.273.0> Running boot step core_initialized defined by app rabbit 2025-07-30 08:44:59.849 [info] <0.273.0> Running boot step upgrade_queues defined by app rabbit 2025-07-30 08:44:59.859 [info] <0.273.0> message_store upgrades: 1 to apply 2025-07-30 08:44:59.859 [info] <0.273.0> message_store upgrades: Applying rabbit_variable_queue:move_messages_to_vhost_store 2025-07-30 08:44:59.859 [info] <0.273.0> message_store upgrades: No durable queues found. Skipping message store migration 2025-07-30 08:44:59.859 [info] <0.273.0> message_store upgrades: Removing the old message store data 2025-07-30 08:44:59.860 [info] <0.273.0> message_store upgrades: All upgrades applied successfully 2025-07-30 08:44:59.878 [info] <0.273.0> Running boot step rabbit_connection_tracking defined by app rabbit 2025-07-30 08:44:59.879 [info] <0.273.0> Running boot step rabbit_connection_tracking_handler defined by app rabbit 2025-07-30 08:44:59.879 [info] <0.273.0> Running boot step rabbit_exchange_parameters defined by app rabbit 2025-07-30 08:44:59.879 [info] <0.273.0> Running boot step rabbit_mirror_queue_misc defined by app rabbit 2025-07-30 08:44:59.879 [info] <0.273.0> Running boot step rabbit_policies defined by app rabbit 2025-07-30 08:44:59.880 [info] <0.273.0> Running boot step rabbit_policy defined by app rabbit 2025-07-30 08:44:59.880 [info] <0.273.0> Running boot step rabbit_queue_location_validator defined by app rabbit 2025-07-30 08:44:59.880 [info] <0.273.0> Running boot step rabbit_quorum_memory_manager defined by app rabbit 2025-07-30 08:44:59.880 [info] <0.273.0> Running boot step rabbit_vhost_limit defined by app rabbit 2025-07-30 08:44:59.880 [info] <0.273.0> Running boot step recovery defined by app rabbit 2025-07-30 08:44:59.881 [info] <0.273.0> Running boot step empty_db_check defined by app rabbit 2025-07-30 08:44:59.881 [info] <0.273.0> Will seed default virtual host and user... 2025-07-30 08:44:59.881 [info] <0.273.0> Adding vhost '/' (description: 'Default virtual host') 2025-07-30 08:44:59.886 [info] <0.646.0> Making sure data directory 'd:/Downloads/RabbitMQData/db/rabbit@LAPTOP-FU2L4D12-mnesia/msg_stores/vhosts/628WB79CIFDYO9LJI6DKMI09L' for vhost '/' exists 2025-07-30 08:44:59.889 [info] <0.646.0> Starting message stores for vhost '/' 2025-07-30 08:44:59.889 [info] <0.650.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_transient": using rabbit_msg_store_ets_index to provide index 2025-07-30 08:44:59.891 [info] <0.646.0> Started message store of type transient for vhost '/' 2025-07-30 08:44:59.891 [info] <0.654.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": using rabbit_msg_store_ets_index to provide index 2025-07-30 08:44:59.892 [warning] <0.654.0> Message store "628WB79CIFDYO9LJI6DKMI09L/msg_store_persistent": rebuilding indices from scratch 2025-07-30 08:44:59.893 [info] <0.646.0> Started message store of type persistent for vhost '/' 2025-07-30 08:44:59.896 [info] <0.273.0> Created user 'guest' 2025-07-30 08:44:59.896 [info] <0.273.0> Successfully set user tags for user 'guest' to [administrator] 2025-07-30 08:44:59.897 [info] <0.273.0> Successfully set permissions for 'guest' in virtual host '/' to '.*', '.*', '.*' 2025-07-30 08:44:59.897 [info] <0.273.0> Running boot step rabbit_looking_glass defined by app rabbit 2025-07-30 08:44:59.897 [info] <0.273.0> Running boot step rabbit_core_metrics_gc defined by app rabbit 2025-07-30 08:44:59.897 [info] <0.273.0> Running boot step background_gc defined by app rabbit 2025-07-30 08:44:59.897 [info] <0.273.0> Running boot step connection_tracking defined by app rabbit 2025-07-30 08:44:59.900 [info] <0.273.0> Setting up a table for connection tracking on this node: 'tracked_connection_on_node_rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:44:59.902 [info] <0.273.0> Setting up a table for per-vhost connection counting on this node: 'tracked_connection_per_vhost_on_node_rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step routing_ready defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step pre_flight defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step notify_cluster defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step networking defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step definition_import_worker_pool defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.351.0> Starting worker pool 'definition_import_pool' with 8 processes in it 2025-07-30 08:44:59.902 [info] <0.273.0> Running boot step cluster_name defined by app rabbit 2025-07-30 08:44:59.902 [info] <0.273.0> Initialising internal cluster ID to 'rabbitmq-cluster-id-vb7eUVm_pMu4vzxKD3W8-A' 2025-07-30 08:44:59.903 [info] <0.273.0> Running boot step direct_client defined by app rabbit 2025-07-30 08:44:59.903 [info] <0.44.0> Application rabbit started on node 'rabbit@LAPTOP-FU2L4D12' 2025-07-30 08:45:00.001 [info] <0.699.0> Ready to start client connection listeners 2025-07-30 08:45:00.015 [info] <0.714.0> started TCP listener on [::]:5672 2025-07-30 08:45:00.017 [info] <0.729.0> started TCP listener on 0.0.0.0:5672 2025-07-30 08:45:00.018 [notice] <0.282.0> Changed loghwm of d:/Downloads/RabbitMQData/log/rabbit@LAPTOP-FU2L4D12.log to 5000 2025-07-30 08:45:00.195 [info] <0.699.0> Server startup complete; 0 plugins started. 2025-07-30 08:45:00.195 [info] <0.699.0> Resetting node maintenance status
07-31
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值