博文

tar: Removing leading `/' from member names

或是中文:tar: 从成员名中删除开头的“/” 首先,这其实不是一个错误,虽然是输出到了stderr里,但其实是系统的一个提示,如所述,删掉了开头的/符号,亦即,去掉了绝对路径的意思 出现此条告警,是因为指定打包目录时,给的是绝对路径,比如: # tar zcvf name.tar.gz /home/test/test_folder tar处理时,默认是将/home/test/test_folder的开头的"/"删掉,变为home/test/test_folder这种格式,这样,稍后要untar的时候,不至于将untar出来的文件直接按绝对路径覆盖了原始的文件,在很多情况下,这并非我们的原意,我们会更倾向于只是把备份文件解到一个另外的文件目录下,查看对比。所以,tar的这种默认行为其实是更合理的 也所以说,网上很多文章对此告警给出的解决方法用p选项强制tar不要删除开头的"/",其实在大多数情况下,并不是一个好的解决方法 # tar zcvfp name.tar.gz /home/test/test_folder 虽然用p选项的确不报警了,但是如上所述,消除报警一时爽,将来解压的时候很可能会灾难的 tar自己的解决方法,就是将绝对路径改为相对路径,比如在当前目录下 # cd /home/test # tar zcvf name.tar.gz test_folder 另一种方法,可以使用-C中转一下,比如 # tar zcvf name.tar.gz -C / home/test/test_folder -C /的意思是说指定目录到根目录/,然后把后面的绝对路径开始的"/"去掉,这样,也能达到既使用绝对路径,又不会有报警的目的 但是shell编程的时候,经常会使用变量,比如 # target=/home/test/test_folder # tar zcvf name.tar.gz $target 这样的话,除非定义变量的时候规避"/",否则确实没有啥好办法防止报警。但如开头所述,这其实是一条info而非error,所以个人觉得,宁可报警,也不要用p选项的好

jira日志报警Establishing SSL connection without server's identity verification is not recommended

在/export/atlassian/jira/logs/catalina.out中,每5分钟就重复3条日志:  Thu Mar 01 13:54:54 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. 如log所述,这是因为MySQL增加了安全性检查。要避免被flood,要么配成https访问,要么显性地声明禁用SSL 配SSL的方法Atlassian官网上有。不过因为手头没有CA证书,所以这里采用第2种解决方法,先避免被flood。 方法: 1. 到$JIRA_DATA目录下,我的是/export/atlassian/application-data/jira,修改dbconfig.xml文件。修改之前注意备份。这个文件一旦损坏,jira重启读不到这个文件,会重新初始化。 # vi dbconfig.xml 找到jdbc的部分,把url加个后缀,即上述log中要求的useSSL=false,如下述红色部分:   <jdbc-datasource>     <url>jdbc:mysql://localhost:3306/jira?useUn...

访问Jenkins API的几个小trick

1. 根据jenkins页面的url,加/api/xml或/api/json即可访问xml或json的输出 e.g. http://jenkinsHost/job/jobname/buildNum/plugin/api/json 2. 用pretty参数规整输出可读 e.g. http://jenkinsJob/api/json?pretty=true 3. 用depth参数指定要获取的层次 e.g. http://jenkinsJob/api/json?depth=2 4. 用&连接参数 e.g. http://jenkinsJob/api/json?depth=2&pretty=true 5. 但是用curl访问时,linux系统会将&解析为放在后台执行的命令,所以url需用引号括起来 e.g. curl 'http://jenkinsJob/api/json?depth=2&pretty=true' 6. 用tree指定要访问的node节点 e.g. http://jenkinsJob/api/json?tree=results[elements[*]] 7. 但是用curl访问时,方括号需用反斜线转义 e.g. curl -s 'http://jenkinsJob/api/json?pretty=true&tree=results\[elements\[*\]\]'

Linux(el7)+ MySQL5.7.20 + Jira7.3.8安装及配置MySQL双机主从同步

1. 先装linux,版本是Linux 3.10.0-327.28.3.el7.x86_64 2. 再装MySQL,这一步与Jira谁先装无所谓,不过先装MySQL建好库更直观些 1) 如果网络通,那么用yum方式: a) 先到MySQL网站上下载OS对应版本的yum源包,这里用el7对应的包mysql57-community-release-el7-11.noarch.rpm,然后安装yum localinstall mysql57-community-release-el7-11.noarch.rpm或者rpm -ivh mysql57-community-release-el7-11.noarch.rpm b) el7自带MariaDB的一些rpm包,比如lib库,由于MariaDB是MySQL的一个分支版本,会有冲突,所以装MySQL之前需要先卸载MariaDB的包,用 rpm -qa|grep mariadb先查一下系统里有哪些MariaDB的包mariadb-libs-5.5.44-2.el7.centos.x86_64,然后用rpm -e 包名来卸载 卸载时可能报错因为有依赖,用rpm -e --nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64,或者用yum remove mariadb-libs-5.5.44-2.el7.centos.x86_64来卸载,会自动卸载依赖的包net-snmp.x86_64 1:5.7.2-24.el7 c) 查一下yum源中的MySQL可安装版本: yum repolist all | grep mysql !mysql-connectors-community/x86_64       MySQL Connectors Community          42 !mysql-tools-community/x86_64            MySQL Tools Community ...