SELECT data_key, data_value
FROM xf_data_registry
WHERE data_key IN ('options', 'languages', 'contentTypes', 'codeEventListeners', 'deferredRun', 'simpleCache', 'addOns', 'defaultStyleProperties', 'routeFiltersIn', 'routeFiltersOut', 'routesPublic', 'nodeTypes', 'bannedIps', 'discouragedIps', 'styles', 'displayStyles', 'userBanners', 'smilies', 'bbCode', 'threadPrefixes', 'userTitleLadder', 'reportCounts', 'moderationCounts', 'userModerationCounts', 'notices', 'userFieldsInfo')
Run Time: 0.000760
Select Type | Table | Type | Possible Keys | Key | Key Len | Ref | Rows | Extra |
---|
SIMPLE | xf_data_registry | range | PRIMARY | PRIMARY | 27 | | 26 | Using where |
SELECT data_key, data_value
FROM xf_data_registry
WHERE data_key IN ('brListenerClasses', 'brBriviumAddOns')
Run Time: 0.000146
Select Type | Table | Type | Possible Keys | Key | Key Len | Ref | Rows | Extra |
---|
SIMPLE | xf_data_registry | range | PRIMARY | PRIMARY | 27 | | 2 | Using where |
SELECT *
FROM xf_brivium_addon
ORDER BY addon_id
Run Time: 0.000166
Select Type | Table | Type | Possible Keys | Key | Key Len | Ref | Rows | Extra |
---|
SIMPLE | xf_brivium_addon | index | | PRIMARY | 77 | | 1 | |
INSERT INTO xf_data_registry
(data_key, data_value)
VALUES
(?, ?)
ON DUPLICATE KEY UPDATE
data_value = VALUES(data_value)
Params: brBriviumAddOns, a:0:{}
Run Time: 0.000337
SELECT cache_value
FROM xf_permission_combination
WHERE permission_combination_id = ?
Params: 1
Run Time: 0.000140
Select Type | Table | Type | Possible Keys | Key | Key Len | Ref | Rows | Extra |
---|
SIMPLE | xf_permission_combination | const | PRIMARY | PRIMARY | 4 | const | 1 | |
SELECT thread.*
,
user.gender, user.avatar_date, user.gravatar,
NULL AS thread_read_date,
0 AS thread_reply_banned,
0 AS thread_is_watched,
'' AS draft_message, NULL AS draft_extra
FROM xf_thread AS thread
LEFT JOIN xf_user AS user ON
(user.user_id = thread.user_id)
WHERE thread.thread_id = ?
Params: 216365
Run Time: 0.000359
Select Type | Table | Type | Possible Keys | Key | Key Len | Ref | Rows | Extra |
---|
SIMPLE | thread | const | PRIMARY | PRIMARY | 4 | const | 1 | |
SIMPLE | user | const | PRIMARY | PRIMARY | 4 | const | 1 | |
SELECT node.*, forum.*
,
permission.cache_value AS node_permission_cache,
NULL AS forum_read_date
FROM xf_forum AS forum
INNER JOIN xf_node AS node ON (node.node_id = forum.node_id)
LEFT JOIN xf_permission_cache_content AS permission
ON (permission.permission_combination_id = 1
AND permission.content_type = 'node'
AND permission.content_id = forum.node_id)
WHERE node.node_id = ?
Params: 9
Run Time: 0.000532
Select Type | Table | Type | Possible Keys | Key | Key Len | Ref | Rows | Extra |
---|
SIMPLE | forum | const | PRIMARY | PRIMARY | 4 | const | 1 | |
SIMPLE | node | const | PRIMARY | PRIMARY | 4 | const | 1 | |
SIMPLE | permission | const | PRIMARY | PRIMARY | 35 | const,const,const | 1 | |
SELECT post.*
,
thread.*, thread.user_id AS thread_user_id, thread.username AS thread_username,
thread.post_date AS thread_post_date,
post.user_id, post.username, post.post_date,
bb_code_parse_cache.parse_tree AS message_parsed, bb_code_parse_cache.cache_version AS message_cache_version,
user.*, IF(user.username IS NULL, post.username, user.username) AS username,
user_profile.*,
user_privacy.*,
signature_parse_cache.parse_tree AS signature_parsed, bb_code_parse_cache.cache_version AS signature_cache_version,
session_activity.view_date AS last_view_date,
0 AS like_date
FROM xf_post AS post
INNER JOIN xf_thread AS thread ON
(thread.thread_id = post.thread_id)
LEFT JOIN xf_bb_code_parse_cache AS bb_code_parse_cache ON
(bb_code_parse_cache.content_type = 'post' AND bb_code_parse_cache.content_id = post.post_id)
LEFT JOIN xf_user AS user ON
(user.user_id = post.user_id)
LEFT JOIN xf_user_profile AS user_profile ON
(user_profile.user_id = post.user_id)
LEFT JOIN xf_user_privacy AS user_privacy ON
(user_privacy.user_id = post.user_id)
LEFT JOIN xf_bb_code_parse_cache AS signature_parse_cache ON
(signature_parse_cache.content_type = 'signature' AND signature_parse_cache.content_id = post.user_id)
LEFT JOIN xf_session_activity AS session_activity ON
(post.user_id > 0 AND session_activity.user_id = post.user_id AND session_activity.unique_key = CAST(post.user_id AS BINARY))
WHERE (
(post.thread_id = ? AND (post.position >= 0 AND post.position < 10) )
)
AND (post.message_state IN ('visible'))
ORDER BY post.position ASC, post.post_date ASC
Params: 216365
Run Time: 0.002206
Select Type | Table | Type | Possible Keys | Key | Key Len | Ref | Rows | Extra |
---|
SIMPLE | thread | const | PRIMARY | PRIMARY | 4 | const | 1 | Using filesort |
SIMPLE | post | range | thread_id_post_date,thread_id_position | thread_id_position | 8 | | 1 | Using index condition; Using where |
SIMPLE | bb_code_parse_cache | eq_ref | content_type_id | content_type_id | 31 | const,xenforo.cc.post.post_id | 1 | Using where |
SIMPLE | user | eq_ref | PRIMARY | PRIMARY | 4 | xenforo.cc.post.user_id | 1 | |
SIMPLE | user_profile | eq_ref | PRIMARY | PRIMARY | 4 | xenforo.cc.post.user_id | 1 | |
SIMPLE | user_privacy | eq_ref | PRIMARY | PRIMARY | 4 | xenforo.cc.post.user_id | 1 | |
SIMPLE | signature_parse_cache | eq_ref | content_type_id | content_type_id | 31 | const,xenforo.cc.post.user_id | 1 | Using where |
SIMPLE | session_activity | eq_ref | PRIMARY | PRIMARY | 22 | xenforo.cc.post.user_id,func | 1 | Using where |
INSERT INTO xf_thread_view
(thread_id)
VALUES
(?)
Params: 216365
Run Time: 0.000086
INSERT INTO `xf_session` (`session_id`, `session_data`, `expiry_date`) VALUES (?, ?, ?)
Params: 62538d041fe2d7a11e62029a89eae691, , 1714684314
Run Time: 0.000710
INSERT INTO xf_session_activity
(user_id, unique_key, ip, controller_name, controller_action, view_state, params, view_date, robot_key)
VALUES
(?, ?, ?, ?, ?, ?, ?, ?, ?)
ON DUPLICATE KEY UPDATE
ip = VALUES(ip),
controller_name = VALUES(controller_name),
controller_action = VALUES(controller_action),
view_state = VALUES(view_state),
params = VALUES(params),
view_date = VALUES(view_date),
robot_key = VALUES(robot_key)
Params: 0, , , XenForo_ControllerPublic_Thread, Index, valid, thread_id=216365, 1714680714,
Run Time: 0.000119
INSERT INTO xf_bb_code_parse_cache
(content_type, content_id, parse_tree, cache_version, cache_date)
VALUES (?, ?, ?, ?, ?)
ON DUPLICATE KEY UPDATE parse_tree = VALUES(parse_tree),
cache_version = VALUES(cache_version),
cache_date = VALUES(cache_date)
Params: post, 221798, a:16:{i:0;s:20:"下载安装编译:
";i:1;a:4:{s:3:"tag";s:4:"code";s:6:"option";N;s:8:"original";a:2:{i:0;s:6:"[CODE]";i:1;s:7:"[/CODE]";}s:8:"children";a:1:{i:0;s:120:"wget http://download.redis.io/releases/redis-stable.tar.gz
tar xzf redis-stable.tar.gz
cd redis-stable
make
make install";}}i:2;s:27:"
设置配置文件路径:
";i:3;a:4:{s:3:"tag";s:4:"code";s:6:"option";N;s:8:"original";a:2:{i:0;s:6:"[CODE]";i:1;s:7:"[/CODE]";}s:8:"children";a:1:{i:0;s:292:"mkdir -p /usr/local/redis/bin #命令目录
mkdir -p /usr/local/redis/etc #配置文件目录
mv ./redis.conf /usr/local/redis/etc/
cd src
mv mkreleasehdr.sh redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server redis-trib.rb /usr/local/redis/bin/";}}i:4;s:188:"
修改配置文件:
# vim /usr/local/redis/etc/redis.conf
修改为: daemonize yes
最后将其注册为系统服务
在/etc/init.d/目录下建立redis 文件
vim /etc/init.d/redis
";i:5;a:4:{s:3:"tag";s:4:"code";s:6:"option";N;s:8:"original";a:2:{i:0;s:6:"[CODE]";i:1;s:7:"[/CODE]";}s:8:"children";a:1:{i:0;s:1327:"###########################
#!/bin/sh
#chkconfig: 2345 10 90
#description:auto_run
PATH=/usr/local/bin:/sbin:/usr/bin:/bin
REDISPORT=6379
EXEC=/usr/local/redis/bin/redis-server
REDIS_CLI=/usr/local/redis/bin/redis-cli
PIDFILE=/var/run/redis_${REDISPORT}.pid
CONF="/usr/local/redis/etc/redis.conf"
case "$1" in
start)
if [ -f $PIDFILE ]
then
echo "$PIDFILE exists, process is already running or crashed"
else
echo "Starting Redis server..."
$EXEC $CONF
fi
if [ "$?"="0" ]
then
echo "Redis is running..."
fi
;;
stop)
if [ ! -f $PIDFILE ]
then
echo "$PIDFILE does not exist, process is not running"
else
PID=$(cat $PIDFILE)
echo "Stopping ..."
$REDIS_CLI -p $REDISPORT SHUTDOWN
while [ -x ${PIDFILE} ]
do
echo "Waiting for Redis to shutdown ..."
sleep 1
done
echo "Redis stopped"
fi
;;
restart|force-reload)
${0} stop
${0} start
;;
*)
echo "Usage: /etc/init.d/redis {start|stop|restart|force-reload}" >&2
exit 1
esac
###########################";}}i:6;s:323:"
设置权限
chmod +x /etc/init.d/redis
设置自动启动:
chkconfig redis on
启动Redis:
# /usr/local/bin/redis-server /usr/local/redis/etc/redis.conf
#关闭服务
redis-cli shutdown
或者在cli中执行shutdown
redis 127.0.0.1:6379> shutdown
清除缓存
redis-cli flushall
查看状态 :
# ps -ef | grep redis
";i:7;a:4:{s:3:"tag";s:1:"b";s:6:"option";N;s:8:"original";a:2:{i:0;s:3:"[B]";i:1;s:4:"[/B]";}s:8:"children";a:1:{i:0;s:35:"下面介绍为PHP添加redis插件";}}i:8;s:44:"
从官网下载最新的拓展,地址:";i:9;a:4:{s:3:"tag";s:3:"url";s:6:"option";N;s:8:"original";a:2:{i:0;s:5:"[URL]";i:1;s:6:"[/URL]";}s:8:"children";a:1:{i:0;s:33:"http://pecl.php.net/package/redis";}}i:10;s:6:"或者";i:11;a:4:{s:3:"tag";s:3:"url";s:6:"option";N;s:8:"original";a:2:{i:0;s:5:"[URL]";i:1;s:6:"[/URL]";}s:8:"children";a:1:{i:0;s:36:"https://github.com/phpredis/phpredis";}}i:12;s:1:"
";i:13;a:4:{s:3:"tag";s:4:"code";s:6:"option";N;s:8:"original";a:2:{i:0;s:6:"[CODE]";i:1;s:7:"[/CODE]";}s:8:"children";a:1:{i:0;s:233:"wget http://pecl.php.net/get/redis-4.0.1.tgz
tar xzf redis-4.0.1.tgz
cd redis-4.0.1
/usr/local/php/bin/phpize
./configure --prefix=/usr/local/redis/ --enable-redis --with-php-config=/usr/local/php/bin/php-config
#make && make install";}}i:14;s:39:"
把拓展添加至php.ini,重启php
";i:15;a:4:{s:3:"tag";s:4:"code";s:6:"option";N;s:8:"original";a:2:{i:0;s:6:"[CODE]";i:1;s:7:"[/CODE]";}s:8:"children";a:1:{i:0;s:91:"extension=redis.so
session.save_handler = redis
session.save_path = "tcp://localhost:6379"";}}}, 1621686945, 1714680714
Run Time: 0.000967