前言
畢業(yè)答辯告一段落但骨,接下來好好努力工作励七。
Redis遇到的一些問題
DENIED Redis is running in protected mode because protected mode is enabled, no bind address was specified, no authentication password is requested to clients. In this mode connections are only accepted from the loopback interface. If you want to connect from external computers to Redis you may adopt one of the following solutions: 1) Just disable protected mode sending the command 'CONFIG SET protected-mode no' from the loopback interface by connecting to Redis from the same host the server is running, however MAKE SURE Redis is not publicly accessible from internet if you do so. Use CONFIG REWRITE to make this change permanent. 2) Alternatively you can just disable the protected mode by editing the Redis configuration file, and setting the protected mode option to 'no', and then restarting the server. 3) If you started the server manually just for testing, restart it with the '--protected-mode no' option. 4) Setup a bind address or an authentication password. NOTE: You only need to do one of the above things in order for the server to start accepting connections from the outside.
這是redis的保護(hù)機(jī)制智袭,連接redis只能是127.0.0.1這個ip,我們遠(yuǎn)程連接是拒絕的掠抬。所以我們需要在redis.conf進(jìn)行如下配置吼野。
-
1.配置protected-mode no,禁用redis默認(rèn)保護(hù)機(jī)制。
image.png -
2.配置daemonize yes两波,讓redis后臺啟動瞳步。
image.png -
3.注釋掉bind 127.0.0.1這行代碼image.png
4.然后通過指定配置文件啟動方式啟動redis。
redis-server redis.conf
-
5.通過telnet 111.230.11.184 6379雨女,發(fā)現(xiàn)遠(yuǎn)程登錄成功谚攒。
image.png
Jmeter遇到的一些問題
- 1.設(shè)置Jmeter在linux上環(huán)境變量阳准,vim /etc/profile,進(jìn)行如下配置氛堕,然后source /etc/profile保存配置讓其生效。
export JMETER_HOME=/usr/local/apache-jmeter-4.0
export CLASSPATH=$JMETER_HOME/lib/ext/ApacheJMeter_core.jar:$JMETER_HOME/lib/jorphan.jar:$CLASSPATH
export PATH=$JMETER_HOME/bin:$PATH
MySQL遇到的問題
- 1.當(dāng)我在做秒殺商品壓測的時候野蝇,發(fā)現(xiàn)會頻繁的訪問數(shù)據(jù)庫讼稚。于是將數(shù)據(jù)源連接池中的spring.datasource.druid.inital-size(初始化連接)設(shè)置為500,spring.datasource.druid.min.idle(最小空閑連接绕沈,連接池容許保持空閑狀態(tài)的最小連接锐想,低于這個數(shù)量將會創(chuàng)建新的連接)設(shè)置為500,spring.datasource.druid.max-active(最大活動連接乍狐,連接池在同一時間能夠分配的最大活動連接的數(shù)量)設(shè)置為1000赠摇。然后看輸出臺拋出了
Data source rejected establishment of connection, message from server: "Too many connections"
。這是由于太多的連接數(shù)量超過了mysql默認(rèn)的連接數(shù)浅蚪,我們只需要在/etc/my.cnf添加如下配置(初始化連接數(shù)設(shè)置的過大藕帜,會導(dǎo)致應(yīng)用啟動變得很慢):
max_connections=1000 所有用戶連接數(shù)的最大值
max_user_connections=520 單一用戶連接數(shù)的最大值
wait_timeout=60 60s后關(guān)閉空閑連接,對正在工作的連接不受影響
- 3.學(xué)習(xí)Linux命令:netstat -anp|grep 8086惜傲,查看占用8086端口的程序的pid洽故。
- 4.學(xué)習(xí)Linux命令 :cat /var/log/mysqld.log|grep ERROR,查看mysqld.log日志文件中ERROR級別的日志內(nèi)容盗誊。
-
5.學(xué)習(xí)Linux命令:mysql -uroot -p时甚,登錄mysql。SHOW VARIABLES LIKE "%max%connec%"哈踱,查看參數(shù)配置荒适。
image.png -
6.當(dāng)我在linux下,登錄mysql后开镣,輸入show databases刀诬,發(fā)現(xiàn)沒有反應(yīng)。百度后哑子,發(fā)現(xiàn)必須要在每行命令結(jié)尾加上 \g舅列。
image.png
image.png -
7.學(xué)習(xí)Linux命令:cat /proc/meminfo,查看linux服務(wù)器當(dāng)前可用內(nèi)存肌割。真正可用的內(nèi)存=MemFree+Buffers+Cached
image.png
尾言
mayday