This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input { | |
file { | |
path => ["/data/metricslog/alive/*.log"] | |
start_position => "beginning" | |
type => "metrics-alive" | |
} | |
file { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {1..7};do | |
cd server$i | |
./stop.sh && ./start.sh | |
cd ../ | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
log_dir="/data/metricslog" | |
date_dir=`date +%Y-%m-%d --date='yesterday'` | |
cd $log_dir | |
while read line | |
do | |
mv ./nginx/$line/metrics.access.log ./nginx/$line/metrics.access.log-$date_dir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.uxin.metrics.util; | |
import com.alibaba.fastjson.JSON; | |
import com.squareup.okhttp.*; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.beans.factory.InitializingBean; | |
import org.springframework.retry.RetryCallback; | |
import org.springframework.retry.RetryContext; | |
import org.springframework.retry.backoff.BackOffPolicy; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.cd $NGINX_HOME,执行./sbin/nginx -V 查看安装参数; | |
2.得到安装参数后,添加nginx-sticky-module模块重新编译nginx, | |
./configure "之前的参数" --add-module=/nginx-sticky-module下载所在目录/nginx-sticky-module | |
make && make install | |
3.在upsteam中添加如下: | |
sticky name=srv_id expires=1h domain=uxin.com path=/; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
location = / { | |
if ($http_user_agent ~* "(Android|iPhone|iPod|Symbian|BlackBerry|Windows Phone|Mobile|J2ME)") { | |
rewrite ^ http://m.uxin.com permanent; | |
} | |
#htpasswd密码生成可用在线工具http://tool.oschina.net/htpasswd,加密方式选Crypt | |
auth_basic_user_file /data/soft/nginx/conf/htpasswd; | |
auth_basic "please input passwd, or contact YANGL"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.uxin.starclock.manage.impl; | |
import com.alibaba.fastjson.JSON; | |
import com.alibaba.fastjson.JSONObject; | |
import com.google.common.cache.Cache; | |
import com.google.common.cache.CacheBuilder; | |
import com.google.common.cache.CacheLoader; | |
import com.uxin.starclock.common.Constant; | |
import com.uxin.starclock.common.exception.BaseException; | |
import com.uxin.starclock.dto.IncallringDto; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.各个节点安装必需的包 | |
yum install -y openssh openssh-clients vim libxslt libaio | |
2.配置ssh无密码认证(个人认为可以忽略的步骤) | |
(1)修改hosts.allow 将新的IP都加进去 | |
(2)修改ssh的配置文件 允许root登录 ,再重启ssh服务 | |
(3)在一台机器上ssh所有机器,获取所有的机器的公钥,再生成自己的ssh-key,无密码登录自己,把.ssh目录打包,传到每个机器上 | |
3.修改hosts文件 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dd=`date -d yesterday "+%Y%m%d"` | |
sql="select count(1) c, status from t_customgift_${dd} where if_outapppush=1 group by status;" | |
mysql -h10.10.130.109 -ugrowth_log -pgrowth_uxin_com -Dgrowth -P3307 -e "${sql}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.uxin.metrics.client; | |
import org.apache.logging.log4j.Level; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.core.Appender; | |
import org.apache.logging.log4j.core.LoggerContext; | |
import org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender; | |
import org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy; | |
import org.apache.logging.log4j.core.appender.rolling.RolloverStrategy; | |
import org.apache.logging.log4j.core.appender.rolling.TimeBasedTriggeringPolicy; |