Showing preview only (965K chars total). Download the full file or copy to clipboard to get everything.
Repository: judasn/Linux-Tutorial
Branch: master
Commit: 80109268d5b7
Files: 184
Total size: 908.8 KB
Directory structure:
gitextract_cj_47536/
├── .editorconfig
├── .gitignore
├── LICENSE
├── README.md
├── SUMMARY.md
├── TOC.md
├── centos-settings/
│ ├── CentOS-Extra-Packages.md
│ ├── CentOS-Network-Settings.md
│ ├── Clear-Cache.md
│ ├── Clear-Tmp-Directory.md
│ ├── Close-XWindow.md
│ └── centos-settings-toc.md
├── config.json
├── favorite-file/
│ ├── Keepalived-Settings/
│ │ └── nginx_check.sh
│ ├── MySQL-Settings/
│ │ └── MySQL-5.6/
│ │ ├── 1G-Memory-Machine/
│ │ │ ├── my-for-comprehensive.cnf
│ │ │ ├── my-for-master.cnf
│ │ │ └── my-for-salve.cnf
│ │ ├── 8G-Memory-Machine/
│ │ │ └── my.cnf
│ │ └── developer/
│ │ └── my-Windows-8G-开发机.ini
│ ├── Nginx-Settings/
│ │ ├── nginx
│ │ └── nginx-front.conf
│ ├── Tomcat-Settings/
│ │ └── server.xml
│ ├── gravitee-docker-compose/
│ │ ├── README.md
│ │ ├── environments/
│ │ │ ├── ci/
│ │ │ │ └── docker-compose.yml
│ │ │ ├── demo/
│ │ │ │ ├── common.yml
│ │ │ │ ├── docker-compose-local.yml
│ │ │ │ ├── docker-compose-traefik-latest.yml
│ │ │ │ ├── docker-compose-traefik-nightly.yml
│ │ │ │ └── launch.sh
│ │ │ └── sample-apis/
│ │ │ └── docker-compose-sample-apis.yml
│ │ └── platform/
│ │ ├── docker-compose.yml
│ │ ├── mongo/
│ │ │ └── docker-entrypoint-initdb.d/
│ │ │ └── create-index.js
│ │ ├── nginx/
│ │ │ ├── nginx.conf
│ │ │ └── ssl/
│ │ │ ├── gio-selfsigned.crt
│ │ │ ├── gio-selfsigned.key
│ │ │ └── gio.pem
│ │ └── prometheus.yml
│ ├── redis/
│ │ └── redis
│ ├── shell/
│ │ ├── crontab-redis-restart.sh
│ │ ├── crontab-test.sh
│ │ ├── install_common_tool_CentOS.sh
│ │ ├── install_common_tool_ubuntu.sh
│ │ ├── install_common_vim.sh
│ │ ├── install_common_vim_zsh.sh
│ │ ├── install_docker_centos7.sh
│ │ ├── install_docker_disable_firewalld_centos7-aliyun.sh
│ │ ├── install_docker_disable_firewalld_centos7.sh
│ │ ├── install_docker_k8s_disable_firewalld_centos7-aliyun.sh
│ │ ├── install_jdk_offline_to_bash.sh
│ │ ├── install_jdk_offline_to_zsh.sh
│ │ ├── install_jdk_online.sh
│ │ ├── install_maven_offline_to_bash.sh
│ │ ├── install_maven_offline_to_zsh.sh
│ │ ├── install_mycat_offline.sh
│ │ ├── install_mysql5.6_offline_centos6.sh
│ │ ├── install_mysql5.6_offline_centos7.sh
│ │ ├── install_mysql5.7_offline_centos7.sh
│ │ ├── install_nginx_centos6.sh
│ │ ├── install_nginx_centos7.sh
│ │ ├── install_redis_centos6.sh
│ │ ├── install_redis_centos7.sh
│ │ ├── install_tomcat_centos6.sh
│ │ ├── install_tomcat_centos7.sh
│ │ ├── install_tomcat_offline_centos7.sh
│ │ ├── mysql_backup.sh
│ │ ├── repo_install_centos6.sh
│ │ ├── shell-for.sh
│ │ └── shell-with-param-demo.sh
│ └── zsh/
│ └── .zshrc
└── markdown-file/
├── Alfresco-Install-And-Usage.md
├── Ansible-Install-And-Settings.md
├── Bash-Other-Bash.md
├── Bash.md
├── CI-Install-And-Usage.md
├── CentOS-7-Install.md
├── CentOS-Install.md
├── CentOS-Virtual-Machine-Copy-Settings.md
├── CentOS.md
├── CentOS6-and-CentOS7.md
├── Confluence-Install-And-Settings.md
├── Crontab.md
├── Daemontools.md
├── Docker-Install-And-Usage.md
├── Dubbo-Install-And-Settings.md
├── ELK-Install-And-Settings.md
├── Elasticsearch-Base.md
├── FTP.md
├── FastDFS-Install-And-Settings.md
├── FastDFS-Nginx-Lua-GraphicsMagick.md
├── File-Extract-Compress.md
├── Flink-Install-And-Settings.md
├── Gitlab-Install-And-Settings.md
├── Glances-Install-And-Settings.md
├── GoAccess-Install-And-Settings.md
├── Grafana-Install-And-Settings.md
├── Hadoop-Install-And-Settings.md
├── Harbor-Install-And-Usage.md
├── Hsk-Install.md
├── Influxdb-Install-And-Settings.md
├── Iptables.md
├── JDK-Install.md
├── JMeter-Install-And-Settings.md
├── Java-bin.md
├── Jenkins-Install-And-Settings.md
├── Jira-Install-And-Settings.md
├── K8S-Install-And-Usage.md
├── Kafka-Install-And-Settings.md
├── Kibana-Base.md
├── Kubernetes-Install-And-Usage.md
├── LDAP-Install-And-Settings.md
├── Linux.md
├── Logstash-Base.md
├── Maven-Install-And-Settings.md
├── MongoDB-Install-And-Settings.md
├── Mycat-Install-And-Settings.md
├── Mysql-Install-And-Settings.md
├── Mysql-Optimize.md
├── Mysql-Test.md
├── Mysql-Tutorial.md
├── NFS.md
├── NTP.md
├── Nexus-Install-And-Settings.md
├── Nginx-Install-And-Settings.md
├── Nginx-Keepalived-Install-And-Settings.md
├── Nmon.md
├── Node-Install-And-Usage.md
├── Off-line-Yum-Install.md
├── Openfire-Install-And-Settings.md
├── PXC-Install-And-Settings.md
├── Portainer-Install-And-Settings.md
├── PostgreSQL-Install-And-Settings.md
├── Prometheus-Install-And-Settings.md
├── Python-Ubuntu.md
├── RabbitMQ-Install-And-Settings.md
├── Rap-Install-And-Settings.md
├── Redis-Install-And-Settings.md
├── SSH-login-without-password.md
├── SSH.md
├── SSR-Client-Ubuntu.md
├── SVN-Install-And-Settings.md
├── Samba.md
├── Sed.md
├── Shell.md
├── Showdoc-Install-And-Settings.md
├── SkyWalking-Install-And-Settings.md
├── Solr-Install-And-Settings.md
├── SonarQube-Install-And-Usage.md
├── Spark-Install-And-Settings.md
├── TeamCity-Install-And-Settings.md
├── Thrift-Install-And-Usage.md
├── Tmux-Install-And-Settings.md
├── Tomcat-Install-And-Settings.md
├── Ubuntu-Install-VMware.md
├── Ubuntu-Install.md
├── Ubuntu-Popular-Software.md
├── Ubuntu-Specific-Command.md
├── Ubuntu.md
├── VPN.md
├── Vim-Install-And-Settings.md
├── Was-Hacked.md
├── WordPress-Install-And-Settings.md
├── Wormhole-Install-And-Settings.md
├── YApi-Install-And-Settings.md
├── Zabbix-Install-And-Settings.md
├── Zookeeper-Install.md
├── Zsh.md
├── kali-linux-settings/
│ ├── kali-linux-basic-settings.md
│ ├── kali-linux-install.md
│ ├── kali-linux-penetration-test.md
│ ├── kali-linux-social-engineering.md
│ ├── kali-linux-sql-injection.md
│ └── kali-linux-toc.md
├── maintenance.md
├── monitor.md
├── other.md
├── shell-safe-rm.md
├── speedtest.md
├── ubuntu-settings/
│ ├── Network-Settings.md
│ ├── Ubuntu-Create-Desktop.md
│ ├── Ubuntu-Extra-Packages.md
│ ├── Ubuntu-Popular-Settings.md
│ ├── Ubuntu-UI.md
│ └── ubuntu-settings-toc.md
└── wrk-Install-And-Settings.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
# http://editorconfig.org
# 官网首页有介绍:IntelliJ IDEA,VS Code 默认就支持,无需额外安装插件
root = true
# 空格替代Tab缩进在各种编辑工具下效果一致
[*]
indent_style = space
indent_size = 4
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 200
[*.java]
indent_style = tab
[*.{json,yml}]
indent_size = 2
[*.md]
insert_final_newline = false
trim_trailing_whitespace = false
================================================
FILE: .gitignore
================================================
build/
out/
log/
logs/
public/
target/
node_modules/
classes/
.deploy*/
.gradle
*.log.*
*.log
.DS_Store
Thumbs.db
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
nbproject/private/
build/
nbbuild/
dist/
nbdist/
.nb-gradle/
================================================
FILE: LICENSE
================================================
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc., <http://fsf.org/>
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{description}
Copyright (C) {year} {fullname}
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
{signature of Ty Coon}, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
================================================
FILE: README.md
================================================
## 作者新方向,感谢支持
- [从开公司到开发全平台产品(文字版)](https://github.com/cdk8s/cdk8s-team-style/blob/master/full-stack/README.md)
- [从开公司到开发全平台产品(视频版)](https://space.bilibili.com/1765486559/channel/seriesdetail?sid=2359281)
## 初衷(Original Intention)
- 整理下自己所学。**但是比较随意,所以很多地方不够严谨,所以请带着批评的思维阅读。**
- 带动更多的人进入 Linux 世界,特别是做 Java 开发的人
- Github 项目地址,欢迎 `Fork`、`Star`:<https://github.com/judasn/Linux-Tutorial>
- 文章中用到的一些安装包归纳整理:<http://pan.baidu.com/s/1skAwrFn>
- Gitbook 在线阅读地址:<https://youmeek.gitbooks.io/linux-tutorial/content/>
- **学得越多越是明白一个人的力量是不够的,我只是起了一个引子,希望你能一起参与,真心希望!!!(鞠躬)**
## 优秀同行推荐
- [Linux工具快速教程](http://linuxtools-rst.readthedocs.io/zh_CN/latest/base/index.html)
## 目录(Contents)
- [Linux 介绍](markdown-file/Linux.md)
- [Ubuntu 介绍](markdown-file/Ubuntu.md)
- [Ubuntu 安装](markdown-file/Ubuntu-Install.md)
- [Ubuntu 设置(目录)](markdown-file/ubuntu-settings/ubuntu-settings-toc.md)
- [Kali Linux 介绍和设置(目录)](markdown-file/kali-linux-settings/kali-linux-toc.md)
- [CentOS 介绍](markdown-file/CentOS.md)
- [CentOS 6 安装](markdown-file/CentOS-Install.md)
- [CentOS 7 安装](markdown-file/CentOS-7-Install.md)
- [CentOS 6 和 CentOS 7 差异](markdown-file/CentOS6-and-CentOS7.md)
- [CentOS 设置(目录)](markdown-file/centos-settings/centos-settings-toc.md)
- [Ubuntu 安装 VMware](markdown-file/Ubuntu-Install-VMware.md)
- [VMware 克隆 CentOS 后网卡信息修改](markdown-file/CentOS-Virtual-Machine-Copy-Settings.md)
- [Vim 安装、配置、快捷键列表](markdown-file/Vim-Install-And-Settings.md)
- [SSH 免密登录](markdown-file/SSH-login-without-password.md)
- [Bash 命令](markdown-file/Bash.md)
- [Bash 其他常用命令](markdown-file/Bash-Other-Bash.md)
- [安装的 rm(删除)](markdown-file/shell-safe-rm.md)
- [Sed 命令](markdown-file/Sed.md)
- [Linux 下常用压缩文件的解压、压缩](markdown-file/File-Extract-Compress.md)
- [Yum 下载安装包及对应依赖包](markdown-file/Off-line-Yum-Install.md)
- [Zsh 入门](markdown-file/Zsh.md)
================================================
FILE: SUMMARY.md
================================================
# Java 程序员眼中的 Linux
* [Linux 介绍](markdown-file/Linux.md)
* [Ubuntu 介绍](markdown-file/Ubuntu.md)
* [Ubuntu 安装](markdown-file/Ubuntu-Install.md)
* [Ubuntu 设置(目录)](markdown-file/ubuntu-settings/ubuntu-settings-toc.md)
* [Kali Linux 介绍和设置(目录)](markdown-file/kali-linux-settings/kali-linux-toc.md)
* [CentOS 介绍](markdown-file/CentOS.md)
* [CentOS 6 安装](markdown-file/CentOS-Install.md)
* [CentOS 7 安装](markdown-file/CentOS-7-Install.md)
* [CentOS 6 和 CentOS 7 差异](markdown-file/CentOS6-and-CentOS7.md)
* [CentOS 设置(目录)](markdown-file/centos-settings/centos-settings-toc.md)
* [Ubuntu 安装 VMware](markdown-file/Ubuntu-Install-VMware.md)
* [VMware 克隆 CentOS 后网卡信息修改](markdown-file/CentOS-Virtual-Machine-Copy-Settings.md)
* [Vim 安装、配置、快捷键列表](markdown-file/Vim-Install-And-Settings.md)
* [SSH 免密登录](markdown-file/SSH-login-without-password.md)
* [Bash 命令](markdown-file/Bash.md)
* [Bash 其他常用命令](markdown-file/Bash-Other-Bash.md)
* [安装的 rm(删除)](markdown-file/shell-safe-rm.md)
* [Sed 命令](markdown-file/Sed.md)
* [Linux 下常用压缩文件的解压、压缩](markdown-file/File-Extract-Compress.md)
* [Yum 下载安装包及对应依赖包](markdown-file/Off-line-Yum-Install.md)
* [Zsh 入门](markdown-file/Zsh.md)
* [终端测速](markdown-file/speedtest.md)
* [日常维护](markdown-file/maintenance.md)
* [日常监控](markdown-file/monitor.md)
* [nmon 系统性能监控工具](markdown-file/Nmon.md)
* [Glances 安装和配置](markdown-file/Glances-Install-And-Settings.md)
* [SSH(Secure Shell)介绍](markdown-file/SSH.md)
* [FTP(File Transfer Protocol)介绍](markdown-file/FTP.md)
* [VPN(Virtual Private Network)介绍](markdown-file/VPN.md)
* [NFS(Network FileSystem)介绍](markdown-file/NFS.md)
* [NTP(Network Time Protocol)介绍](markdown-file/NTP.md)
* [Samba 介绍](markdown-file/Samba.md)
* [Crontab 介绍](markdown-file/Crontab.md)
* [Iptables 介绍](markdown-file/Iptables.md)
* [花生壳-安装介绍](markdown-file/Hsk-Install.md)
* [JDK 安装](markdown-file/JDK-Install.md)
* [Java bin 目录下的工具](markdown-file/Java-bin.md)
* [SVN 安装和配置](markdown-file/SVN-Install-And-Settings.md)
* [Tomcat 安装和配置、优化](markdown-file/Tomcat-Install-And-Settings.md)
* [Jenkins 安装和配置](markdown-file/Jenkins-Install-And-Settings.md)
* [Maven 安装和配置](markdown-file/Maven-Install-And-Settings.md)
* [Nexus 安装和配置](markdown-file/Nexus-Install-And-Settings.md)
* [PostgreSQL 安装和配置](markdown-file/PostgreSQL-Install-And-Settings.md)
* [MySQL 安装和配置](markdown-file/Mysql-Install-And-Settings.md)
* [MySQL 优化](markdown-file/Mysql-Optimize.md)
* [MySQL 测试](markdown-file/Mysql-Test.md)
* [MySQL 教程](markdown-file/Mysql-Tutorial.md)
* [Percona XtraDB Cluster(PXC)安装和配置](markdown-file/PXC-Install-And-Settings.md)
* [Redis 安装和配置](markdown-file/Redis-Install-And-Settings.md)
* [MongoDB 安装和配置](markdown-file/MongoDB-Install-And-Settings.md)
* [Solr 安装和配置](markdown-file/Solr-Install-And-Settings.md)
* [Jira 安装和配置](markdown-file/Jira-Install-And-Settings.md)
* [Confluence 安装和配置](markdown-file/Confluence-Install-And-Settings.md)
* [Jenkins 安装和配置](markdown-file/Jenkins-Install-And-Settings.md)
* [TeamCity 安装和配置](markdown-file/TeamCity-Install-And-Settings.md)
* [Nginx 安装和配置](markdown-file/Nginx-Install-And-Settings.md)
* [wrk 安装和配置](markdown-file/wrk-Install-And-Settings.md)
* [FastDFS 安装和配置](markdown-file/FastDFS-Install-And-Settings.md)
* [FastDFS 结合 GraphicsMagick](markdown-file/FastDFS-Nginx-Lua-GraphicsMagick.md)
* [RabbitMQ 安装和配置](markdown-file/RabbitMQ-Install-And-Settings.md)
* [Openfire 安装和配置](markdown-file/Openfire-Install-And-Settings.md)
* [Rap 安装和配置](markdown-file/Rap-Install-And-Settings.md)
* [Nginx + Keepalived 高可用](markdown-file/Nginx-Keepalived-Install-And-Settings.md)
* [黑客入侵检查](markdown-file/Was-Hacked.md)
* [Shadowsocks 安装和配置](markdown-file/http://code.youmeek.com/2016/08/19/2016/08/VPS/)
* [Mycat 安装和配置](markdown-file/Mycat-Install-And-Settings.md)
* [Zookeeper 安装和配置](markdown-file/Zookeeper-Install.md)
* [Daemontools 工具介绍](markdown-file/Daemontools.md)
* [Tmux 安装和配置](markdown-file/Tmux-Install-And-Settings.md)
* [ELK 日志收集系统安装和配置](markdown-file/ELK-Install-And-Settings.md)
* [Dubbo 安装和配置](markdown-file/Dubbo-Install-And-Settings.md)
* [GitLab 安装和配置](markdown-file/Gitlab-Install-And-Settings.md)
* [JMeter 安装和配置](markdown-file/JMeter-Install-And-Settings.md)
* [Docker 安装和使用](markdown-file/Docker-Install-And-Usage.md)
* [Harbor 安装和配置](markdown-file/Harbor-Install-And-Usage.md)
* [LDAP 安装和使用](markdown-file/LDAP-Install-And-Settings.md)
* [Alfresco 安装和使用](markdown-file/Alfresco-Install-And-Usage.md)
* [Apache Thrift 安装和使用](markdown-file/Thrift-Install-And-Usage.md)
* [Node.js 安装和使用](markdown-file/Node-Install-And-Usage.md)
* [CI 整套服务安装和使用](markdown-file/CI-Install-And-Usage.md)
* [YApi 安装和配置](markdown-file/YApi-Install-And-Settings.md)
* [Kafka 安装和配置](markdown-file/Kafka-Install-And-Settings.md)
* [Hadoop 安装和配置](markdown-file/Hadoop-Install-And-Settings.md)
* [Showdoc 安装和配置](markdown-file/Showdoc-Install-And-Settings.md)
* [WordPress 安装和配置](markdown-file/WordPress-Install-And-Settings.md)
* [GoAccess 安装和配置](markdown-file/GoAccess-Install-And-Settings.md)
* [Portainer 安装和配置](markdown-file/Portainer-Install-And-Settings.md)
* [Influxdb 安装和配置](markdown-file/Influxdb-Install-And-Settings.md)
* [Prometheus 安装和配置](markdown-file/Prometheus-Install-And-Settings.md)
* [Grafana 安装和配置](markdown-file/Grafana-Install-And-Settings.md)
* [Ansible 安装和配置](markdown-file/Ansible-Install-And-Settings.md)
* [Wormhole + Flink 安装和配置](markdown-file/Wormhole-Install-And-Settings.md)
* [SkyWalking 安装和配置](markdown-file/SkyWalking-Install-And-Settings.md)
================================================
FILE: TOC.md
================================================
- [Linux 介绍](markdown-file/Linux.md)
- [Ubuntu 介绍](markdown-file/Ubuntu.md)
- [Ubuntu 安装](markdown-file/Ubuntu-Install.md)
- [Ubuntu 设置(目录)](markdown-file/ubuntu-settings/ubuntu-settings-toc.md)
- [Kali Linux 介绍和设置(目录)](markdown-file/kali-linux-settings/kali-linux-toc.md)
- [CentOS 介绍](markdown-file/CentOS.md)
- [CentOS 6 安装](markdown-file/CentOS-Install.md)
- [CentOS 7 安装](markdown-file/CentOS-7-Install.md)
- [CentOS 6 和 CentOS 7 差异](markdown-file/CentOS6-and-CentOS7.md)
- [CentOS 设置(目录)](markdown-file/centos-settings/centos-settings-toc.md)
- [Ubuntu 安装 VMware](markdown-file/Ubuntu-Install-VMware.md)
- [VMware 克隆 CentOS 后网卡信息修改](markdown-file/CentOS-Virtual-Machine-Copy-Settings.md)
- [Vim 安装、配置、快捷键列表](markdown-file/Vim-Install-And-Settings.md)
- [SSH 免密登录](markdown-file/SSH-login-without-password.md)
- [Bash 命令](markdown-file/Bash.md)
- [Bash 其他常用命令](markdown-file/Bash-Other-Bash.md)
- [安装的 rm(删除)](markdown-file/shell-safe-rm.md)
- [Sed 命令](markdown-file/Sed.md)
- [Linux 下常用压缩文件的解压、压缩](markdown-file/File-Extract-Compress.md)
- [Yum 下载安装包及对应依赖包](markdown-file/Off-line-Yum-Install.md)
- [Zsh 入门](markdown-file/Zsh.md)
- [终端测速](markdown-file/speedtest.md)
- [日常维护](markdown-file/maintenance.md)
- [日常监控](markdown-file/monitor.md)
- [nmon 系统性能监控工具](markdown-file/Nmon.md)
- [Glances 安装和配置](markdown-file/Glances-Install-And-Settings.md)
- [SSH(Secure Shell)介绍](markdown-file/SSH.md)
- [FTP(File Transfer Protocol)介绍](markdown-file/FTP.md)
- [VPN(Virtual Private Network)介绍](markdown-file/VPN.md)
- [NFS(Network FileSystem)介绍](markdown-file/NFS.md)
- [NTP(Network Time Protocol)介绍](markdown-file/NTP.md)
- [Samba 介绍](markdown-file/Samba.md)
- [Crontab 介绍](markdown-file/Crontab.md)
- [Iptables 介绍](markdown-file/Iptables.md)
- [花生壳-安装介绍](markdown-file/Hsk-Install.md)
- [JDK 安装](markdown-file/JDK-Install.md)
- [Java bin 目录下的工具](markdown-file/Java-bin.md)
- [SVN 安装和配置](markdown-file/SVN-Install-And-Settings.md)
- [Tomcat 安装和配置、优化](markdown-file/Tomcat-Install-And-Settings.md)
- [Jenkins 安装和配置](markdown-file/Jenkins-Install-And-Settings.md)
- [Maven 安装和配置](markdown-file/Maven-Install-And-Settings.md)
- [Nexus 安装和配置](markdown-file/Nexus-Install-And-Settings.md)
- [PostgreSQL 安装和配置](markdown-file/PostgreSQL-Install-And-Settings.md)
- [MySQL 安装和配置](markdown-file/Mysql-Install-And-Settings.md)
- [MySQL 优化](markdown-file/Mysql-Optimize.md)
- [MySQL 测试](markdown-file/Mysql-Test.md)
- [MySQL 教程](markdown-file/Mysql-Tutorial.md)
- [Percona XtraDB Cluster(PXC)安装和配置](markdown-file/PXC-Install-And-Settings.md)
- [Redis 安装和配置](markdown-file/Redis-Install-And-Settings.md)
- [MongoDB 安装和配置](markdown-file/MongoDB-Install-And-Settings.md)
- [Solr 安装和配置](markdown-file/Solr-Install-And-Settings.md)
- [Jira 安装和配置](markdown-file/Jira-Install-And-Settings.md)
- [Confluence 安装和配置](markdown-file/Confluence-Install-And-Settings.md)
- [Jenkins 安装和配置](markdown-file/Jenkins-Install-And-Settings.md)
- [TeamCity 安装和配置](markdown-file/TeamCity-Install-And-Settings.md)
- [Nginx 安装和配置](markdown-file/Nginx-Install-And-Settings.md)
- [wrk 安装和配置](markdown-file/wrk-Install-And-Settings.md)
- [FastDFS 安装和配置](markdown-file/FastDFS-Install-And-Settings.md)
- [FastDFS 结合 GraphicsMagick](markdown-file/FastDFS-Nginx-Lua-GraphicsMagick.md)
- [RabbitMQ 安装和配置](markdown-file/RabbitMQ-Install-And-Settings.md)
- [Openfire 安装和配置](markdown-file/Openfire-Install-And-Settings.md)
- [Rap 安装和配置](markdown-file/Rap-Install-And-Settings.md)
- [Nginx + Keepalived 高可用](markdown-file/Nginx-Keepalived-Install-And-Settings.md)
- [黑客入侵检查](markdown-file/Was-Hacked.md)
- [Shadowsocks 安装和配置](markdown-file/http://code.youmeek.com/2016/08/19/2016/08/VPS/)
- [Mycat 安装和配置](markdown-file/Mycat-Install-And-Settings.md)
- [Zookeeper 安装和配置](markdown-file/Zookeeper-Install.md)
- [Daemontools 工具介绍](markdown-file/Daemontools.md)
- [Tmux 安装和配置](markdown-file/Tmux-Install-And-Settings.md)
- [ELK 日志收集系统安装和配置](markdown-file/ELK-Install-And-Settings.md)
- [Dubbo 安装和配置](markdown-file/Dubbo-Install-And-Settings.md)
- [GitLab 安装和配置](markdown-file/Gitlab-Install-And-Settings.md)
- [JMeter 安装和配置](markdown-file/JMeter-Install-And-Settings.md)
- [Docker 安装和使用](markdown-file/Docker-Install-And-Usage.md)
- [Harbor 安装和配置](markdown-file/Harbor-Install-And-Usage.md)
- [LDAP 安装和使用](markdown-file/LDAP-Install-And-Settings.md)
- [Alfresco 安装和使用](markdown-file/Alfresco-Install-And-Usage.md)
- [Apache Thrift 安装和使用](markdown-file/Thrift-Install-And-Usage.md)
- [Node.js 安装和使用](markdown-file/Node-Install-And-Usage.md)
- [YApi 安装和配置](markdown-file/YApi-Install-And-Settings.md)
- [Kafka 安装和配置](markdown-file/Kafka-Install-And-Settings.md)
- [Hadoop 安装和配置](markdown-file/Hadoop-Install-And-Settings.md)
- [Showdoc 安装和配置](markdown-file/Showdoc-Install-And-Settings.md)
- [WordPress 安装和配置](markdown-file/WordPress-Install-And-Settings.md)
- [GoAccess 安装和配置](markdown-file/GoAccess-Install-And-Settings.md)
- [Portainer 安装和配置](markdown-file/Portainer-Install-And-Settings.md)
- [Influxdb 安装和配置](markdown-file/Influxdb-Install-And-Settings.md)
- [Prometheus 安装和配置](markdown-file/Prometheus-Install-And-Settings.md)
- [Grafana 安装和配置](markdown-file/Grafana-Install-And-Settings.md)
- [Ansible 安装和配置](markdown-file/Ansible-Install-And-Settings.md)
- [Wormhole + Flink 安装和配置](markdown-file/Wormhole-Install-And-Settings.md)
- [SkyWalking 安装和配置](markdown-file/SkyWalking-Install-And-Settings.md)
================================================
FILE: centos-settings/CentOS-Extra-Packages.md
================================================
# CentOS 源设置
## 修改官方源
- 下面内容的一个简易集合版本脚本:<http://pan.baidu.com/s/1hrdnbi0>
## 修改官方源
> 国内常用源配置方法(该源和官方源是一样的,只是因为服务器在国内会起到加速作用而已):
- 163 源:<http://mirrors.163.com/.help/centos.html>
- 阿里源:<http://mirrors.aliyun.com/help/centos>
- sohu:<http://mirrors.sohu.com/help/centos.html>
> CentOS 6 替换过程(这里以 163 源为例):
- 备份官网源:`sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.20151219.backup`
- `cd /etc/yum.repos.d/`
- 下载对应版本 repo 文件, 放入 **/etc/yum.repos.d/**
- 下载源文件:
- CentOS6:`sudo wget http://mirrors.163.com/.help/CentOS6-Base-163.repo`
- `sudo mv CentOS6-Base-163.repo CentOS-Base.repo`
- 导入key:`rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6`
- `sudo yum clean all`
- `sudo yum makecache`
- `sudo yum update -y`
> CentOS 7 替换过程(这里以 163 源为例):
- 备份官网源:`sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.20170219.backup`
- `cd /etc/yum.repos.d/`
- 下载对应版本 repo 文件, 放入 **/etc/yum.repos.d/**
- 下载源文件:
- CentOS7:`sudo wget http://mirrors.163.com/.help/CentOS7-Base-163.repo`
- `sudo mv CentOS7-Base-163.repo CentOS-Base.repo`
- 导入key:`rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7`
- `sudo yum clean all`
- `sudo yum makecache`
- `sudo yum update -y`
## 第三方源
> 加入第三方源主要是为了 yum 下载到官方没有提供的软件,在其他社区、第三方源里面有很多的软件包,有些软件是很好用的。CentOS 可以加入多个源,所以就存在一个源的优先级问题了,设置优先级的可以使用 yum-plugin-priorities 工具。一般我是建议官方的优先级是最高的,然后才是第三方的。
- 安装 yum-plugin-priorities:
- CentOS 4 或 CentOS 6:`sudo yum install -y yum-plugin-priorities`
- CentOS 5:`sudo yum install -y yum-priorities`
- 安装完 yum-plugin-priorities 插件后,默认是开启的,如果要关闭可以这样设置:
- `sudo vim /etc/yum/pluginconf.d/priorities.conf`
- 把 enabled=1 改为 enabled=0 即可
- 设置默认源的优先级:
- 一般默认的源配置里面 [base], [updates], [extras],[centosplus] 的 priority=1, [contrib] 的 priority=2,其他第三的软件源为:priority=N (推荐 N > 10,N 可以为1到99的正整数,数值越小越优先)
- `sudo vim /etc/yum.repos.d/CentOS-Base.repo`
- 配置内容如下图
- 
- 安装 EPEL 源:
- 官网中文材料:<https://fedoraproject.org/wiki/EPEL/zh-cn>
- 安装命令:`sudo yum install -y epel-release`
- CentOS 6 导入 KEY:`rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6`
- CentOS 7 导入 KEY:`rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7`
- 设置 EPEL 源的级别:`vim /etc/yum.repos.d/epel.repo`,追加:priority=11
- 卸载 EPEL 源
- 如果你暂时不想使用 EPEL 源的话,把 epel.repo 里的 enabled=1 改成 enabled=0 即可,如果你完全不需要了,那就直接卸载掉 `sudo rpm -e epel-release`
- 安装 RepoForge 源:(旧的名字为 rpmforge)
- 官网下载 RPM包:<http://repoforge.org/use/>
- 我是 CentOS 6.7 64 位,所以下载 EL 6 x86_64,下载 RMP 安装文件大小:12.3 KB
- 下载命令:`wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm`(我这边 wget 不下来,需要开 VPN,所以你最好有这个心理准备)
- 安装 RPM 文件:`sudo rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm`
- 导入 KEY:`sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag`
- 设置 RepoForge 源的级别:`vim /etc/yum.repos.d/rpmforge.repo`,设置如下图
- 
- 更新包信息:
- `sudo yum clean all`
- `sudo yum makecache`
- `sudo yum update -y`
- 测试:
- 命令:`sudo yum check-update`
- 看到显示的结果中包括 rpmforge 和 epel 的列表表示成功。
- `sudo yum install -y htop`(htop 官方源是没有的,所以如果能下载下来就表示已经使用了第三方源)
### 禁用源
- 编辑:`vim /etc/yum.repos.d/elasticsearch.repo`
- 把 enabled=1 改为 enabled=0
```
[elasticsearch-6.x]
name=Elasticsearch repository for 6.x packages
baseurl=https://artifacts.elastic.co/packages/6.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md
```
> 资料:
- <https://wiki.centos.org/zh/PackageManagement/Yum/Priorities>
- <http://www.cnblogs.com/Security-Darren/p/3947952.html>
- <http://freeloda.blog.51cto.com/2033581/1260824>
- <http://www.centoscn.com/CentOS/config/2014/0920/3793.html>
- <http://www.cnblogs.com/mchina/archive/2013/01/04/2842275.html>
- <http://www.ha97.com/2626.html>
================================================
FILE: centos-settings/CentOS-Network-Settings.md
================================================
# CentOS 网络设置
- 由于前面虚拟机中安装 CentOS 使用的是桥接模式,为了让虚拟机中的系统能上网,我们需要进行网络设置。
## CentOS 6
### 界面化下设置网络(新手推荐使用这种)
- 
- 选择上图箭头所示
- 
- 如上图标注 3 所示:选择 `手动` 模式
- 如上图标注 4 所示:填写自己局域网内的子网掩码、默认网关,以及你要分配的内网 IP 地址。这三个参数你可以参考你当前使用的主机信息,在 Windows 系统上使用:`cmd --- ipconfig`,查看你当前连接的网卡信息。如果你是无线网卡则读取对应的无线网卡信息,如果你是本地连接,则读取对应的本地连接信息。
- 如上图标注 5 所示:填写你当前地区合适的 DNS 地址,我这边地区使用 360 测试出来的结果显示 114 的适合我,所以我这里填写该值
### 命令行下设置网络
- 编辑网卡信息:
- 备份:`cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0-20160205Back`
- 把备份文件移动到其他目录:`mv /etc/sysconfig/network-scripts/ifcfg-eth0-20160205Back /opt/myBack`
- 编辑网卡文件:`vim /etc/sysconfig/network-scripts/ifcfg-eth0`
- 把网卡中信息改为下面对应内容:
```
DEVICE=eth0 (系统默认值)
TYPE=Ethernet (系统默认值)
UUID=a2c17f0c-a224-43d5-a203-48af1f0d9113 (系统默认值)
ONBOOT=yes (系统默认值是 no,我改为 yes)
NM_CONTROLLED=yes (系统默认值)
BOOTPROTO=none (系统默认值是 dhcp,我改为 none,代表手动)
USERCTL=no (自己补充的)
IPV6INIT=no (自己补充的)
NETMASK=255.255.255.0 (自己补充的)
IPADDR=192.168.0.110 (自己补充的)
GATEWAY=192.168.0.1 (自己补充的)
DNS1=114.114.114.114 (自己补充的)
PREFIX=24 (使用图形界面设置后生成的)
DEFROUTE=yes (使用图形界面设置后生成的)
IPV4_FAILURE_FATAL=yes (使用图形界面设置后生成的)
NAME="System eth0" (使用图形界面设置后生成的)
HWADDR=00:0C:29:A9:37:D4 (使用图形界面设置后生成的)
LAST_CONNECT=1454626679 (使用图形界面设置后生成的)
```
- 重启网络配置:`service network restart`
## CentOS 7.x
### 命令行下设置网络
- 查看系统下有哪些网卡:`ls /etc/sysconfig/network-scripts/`,新版本不叫 eth0 这类格式了,比如我当前这个叫做:ifcfg-ens33(你的肯定跟我不一样,但是格式类似)
- 先备份:`cp /etc/sysconfig/network-scripts/ifcfg-ens33 /etc/sysconfig/network-scripts/ifcfg-ens33.bak`
- 编辑该文件:`vim /etc/sysconfig/network-scripts/ifcfg-ens33`,改为如下信息:(IP 段自己改为自己的网络情况)
``` ini
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
IPADDR=192.168.0.127
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=8.8.8.8
DNS1=114.114.114.114
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=b9f01b7d-4ebf-4d3a-a4ec-ae203425bb11
DEVICE=ens33
ONBOOT=yes
```
- 修改后,重启网络服务:`systemctl restart network.service`
================================================
FILE: centos-settings/Clear-Cache.md
================================================
## 清除系统缓存
## 初衷
- 本身 Linux 有比较成熟的内存管理机制,但是不免也是会抽风的,有些程序在被 kill 掉之后系统内存依然没有大的变化,这时候就需要手动清除。
## 清除缓存
- 官网说明:<http://www.kernel.org/doc/Documentation/sysctl/vm.txt>
- 先查看目前系统内存使用情况:`free -m`
- 同步缓存数据到硬盘:`sync`
- 开始清理:`echo 3 > /proc/sys/vm/drop_caches`
- 0:不清除
- 1:清除页缓存
- 2:清除目录项缓存与文件结点缓存
- 3:清除所有缓存(常用)
- 再查看清除后效果:`free -m`
================================================
FILE: centos-settings/Clear-Tmp-Directory.md
================================================
## 修改定时清理 /tmp 目录下的文件
## 初衷
- 默认系统是超过 30 天不访问的文件自动清除的,但是有时候硬盘用得紧可以考虑修改周期
## 设置方法
- 编辑配置文件:`vim /etc/cron.daily/tmpwatch`
``` nginx
#! /bin/sh
flags=-umc
/usr/sbin/tmpwatch "$flags" -x /tmp/.X11-unix -x /tmp/.XIM-unix \
-x /tmp/.font-unix -x /tmp/.ICE-unix -x /tmp/.Test-unix \
-X '/tmp/hsperfdata_*' 10d /tmp
/usr/sbin/tmpwatch "$flags" 30d /var/tmp
for d in /var/{cache/man,catman}/{cat?,X11R6/cat?,local/cat?}; do
if [ -d "$d" ]; then
/usr/sbin/tmpwatch "$flags" -f 30d "$d"
fi
done
```
- 上面这句话:`/usr/sbin/tmpwatch "$flags" -f 30d "$d"`,其中 **30d** 表示 30 天表示要备删除的周期文件,该值最低为 1。
- 一般数据建议不要放在这个目录下,以免被系统误删
================================================
FILE: centos-settings/Close-XWindow.md
================================================
## CentOS 图形界面的关闭与开启
## 初衷
- 本地开多个虚拟机搞集群测试,为了节省资源,关掉图形界面更好点
## CentOS 6 设置方法
- 编辑配置文件:`vim /etc/inittab`
- 把默认值:`id:5:initdefault:`,改为:`id:3:initdefault:`
- 重启系统:`reboot`,重启后就只有 shell 界面了。
- 在 shell 界面中如果你还希望临时开启图形界面可以输入:`init 5`
- 在图形界面中如果你希望临时关闭图形界面可以输入:`init 3`
## CentOS 7 设置方法 1
- 开机以命令模式启动,执行:
- systemctl set-default multi-user.target
- 开机以图形界面启动,执行:
- systemctl set-default graphical.target
## CentOS 7 设置方法 2
- 关闭图形
- `mv /etc/systemd/system/default.target /etc/systemd/system/default.target.bak` (改名备份)
- `ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target` (重新软连接文本界面为启动默认值界面)
- `systemctl reboot` (重启)
- 恢复图形界面
- `rm -rf /etc/systemd/system/default.target` (移除当前配置链接)
- `mv /etc/systemd/system/default.target.bak /etc/systemd/system/default.target` (恢复备份配置链接)
- `systemctl reboot`
================================================
FILE: centos-settings/centos-settings-toc.md
================================================
- [CentOS 网络设置](CentOS-Network-Settings.md)
- [CentOS 源设置](CentOS-Extra-Packages.md)
- [CentOS 图形界面的关闭与开启](Close-XWindow.md)
- [清除系统缓存](Clear-Cache.md)
- [修改定时清理 /tmp 目录下的文件](Clear-Tmp-Directory.md)
================================================
FILE: config.json
================================================
{
"name": "Java 程序员眼中的 Linux",
"introduction": "笔者从 Java 开发角度,全方位讲解各种环境搭建及常用工具详解,是一部适合程序员的百科全书。"
}
================================================
FILE: favorite-file/Keepalived-Settings/nginx_check.sh
================================================
#!/bin/bash
# 如果进程中没有nginx则将keepalived进程kill掉
A=`ps -C nginx --no-header |wc -l` ## 查看是否有 nginx进程 把值赋给变量A
if [ $A -eq 0 ];then ## 如果没有进程值得为 零
service keepalived stop ## 则结束 keepalived 进程
fi
================================================
FILE: favorite-file/MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-comprehensive.cnf
================================================
# 适用于 Mysql 5.6
# 该配置适合 1G 内存左右的机子,储存类型为 InnoDB
# 官网配置说明:http://dev.mysql.com/doc/refman/5.6/en/mysqld-option-tables.html
# 官网状态值说明:http://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html
# 官网环境变量说明:http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html
# 在线生成配置工具:http://tools.percona.com(只是起到一个参考作用,生成的配置文件里面的参数名有的是用符号:-,而官网是用:_,所以这个也要注意改掉。)
# 资料参考:https://blog.linuxeye.com/379.html
# 注释内容为注释行下面的配置的解释
# 这是一个综合配置,不是单独为主库或是从库考虑
# 如果你需要主、从配置可以看:
# 主的配置可以看:https://github.com/judasn/Linux-Tutorial/blob/master/MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-master.cnf
# 从的配置可以看:https://github.com/judasn/Linux-Tutorial/blob/master/MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-salve.cnf
# ============================================================================================================
# 客户端设置
[mysql]
port = 3306
socket = /usr/program/mysql/data/mysql.sock
default-character-set = utf8
# ============================================================================================================
# 服务端设置
[mysqld]
user = mysql
port = 3306
default-storage-engine = InnoDB
socket = /usr/program/mysql/data/mysql.sock
pid-file = /usr/program/mysql/data/mysql.pid
collation-server = utf8_general_ci
init_connect = 'SET NAMES utf8'
character-set-server = utf8
basedir = /usr/program/mysql
datadir = /usr/program/mysql/data
log-error = /usr/program/mysql/data/mysql-error.log
# (重点修改)表示是本机的序号为1,一般配合设置主从的时候一定要修改的地方
server-id = 1
# back_log 值指出在 MySQL 暂时停止回答新请求之前的短时间内多少个请求可以被存在堆栈中。如果 MySQL 的连接数据达到 max_connections 时,新来的请求将会被存在堆栈中,以等待某一连接释放资源,该堆栈的数量即 back_log,如果等待连接的数量超过 back_log,将不被授予连接资源。
# 另外,这值(back_log)限于您的操作系统对到来的 TCP/IP 连接的侦听队列的大小。你的操作系统在这个队列大小上有它自己的限制(可以检查你的 OS 文档找出这个变量的最大值),试图设定 back_log 高于你的操作系统的限制将是无效的。
back_log = 512
# MySQL 的最大并发连接数
max_connections = 1000
# 网络传输中一次小心传输量的最大值(最大值为 1G);增加该变量的值十分安全,这是因为仅当需要时才会分配额外内存。例如,仅当你发出长查询或 MySQL 必须返回大的结果行时 MySQL 才会分配更多内存。该变量之所以取较小默认值是一种预防措施,以捕获客户端和服务器之间的错误信息包,并确保不会因偶然使用大的信息包而导致内存溢出。
max_allowed_packet = 16M
# (这个参数有疑问)对于同一主机,如果有超出该参数值个数的中断错误连接,则该主机将被禁止连接。如需对该主机进行解禁,执行 Mysql 命令:FLUSH HOST。
max_connect_errors = 1000000
# 禁止MySQL对外部连接进行DNS解析,使用这一选项可以消除MySQL进行DNS解析的时间。但需要注意,如果开启该选项,则所有远程主机连接授权都要使用IP地址方式,否则MySQL将无法正常处理连接请求
skip-name-resolve
# MySQL打开的文件描述符限制
open_files_limit = 65535
# MySQL 每打开一个表,都会读入一些数据到 table_open_cache 缓存中,当 MySQL 在这个缓存中找不到相应信息时,才会去磁盘上读取。默认值 400,最大值:524288。假定系统有 200 个并发连接,则需将此参数设置为 200*N (N 为每个连接所需的文件描述符数目);当把 table_open_cache 设置为很大时,如果系统处理不了那么多文件描述符,那么就会出现客户端失效,连接不上
table_open_cache = 2048
# 一个事务,在没有提交的时候,产生的日志,记录到 Cache 中;等到事务提交需要提交的时候,则把日志持久化到磁盘。默认 binlog_cache_size 大小32K
binlog_cache_size = 1M
# 定义了用户可以创建的内存表(memory table)的大小。这个值用来计算内存表的最大行数值。这个变量支持动态改变
max_heap_table_size = 32M
# MySQL的heap(堆积)表缓冲大小。如果超过该值,则会将临时表写入磁盘。其范围值:1KB~4GB
tmp_table_size = 32M
# MySQL读入缓冲区大小。该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X2M=200M,所以4G内存的服务器,建议该值是6~8M
read_buffer_size = 2M
# MySQL的随机读缓冲区大小。
read_rnd_buffer_size = 8M
# MySQL执行排序使用的缓冲大小。该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X2M=200M,所以4G内存的服务器,建议该值是6~8M
sort_buffer_size = 2M
# 联合查询操作所能使用的缓冲区大小,和sort_buffer_size一样,该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X4M=400M,所以4G内存的服务器,建议该值是6~8M
join_buffer_size = 4M
# 指定用于索引的缓冲区大小,增加它可得到更好处理的索引(对所有读和多重写),对于4GB内存的服务器,该参数可以设置为:256M或384M
key_buffer_size = 64M
# 这个值(默认8)表示可以重新利用保存在缓存中线程的数量,当断开连接时如果缓存中还有空间,那么客户端的线程将被放到缓存中,
# 根据物理内存设置规则如下:
# 1G —> 8
# 2G —> 16
# 3G —> 32
# 大于3G —> 64
thread_cache_size = 8
# 每个线程的堆栈大小,值范围:128K ~ 4GB,默认是192KB
thread_stack = 256k
# 0是关闭高速缓存,1是开启高速缓存
query_cache_type = 1
# 查询缓冲区的大小,如果是4G内存建议设置为64M。具体设置值还要根据运行环境来判断,你可以执行这个SQL语句:show status like 'Qcache%';
# 从SQL语句查询的结果中,查看Qcache_lowmem_prunes的值非常大表示查询缓冲不够,你应该增加该设置值
query_cache_size = 8M
query_cache_limit = 2M
# 分词词汇最小长度,默认4
ft_min_word_len = 4
log-bin = /usr/program/mysql/data/mysql-bin
binlog-format = mixed
expire_logs_days = 30
# 该参数的说明:http://blog.csdn.net/wulantian/article/details/9965905
sync_binlog = 0
# 是否开启慢查询记录,1表示开启,0表示关闭,如果是主从环境下,主库不要开启,从库开启
slow_query_log = 1
# 慢查询时间 超过3秒则为慢查询
long_query_time = 3
slow_query_log_file = /usr/program/mysql/data/mysql-slow.log
performance_schema = 0
# 改参数的说明:http://www.cnblogs.com/digdeep/p/4727715.html
explicit_defaults_for_timestamp = true
# 数据库库名/表名是否区分大小写,0:区分大小写,1:不区分大小写
lower_case_table_names = 1
# MySQL选项以避免外部锁定,减少出错几率,增强稳定性
skip_external_locking
# 在网络上不允许TCP/IP连接到MySQL。所有到MySQL的连接必须经由Unix socket进行。如果要允许TCP/IP连接,则注释当前行即可
# skip-networking
table_definition_cache = 1024
# 该设置值取值为:服务器机子的逻辑CPU数量X2,比如你的服务器机子是 Linux 系统你可以执行:grep 'processor' /proc/cpuinfo | sort -u | wc -l,可以查看到逻辑CPU数量值,比如我取到的值是24,那我这里应该设置为:24X2=48
thread_concurrency = 2
# 强制为 innodb类型
innodb = FORCE
innodb_file_per_table = 1
# 限制Innodb能打开的表的数据,如果库里的表特别多的情况,请增加这个。这个值默认是300
innodb_open_files = 500
# InnoDB使用一个缓冲池来保存索引和原始数据, 不像MyISAM.
# 这里你设置越大,你在存取表里面数据时所需要的磁盘I/O越少.
# 在一个独立使用的数据库服务器上,你可以设置这个变量到服务器物理内存大小的70%左右
# 不要设置过大,否则,由于物理内存的竞争可能导致操作系统的换页颠簸.
innodb_buffer_pool_size = 592M
# innodb使用后台线程处理数据页上的读写 I/O(输入输出)请求,根据你的 CPU 核数来更改,默认是4
# 注:这两个参数不支持动态改变,需要把该参数加入到my.cnf里,修改完后重启MySQL服务,允许值的范围从 1-64
innodb_write_io_threads = 4
innodb_read_io_threads = 4
# 默认设置为 0,表示不限制并发数,这里推荐设置为0,更好去发挥CPU多核处理能力,提高并发量
innodb_thread_concurrency = 0
innodb_purge_threads = 1
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 2M
innodb_log_file_size = 64M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_additional_mem_pool_size = 2M
bulk_insert_buffer_size = 8M
# 用于设置在 REPAIR TABLE 和 CREATE INDEX 创建索引或 ALTER TABLE 的过程中排序索引所分配的缓冲区大小,可设置范围:4MB~4GB,默认8MB,4G内存的服务器可以设置为32M~64M
myisam_sort_buffer_size = 8M
# 32位系统默认值是2147483648=2G,64位系统,默认值是9223372036854775807,单位是bytes.
myisam_max_sort_file_size = 100G
myisam_repair_threads = 1
# 服务器关闭交互式连接前等待活动的秒数。单位秒
interactive_timeout = 28800
# 服务器关闭非交互连接之前等待活动的秒数。单位秒。通过show processlist命令查看当前系统的连接状态,如果发现有大量的sleep状态的连接进程,则说明该参数设置的过大。默认值:28800
wait_timeout = 3600
# ============================================================================================================
[mysqldump]
quick
# 服务器发送和接受的最大包长度
max_allowed_packet = 16M
[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M
================================================
FILE: favorite-file/MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-master.cnf
================================================
# 适用于 Mysql 5.6
# 该配置适合 1G 内存左右的机子,储存类型为 InnoDB
# 官网配置说明:http://dev.mysql.com/doc/refman/5.6/en/mysqld-option-tables.html
# 官网状态值说明:http://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html
# 官网环境变量说明:http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html
# 在线生成配置工具:http://tools.percona.com(只是起到一个参考作用,生成的配置文件里面的参数名有的是用符号:-,而官网是用:_,所以这个也要注意改掉。)
# 资料参考:https://blog.linuxeye.com/379.html
# 注释内容为注释行下面的配置的解释
# 这是一个综合配置,不是单独为主库或是从库考虑
# ============================================================================================================
# 客户端设置
[mysql]
port = 3306
socket = /usr/program/mysql/data/mysql.sock
default-character-set = utf8
# ============================================================================================================
# 服务端设置
[mysqld]
user = mysql
port = 3306
default-storage-engine = InnoDB
socket = /usr/program/mysql/data/mysql.sock
pid-file = /usr/program/mysql/data/mysql.pid
collation-server = utf8_general_ci
init_connect = 'SET NAMES utf8'
character-set-server = utf8
basedir = /usr/program/mysql
datadir = /usr/program/mysql/data
log-error = /usr/program/mysql/data/mysql-error.log
# (重点修改)表示是本机的序号为1,一般配合设置主从的时候一定要修改的地方
server-id = 1
# back_log 值指出在 MySQL 暂时停止回答新请求之前的短时间内多少个请求可以被存在堆栈中。如果 MySQL 的连接数据达到 max_connections 时,新来的请求将会被存在堆栈中,以等待某一连接释放资源,该堆栈的数量即 back_log,如果等待连接的数量超过 back_log,将不被授予连接资源。
# 另外,这值(back_log)限于您的操作系统对到来的 TCP/IP 连接的侦听队列的大小。你的操作系统在这个队列大小上有它自己的限制(可以检查你的 OS 文档找出这个变量的最大值),试图设定 back_log 高于你的操作系统的限制将是无效的。
back_log = 512
# MySQL 的最大并发连接数
max_connections = 1000
# 网络传输中一次小心传输量的最大值(最大值为 1G);增加该变量的值十分安全,这是因为仅当需要时才会分配额外内存。例如,仅当你发出长查询或 MySQL 必须返回大的结果行时 MySQL 才会分配更多内存。该变量之所以取较小默认值是一种预防措施,以捕获客户端和服务器之间的错误信息包,并确保不会因偶然使用大的信息包而导致内存溢出。
max_allowed_packet = 16M
# 对于同一主机,如果有超出该参数值个数的中断错误连接,则该主机将被禁止连接。如需对该主机进行解禁,执行 Mysql 命令:FLUSH HOST。
max_connect_errors = 1000000
# 禁止MySQL对外部连接进行DNS解析,使用这一选项可以消除MySQL进行DNS解析的时间。但需要注意,如果开启该选项,则所有远程主机连接授权都要使用IP地址方式,否则MySQL将无法正常处理连接请求
skip-name-resolve
# MySQL打开的文件描述符限制
open_files_limit = 65535
# MySQL 每打开一个表,都会读入一些数据到 table_open_cache 缓存中,当 MySQL 在这个缓存中找不到相应信息时,才会去磁盘上读取。默认值 400,最大值:524288。假定系统有 200 个并发连接,则需将此参数设置为 200*N (N 为每个连接所需的文件描述符数目);当把 table_open_cache 设置为很大时,如果系统处理不了那么多文件描述符,那么就会出现客户端失效,连接不上
table_open_cache = 2048
# 一个事务,在没有提交的时候,产生的日志,记录到 Cache 中;等到事务提交需要提交的时候,则把日志持久化到磁盘。默认 binlog_cache_size 大小32K
binlog_cache_size = 1M
# 定义了用户可以创建的内存表(memory table)的大小。这个值用来计算内存表的最大行数值。这个变量支持动态改变
max_heap_table_size = 32M
# MySQL的heap(堆积)表缓冲大小。如果超过该值,则会将临时表写入磁盘。其范围值:1KB~4GB
tmp_table_size = 32M
# MySQL读入缓冲区大小。该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X2M=200M,所以4G内存的服务器,建议该值是6~8M
read_buffer_size = 2M
# MySQL的随机读缓冲区大小。
read_rnd_buffer_size = 8M
# MySQL执行排序使用的缓冲大小。该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X2M=200M,所以4G内存的服务器,建议该值是6~8M
sort_buffer_size = 2M
# 联合查询操作所能使用的缓冲区大小,和sort_buffer_size一样,该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X4M=400M,所以4G内存的服务器,建议该值是6~8M
join_buffer_size = 4M
# 指定用于索引的缓冲区大小,增加它可得到更好处理的索引(对所有读和多重写),对于4GB内存的服务器,该参数可以设置为:256M或384M
key_buffer_size = 64M
# 这个值(默认8)表示可以重新利用保存在缓存中线程的数量,当断开连接时如果缓存中还有空间,那么客户端的线程将被放到缓存中,
# 根据物理内存设置规则如下:
# 1G —> 8
# 2G —> 16
# 3G —> 32
# 大于3G —> 64
thread_cache_size = 8
# 每个线程的堆栈大小,值范围:128K ~ 4GB,默认是192KB
thread_stack = 256k
# 0是关闭高速缓存,1是开启高速缓存
query_cache_type = 0
# 查询缓冲区的大小,如果是4G内存建议设置为64M。具体设置值还要根据运行环境来判断,你可以执行这个SQL语句:show status like 'Qcache%';
# 从SQL语句查询的结果中,查看Qcache_lowmem_prunes的值非常大表示查询缓冲不够,你应该增加该设置值
query_cache_size = 0
query_cache_limit = 2M
# 分词词汇最小长度,默认4
ft_min_word_len = 4
log-bin = /usr/program/mysql/data/mysql-bin
binlog-format = mixed
expire_logs_days = 30
# 该参数的说明:http://blog.csdn.net/wulantian/article/details/9965905
sync_binlog = 1
# 是否开启慢查询记录,1表示开启,0表示关闭,如果是主从环境下,主库不要开启,从库开启
slow_query_log = 0
# 慢查询时间 超过3秒则为慢查询
long_query_time = 3
slow_query_log_file = /usr/program/mysql/data/mysql-slow.log
performance_schema = 0
# 改参数的说明:http://www.cnblogs.com/digdeep/p/4727715.html
explicit_defaults_for_timestamp = true
# 数据库库名/表名是否区分大小写,0:区分大小写,1:不区分大小写
lower_case_table_names = 1
# MySQL选项以避免外部锁定,减少出错几率,增强稳定性
skip_external_locking
# 在网络上不允许TCP/IP连接到MySQL。所有到MySQL的连接必须经由Unix socket进行。如果要允许TCP/IP连接,则注释当前行即可
# skip-networking
table_definition_cache = 1024
# 该设置值取值为:服务器机子的逻辑CPU数量X2,比如你的服务器机子是 Linux 系统你可以执行:grep 'processor' /proc/cpuinfo | sort -u | wc -l,可以查看到逻辑CPU数量值,比如我取到的值是24,那我这里应该设置为:24X2=48
thread_concurrency = 2
# 强制为 innodb类型
innodb = FORCE
innodb_file_per_table = 1
# 限制Innodb能打开的表的数据,如果库里的表特别多的情况,请增加这个。这个值默认是300
innodb_open_files = 500
# InnoDB使用一个缓冲池来保存索引和原始数据, 不像MyISAM.
# 这里你设置越大,你在存取表里面数据时所需要的磁盘I/O越少.
# 在一个独立使用的数据库服务器上,你可以设置这个变量到服务器物理内存大小的70%左右
# 不要设置过大,否则,由于物理内存的竞争可能导致操作系统的换页颠簸.
innodb_buffer_pool_size = 592M
# innodb使用后台线程处理数据页上的读写 I/O(输入输出)请求,根据你的 CPU 核数来更改,默认是4
# 注:这两个参数不支持动态改变,需要把该参数加入到my.cnf里,修改完后重启MySQL服务,允许值的范围从 1-64
innodb_write_io_threads = 4
innodb_read_io_threads = 4
# 默认设置为 0,表示不限制并发数,这里推荐设置为0,更好去发挥CPU多核处理能力,提高并发量
innodb_thread_concurrency = 0
innodb_purge_threads = 1
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 2M
innodb_log_file_size = 64M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_additional_mem_pool_size = 2M
bulk_insert_buffer_size = 8M
# 用于设置在 REPAIR TABLE 和 CREATE INDEX 创建索引或 ALTER TABLE 的过程中排序索引所分配的缓冲区大小,可设置范围:4MB~4GB,默认8MB,4G内存的服务器可以设置为32M~64M
myisam_sort_buffer_size = 8M
# 32位系统默认值是2147483648=2G,64位系统,默认值是9223372036854775807,单位是bytes.
myisam_max_sort_file_size = 100G
myisam_repair_threads = 1
# 服务器关闭交互式连接前等待活动的秒数。单位秒
interactive_timeout = 28800
# 服务器关闭非交互连接之前等待活动的秒数。单位秒。通过show processlist命令查看当前系统的连接状态,如果发现有大量的sleep状态的连接进程,则说明该参数设置的过大。默认值:28800
wait_timeout = 3600
# ============================================================================================================
[mysqldump]
quick
# 服务器发送和接受的最大包长度
max_allowed_packet = 16M
[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M
================================================
FILE: favorite-file/MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-salve.cnf
================================================
# 适用于 Mysql 5.6
# 该配置适合 1G 内存左右的机子,储存类型为 InnoDB
# 官网配置说明:http://dev.mysql.com/doc/refman/5.6/en/mysqld-option-tables.html
# 官网状态值说明:http://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html
# 官网环境变量说明:http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html
# 在线生成配置工具:http://tools.percona.com(只是起到一个参考作用,生成的配置文件里面的参数名有的是用符号:-,而官网是用:_,所以这个也要注意改掉。)
# 资料参考:https://blog.linuxeye.com/379.html
# 注释内容为注释行下面的配置的解释
# 这是一个综合配置,不是单独为主库或是从库考虑
# ============================================================================================================
# 客户端设置
[mysql]
port = 3306
socket = /usr/program/mysql/data/mysql.sock
default-character-set = utf8
# ============================================================================================================
# 服务端设置
[mysqld]
user = mysql
port = 3306
default-storage-engine = InnoDB
socket = /usr/program/mysql/data/mysql.sock
pid-file = /usr/program/mysql/data/mysql.pid
collation-server = utf8_general_ci
init_connect = 'SET NAMES utf8'
character-set-server = utf8
basedir = /usr/program/mysql
datadir = /usr/program/mysql/data
log-error = /usr/program/mysql/data/mysql-error.log
# (重点修改)表示是本机的序号为1,一般配合设置主从的时候一定要修改的地方
server-id = 1
# 从库特有的设置 start
read_only = true
# 从库不自动开启主从设置,需要使用命令:START SLAVE;
skip-slave-start = true
log-slave-updates = true
relay-log = /usr/program/mysql/data/relay-bin
# 单位秒
slave-net-timeout = 60
sync_master_info = 1
sync_relay_log = 1
sync_relay_log_info = 1
# 从库特有的设置 end
# back_log 值指出在 MySQL 暂时停止回答新请求之前的短时间内多少个请求可以被存在堆栈中。如果 MySQL 的连接数据达到 max_connections 时,新来的请求将会被存在堆栈中,以等待某一连接释放资源,该堆栈的数量即 back_log,如果等待连接的数量超过 back_log,将不被授予连接资源。
# 另外,这值(back_log)限于您的操作系统对到来的 TCP/IP 连接的侦听队列的大小。你的操作系统在这个队列大小上有它自己的限制(可以检查你的 OS 文档找出这个变量的最大值),试图设定 back_log 高于你的操作系统的限制将是无效的。
back_log = 512
# MySQL 的最大并发连接数
max_connections = 1000
# 网络传输中一次小心传输量的最大值(最大值为 1G);增加该变量的值十分安全,这是因为仅当需要时才会分配额外内存。例如,仅当你发出长查询或 MySQL 必须返回大的结果行时 MySQL 才会分配更多内存。该变量之所以取较小默认值是一种预防措施,以捕获客户端和服务器之间的错误信息包,并确保不会因偶然使用大的信息包而导致内存溢出。
max_allowed_packet = 16M
# 对于同一主机,如果有超出该参数值个数的中断错误连接,则该主机将被禁止连接。如需对该主机进行解禁,执行 Mysql 命令:FLUSH HOST。
max_connect_errors = 1000000
# 禁止MySQL对外部连接进行DNS解析,使用这一选项可以消除MySQL进行DNS解析的时间。但需要注意,如果开启该选项,则所有远程主机连接授权都要使用IP地址方式,否则MySQL将无法正常处理连接请求
skip-name-resolve
# MySQL打开的文件描述符限制
open_files_limit = 65535
# MySQL 每打开一个表,都会读入一些数据到 table_open_cache 缓存中,当 MySQL 在这个缓存中找不到相应信息时,才会去磁盘上读取。默认值 400,最大值:524288。假定系统有 200 个并发连接,则需将此参数设置为 200*N (N 为每个连接所需的文件描述符数目);当把 table_open_cache 设置为很大时,如果系统处理不了那么多文件描述符,那么就会出现客户端失效,连接不上
table_open_cache = 2048
# 一个事务,在没有提交的时候,产生的日志,记录到 Cache 中;等到事务提交需要提交的时候,则把日志持久化到磁盘。默认 binlog_cache_size 大小32K
binlog_cache_size = 1M
# 定义了用户可以创建的内存表(memory table)的大小。这个值用来计算内存表的最大行数值。这个变量支持动态改变
max_heap_table_size = 32M
# MySQL的heap(堆积)表缓冲大小。如果超过该值,则会将临时表写入磁盘。其范围值:1KB~4GB
tmp_table_size = 32M
# MySQL读入缓冲区大小。该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X2M=200M,所以4G内存的服务器,建议该值是6~8M
read_buffer_size = 2M
# MySQL的随机读缓冲区大小。
read_rnd_buffer_size = 8M
# MySQL执行排序使用的缓冲大小。该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X2M=200M,所以4G内存的服务器,建议该值是6~8M
sort_buffer_size = 2M
# 联合查询操作所能使用的缓冲区大小,和sort_buffer_size一样,该参数对应的分配内存也是每连接独享,所以,如果有100连接,那占用的内存是:100X4M=400M,所以4G内存的服务器,建议该值是6~8M
join_buffer_size = 4M
# 指定用于索引的缓冲区大小,增加它可得到更好处理的索引(对所有读和多重写),对于4GB内存的服务器,该参数可以设置为:256M或384M
key_buffer_size = 64M
# 这个值(默认8)表示可以重新利用保存在缓存中线程的数量,当断开连接时如果缓存中还有空间,那么客户端的线程将被放到缓存中,
# 根据物理内存设置规则如下:
# 1G —> 8
# 2G —> 16
# 3G —> 32
# 大于3G —> 64
thread_cache_size = 8
# 每个线程的堆栈大小,值范围:128K ~ 4GB,默认是192KB
thread_stack = 256k
# 0是关闭高速缓存,1是开启高速缓存
query_cache_type = 1
# 查询缓冲区的大小,如果是4G内存建议设置为64M。具体设置值还要根据运行环境来判断,你可以执行这个SQL语句:show status like 'Qcache%';
# 从SQL语句查询的结果中,查看Qcache_lowmem_prunes的值非常大表示查询缓冲不够,你应该增加该设置值
query_cache_size = 8M
query_cache_limit = 2M
# 分词词汇最小长度,默认4
ft_min_word_len = 4
log-bin = /usr/program/mysql/data/mysql-bin
binlog-format = mixed
expire_logs_days = 30
# 该参数的说明:http://blog.csdn.net/wulantian/article/details/9965905
sync_binlog = 0
# 是否开启慢查询记录,1表示开启,0表示关闭,如果是主从环境下,主库不要开启,从库开启
slow_query_log = 1
# 慢查询时间 超过3秒则为慢查询
long_query_time = 3
slow_query_log_file = /usr/program/mysql/data/mysql-slow.log
performance_schema = 0
# 改参数的说明:http://www.cnblogs.com/digdeep/p/4727715.html
explicit_defaults_for_timestamp = true
# 数据库库名/表名是否区分大小写,0:区分大小写,1:不区分大小写
lower_case_table_names = 1
# MySQL选项以避免外部锁定,减少出错几率,增强稳定性
skip_external_locking
# 在网络上不允许TCP/IP连接到MySQL。所有到MySQL的连接必须经由Unix socket进行。如果要允许TCP/IP连接,则注释当前行即可
# skip-networking
table_definition_cache = 1024
# 该设置值取值为:服务器机子的逻辑CPU数量X2,比如你的服务器机子是 Linux 系统你可以执行:grep 'processor' /proc/cpuinfo | sort -u | wc -l,可以查看到逻辑CPU数量值,比如我取到的值是24,那我这里应该设置为:24X2=48
thread_concurrency = 2
# 强制为 innodb类型
innodb = FORCE
innodb_file_per_table = 1
# 限制Innodb能打开的表的数据,如果库里的表特别多的情况,请增加这个。这个值默认是300
innodb_open_files = 500
# InnoDB使用一个缓冲池来保存索引和原始数据, 不像MyISAM.
# 这里你设置越大,你在存取表里面数据时所需要的磁盘I/O越少.
# 在一个独立使用的数据库服务器上,你可以设置这个变量到服务器物理内存大小的70%左右
# 不要设置过大,否则,由于物理内存的竞争可能导致操作系统的换页颠簸.
innodb_buffer_pool_size = 592M
# innodb使用后台线程处理数据页上的读写 I/O(输入输出)请求,根据你的 CPU 核数来更改,默认是4
# 注:这两个参数不支持动态改变,需要把该参数加入到my.cnf里,修改完后重启MySQL服务,允许值的范围从 1-64
innodb_write_io_threads = 4
innodb_read_io_threads = 4
# 默认设置为 0,表示不限制并发数,这里推荐设置为0,更好去发挥CPU多核处理能力,提高并发量
innodb_thread_concurrency = 0
innodb_purge_threads = 1
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 2M
innodb_log_file_size = 64M
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
innodb_additional_mem_pool_size = 2M
bulk_insert_buffer_size = 8M
# 用于设置在 REPAIR TABLE 和 CREATE INDEX 创建索引或 ALTER TABLE 的过程中排序索引所分配的缓冲区大小,可设置范围:4MB~4GB,默认8MB,4G内存的服务器可以设置为32M~64M
myisam_sort_buffer_size = 8M
# 32位系统默认值是2147483648=2G,64位系统,默认值是9223372036854775807,单位是bytes.
myisam_max_sort_file_size = 100G
myisam_repair_threads = 1
# 服务器关闭交互式连接前等待活动的秒数。单位秒
interactive_timeout = 28800
# 服务器关闭非交互连接之前等待活动的秒数。单位秒。通过show processlist命令查看当前系统的连接状态,如果发现有大量的sleep状态的连接进程,则说明该参数设置的过大。默认值:28800
wait_timeout = 3600
# ============================================================================================================
[mysqldump]
quick
# 服务器发送和接受的最大包长度
max_allowed_packet = 16M
[myisamchk]
key_buffer_size = 8M
sort_buffer_size = 8M
read_buffer = 4M
write_buffer = 4M
================================================
FILE: favorite-file/MySQL-Settings/MySQL-5.6/8G-Memory-Machine/my.cnf
================================================
[mysql]
port = 3306
socket = /usr/program/mysql/data/mysql.sock
default-character-set = utf8
[mysqld]
user = mysql
port = 3306
server-id = 100866
default-storage-engine = InnoDB
socket = /usr/program/mysql/data/mysql.sock
pid-file = /usr/program/mysql/data/mysql.pid
collation-server = utf8_general_ci
init_connect = 'SET NAMES utf8'
character-set-server = utf8
basedir = /usr/program/mysql
datadir = /usr/program/mysql/data
log-error = /usr/program/mysql/data/mysql-error.log
back_log = 512
max_connections = 1000
max_allowed_packet = 120M
max_connect_errors = 1000000
skip-name-resolve
open_files_limit = 65535
table_open_cache = 2048
binlog_cache_size = 20M
max_heap_table_size = 40M
tmp_table_size = 64M
read_buffer_size = 20M
read_rnd_buffer_size = 20M
sort_buffer_size = 20M
join_buffer_size = 20M
key_buffer_size = 40M
thread_cache_size = 100
thread_stack = 20M
# 5.6.8之后这个不再建议开启了,所以要关掉
query_cache_type = 0
query_cache_size = 40M
query_cache_limit = 10M
ft_min_word_len = 4
log-bin = /usr/program/mysql/data/mysql-bin
binlog-format = mixed
expire_logs_days = 14
sync_binlog = 0
log-queries-not-using-indexes = 1
slow_query_log = 0
long_query_time = 3
slow_query_log_file = /usr/program/mysql/data/mysql-slow.log
performance_schema = 0
explicit_defaults_for_timestamp = true
lower_case_table_names = 1
skip_external_locking
table_definition_cache = 1024
thread_concurrency = 2
innodb = FORCE
innodb_flush_method = O_DIRECT
innodb_file_per_table = 1
innodb_open_files = 500
innodb_thread_concurrency = 0
innodb_purge_threads = 1
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 20M
innodb_log_file_size = 256M
innodb_log_files_in_group = 2
innodb_lock_wait_timeout = 120
innodb_additional_mem_pool_size = 20M
innodb_buffer_pool_size = 3G
innodb_read_io_threads = 8
innodb_write_io_threads = 8
innodb_io_capacity = 2000
innodb_max_dirty_pages_pct = 90
bulk_insert_buffer_size = 64M
myisam_sort_buffer_size = 64M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
interactive_timeout = 28800
wait_timeout = 3600
[mysqldump]
quick
max_allowed_packet = 120M
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 20M
read_buffer = 20M
write_buffer = 20M
================================================
FILE: favorite-file/MySQL-Settings/MySQL-5.6/developer/my-Windows-8G-开发机.ini
================================================
[client]
no-beep
port=3306
[mysql]
default-character-set=utf8
[mysqld]
port=3306
basedir="C:/Program Files/MySQL/MySQL Server 5.6/"
datadir="C:/ProgramData/MySQL/MySQL Server 5.6/data\"
character-set-server=utf8
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
log-output=NONE
general-log=0
general_log_file="AJBC-1540.log"
slow-query-log=0
slow_query_log_file="AJBC-1540-slow.log"
long_query_time=10
log-error="AJBC-1540.err"
max_connections=1000
query_cache_size=10M
table_open_cache=2000
tmp_table_size=37M
thread_cache_size=32
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=72M
key_buffer_size=256M
read_buffer_size=6M
read_rnd_buffer_size=8M
sort_buffer_size=2M
innodb_additional_mem_pool_size=5M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=3M
innodb_buffer_pool_size=592M
innodb_log_file_size=64M
innodb_thread_concurrency=9
innodb_autoextend_increment=64M
innodb_buffer_pool_instances=8
innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=500
innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0
back_log=512
flush_time=0
join_buffer_size=4M
max_allowed_packet=50M
max_connect_errors=1000000
open_files_limit=65535
query_cache_type=1
table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000
sync_relay_log=10000
sync_relay_log_info=10000
innodb_write_io_threads = 4
innodb_read_io_threads = 4
innodb_purge_threads = 1
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120
max_heap_table_size = 32M
thread_stack = 256k
ft_min_word_len = 4
performance_schema = 0
explicit_defaults_for_timestamp = true
skip_external_locking
bulk_insert_buffer_size = 8M
wait_timeout = 3600
interactive_timeout = 28800
myisam_repair_threads = 1
query_cache_limit = 5M
================================================
FILE: favorite-file/Nginx-Settings/nginx
================================================
#!/bin/bash
#nginx执行程序路径需要修改
nginxd=/usr/local/nginx/sbin/nginx
# nginx配置文件路径需要修改
nginx_config=/usr/local/nginx/conf/nginx.conf
# pid 地址需要修改
nginx_pid=/var/local/nginx/nginx.pid
RETVAL=0
prog="nginx"
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x $nginxd ] || exit 0
# Start nginx daemons functions.
start() {
if [ -e $nginx_pid ];then
echo "nginx already running...."
exit 1
fi
echo -n $"Starting $prog: "
daemon $nginxd -c ${nginx_config}
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/nginx
return $RETVAL
}
# Stop nginx daemons functions.
# pid 地址需要修改
stop() {
echo -n $"Stopping $prog: "
killproc $nginxd
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /var/local/nginx/nginx.pid
}
# reload nginx service functions.
reload() {
echo -n $"Reloading $prog: "
#kill -HUP `cat ${nginx_pid}`
killproc $nginxd -HUP
RETVAL=$?
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload)
reload
;;
restart)
stop
start
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $prog {start|stop|restart|reload|status|help}"
exit 1
esac
exit $RETVAL
================================================
FILE: favorite-file/Nginx-Settings/nginx-front.conf
================================================
user root;
worker_processes auto;
pid /run/nginx.pid;
events {
use epoll;
multi_accept on;
worker_connections 1024;
}
http {
# 必须加这两个,不然 CSS 无法正常加载
include mime.types;
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" "$request_time"';
access_log /var/log/nginx/access.log main;
error_log /var/log/nginx/error.log;
gzip on;
gzip_buffers 8 16k;
gzip_min_length 512;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";
gzip_http_version 1.1;
gzip_types text/plain text/css application/javascript application/x-javascript application/json application/xml;
server {
listen 8001;
server_name localhost 127.0.0.1 139.159.190.24 platform.gitnavi.com;
location / {
root /root/.jenkins/workspace/nestle-platform-front-test/dist;
index index.html index.htm;
try_files $uri /index.html;
}
## 二级目录方式,记得 package.json 添加:"homepage": "cdk8s-markdown",
location ^~ /cdk8s-markdown {
root /root/.jenkins/workspace;
index index.html;
try_files $uri /cdk8s-markdown/index.html;
}
location ^~ /platform/ {
proxy_pass http://127.0.0.1:28081;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ .*\.(js|css)?$ {
root /root/.jenkins/workspace/nestle-platform-front-test/dist;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico|woff|woff2|ttf|eot|txt|svg)$ {
root /root/.jenkins/workspace/nestle-platform-front-test/dist;
}
error_page 404 /404.html;
location = /usr/share/nginx/html/40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /usr/share/nginx/html/50x.html {
}
}
server {
listen 8002;
server_name localhost 127.0.0.1 139.159.190.24 store.gitnavi.com;
location / {
root /root/.jenkins/workspace/nestle-store-front-test/dist;
index index.html index.htm;
try_files $uri /index.html;
}
location ^~ /store/ {
proxy_pass http://127.0.0.1:28082;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ .*\.(js|css)?$ {
root /root/.jenkins/workspace/nestle-store-front-test/dist;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|ico|woff|woff2|ttf|eot|txt|svg)$ {
root /root/.jenkins/workspace/nestle-store-front-test/dist;
}
error_page 404 /404.html;
location = /usr/share/nginx/html/40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /usr/share/nginx/html/50x.html {
}
}
}
================================================
FILE: favorite-file/Tomcat-Settings/server.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Executor
name="tomcatThreadPool"
namePrefix="catalina-exec-"
maxThreads="500"
minSpareThreads="100"
prestartminSpareThreads = "true"
maxQueueSize = "100"
/>
<Connector
executor="tomcatThreadPool"
port="8080"
protocol="org.apache.coyote.http11.Http11Nio2Protocol"
connectionTimeout="20000"
maxConnections="10000"
redirectPort="8443"
enableLookups="false"
acceptCount="100"
maxPostSize="10485760"
compression="on"
disableUploadTimeout="true"
compressionMinSize="2048"
acceptorThreadCount="2"
compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript"
URIEncoding="utf-8"
/>
<!--<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />-->
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
================================================
FILE: favorite-file/gravitee-docker-compose/README.md
================================================
# graviteeio api gateway docker-compose running
fork from graviteeio project && change some deps image
- <https://github.com/rongfengliang/gravitee-docker-compose>
- <https://www.cnblogs.com/rongfengliang/p/10204187.html>
## how to run
```code
cd platform && docker-compose up -d
```
## manager ui
* api portal
```code
open https://localhost/apim/portal
```
* access manager ui
```code
open https://localhost/am/ui/
```
## Note:
- environments directory has some demos with ci && traefik gateway
- portal account admin amdin
- access manager ui account admin adminadmin
================================================
FILE: favorite-file/gravitee-docker-compose/environments/ci/docker-compose.yml
================================================
#-------------------------------------------------------------------------------
# Copyright (C) 2015 The Gravitee team (http://gravitee.io)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
version: '2'
services:
ci:
image: graviteeio/jenkins:latest
container_name: ci
network_mode: "bridge"
expose:
- 50022
ports:
- "50022:50022"
labels:
- "traefik.frontend.rule=Host:ci.gravitee.io"
- "traefik.port=8080"
volumes:
- /var/jenkins_home:/var/jenkins_home
- /var/run/docker.sock:/var/run/docker.sock
links:
- redis-test
- qa
redis-test:
image: redis:3
container_name: redis-test
network_mode: "bridge"
qa:
image: sonarqube:alpine
container_name: qa
network_mode: "bridge"
environment:
- SONARQUBE_JDBC_URL=jdbc:postgresql://sonarqube-db:5432/sonar
labels:
- "traefik.frontend.rule=Host:qa.gravitee.io"
volumes:
- /opt/sonarqube/conf:/opt/sonarqube/conf
- /opt/sonarqube/data:/opt/sonarqube/data
- /opt/sonarqube/extensions:/opt/sonarqube/extensions
- /opt/sonarqube/bundled-plugins:/opt/sonarqube/lib/bundled-plugins
links:
- sonarqube-db
sonarqube-db:
image: postgres:alpine
network_mode: "bridge"
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
volumes:
- /opt/sonarqube/postgresql/data:/var/lib/postgresql/data
================================================
FILE: favorite-file/gravitee-docker-compose/environments/demo/common.yml
================================================
#-------------------------------------------------------------------------------
# Copyright (C) 2015 The Gravitee team (http://gravitee.io)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
version: '2'
volumes:
datamongo: {}
dataelasticsearch: {}
services:
elasticsearch:
hostname: demo-elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:5.4.3
volumes:
- dataelasticsearch:/usr/share/elasticsearch/data
environment:
- http.host=0.0.0.0
- transport.host=0.0.0.0
- xpack.security.enabled=false
- xpack.monitoring.enabled=false
- cluster.name=elasticsearch
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
nofile: 65536
mongodb:
hostname: demo-mongodb
image: mongo:3.4
volumes:
- datamongo:/data/db
gateway:
hostname: demo-gateway
image: graviteeio/gateway:latest
environment:
- gravitee_management_mongodb_uri=mongodb://mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_ratelimit_mongodb_uri=mongodb://mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_reporters_elasticsearch_endpoints_0=http://elasticsearch:9200
managementui:
hostname: demo-managementui
image: graviteeio/management-ui:latest
managementapi:
hostname: demo-managementapi
image: graviteeio/management-api:latest
environment:
- gravitee_management_mongodb_uri=mongodb://mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_analytics_elasticsearch_endpoints_0=http://elasticsearch:9200
================================================
FILE: favorite-file/gravitee-docker-compose/environments/demo/docker-compose-local.yml
================================================
#-------------------------------------------------------------------------------
# Copyright (C) 2015 The Gravitee team (http://gravitee.io)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
version: '2'
volumes:
local_datamongo: {}
local_dataelasticsearch: {}
services:
local_elasticsearch:
extends:
file: common.yml
service: elasticsearch
volumes:
- local_dataelasticsearch:/usr/share/elasticsearch/data
- ./logs/elasticsearch:/var/log/elasticsearch
local_mongodb:
extends:
file: common.yml
service: mongodb
volumes:
- local_datamongo:/data/db
- ./logs/mongodb:/var/log/mongodb
local_gateway:
extends:
file: common.yml
service: gateway
links:
- "local_mongodb:demo-mongodb"
- "local_elasticsearch:demo-elasticsearch"
ports:
- "8000:8082"
volumes:
- ./logs/gateway:/etc/gravitee.io/log
environment:
- gravitee_management_mongodb_uri=mongodb://demo-mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_ratelimit_mongodb_uri=mongodb://demo-mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_reporters_elasticsearch_endpoints_0=http://demo-elasticsearch:9200
local_managementui:
extends:
file: common.yml
service: managementui
ports:
- "8002:80"
volumes:
- ./logs/management-ui:/var/log/httpd
environment:
- MGMT_API_URL=http:\/\/localhost:8005\/management\/
local_managementapi:
extends:
file: common.yml
service: managementapi
ports:
- "8005:8083"
volumes:
- ./logs/management-api:/home/gravitee/logs
links:
- "local_mongodb:demo-mongodb"
- "local_elasticsearch:demo-elasticsearch"
environment:
- gravitee_management_mongodb_uri=mongodb://demo-mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_analytics_elasticsearch_endpoints_0=http://demo-elasticsearch:9200
================================================
FILE: favorite-file/gravitee-docker-compose/environments/demo/docker-compose-traefik-latest.yml
================================================
#-------------------------------------------------------------------------------
# Copyright (C) 2015 The Gravitee team (http://gravitee.io)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
version: '2'
volumes:
latest_datamongo: {}
latest_dataelasticsearch: {}
services:
latest_elasticsearch:
network_mode: "bridge"
extends:
file: common.yml
service: elasticsearch
volumes:
- latest_dataelasticsearch:/usr/share/elasticsearch/data
latest_mongodb:
network_mode: "bridge"
extends:
file: common.yml
service: mongodb
volumes:
- latest_datamongo:/data/db
latest_gateway:
network_mode: "bridge"
extends:
file: common.yml
service: gateway
links:
- latest_mongodb
- latest_elasticsearch
labels:
- "traefik.backend=graviteeio-gateway"
- "traefik.frontend.rule=Host:demo.gravitee.io;PathPrefixStrip:/gateway"
environment:
- gravitee_management_mongodb_uri=mongodb://demo-mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_ratelimit_mongodb_uri=mongodb://demo-mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_reporters_elasticsearch_endpoints_0=http://demo-elasticsearch:9200
latest_managementui:
network_mode: "bridge"
extends:
file: common.yml
service: managementui
labels:
- "traefik.backend=graviteeio-managementui"
- "traefik.frontend.rule=Host:demo.gravitee.io"
environment:
- MGMT_API_URL=https:\/\/demo.gravitee.io\/management\/
latest_managementapi:
network_mode: "bridge"
extends:
file: common.yml
service: managementapi
labels:
- "traefik.backend=graviteeio-managementapi"
- "traefik.frontend.rule=Host:demo.gravitee.io;PathPrefix:/management"
links:
- latest_mongodb
- latest_elasticsearch
environment:
- gravitee_management_mongodb_uri=mongodb://demo-mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_analytics_elasticsearch_endpoints_0=http://demo-elasticsearch:9200
================================================
FILE: favorite-file/gravitee-docker-compose/environments/demo/docker-compose-traefik-nightly.yml
================================================
#-------------------------------------------------------------------------------
# Copyright (C) 2015 The Gravitee team (http://gravitee.io)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
version: '2'
volumes:
nightly_datamongo: {}
nightly_dataelasticsearch: {}
services:
nightly_elasticsearch:
network_mode: "bridge"
extends:
file: common.yml
service: elasticsearch
volumes:
- nightly_dataelasticsearch:/usr/share/elasticsearch/data
nightly_mongodb:
network_mode: "bridge"
extends:
file: common.yml
service: mongodb
volumes:
- nightly_datamongo:/data/db
nightly_gateway:
image: graviteeio/gateway:nightly
network_mode: "bridge"
extends:
file: common.yml
service: gateway
links:
- nightly_mongodb
- nightly_elasticsearch
labels:
- "traefik.backend=nightly-graviteeio-gateway"
- "traefik.frontend.rule=Host:nightly.gravitee.io;PathPrefixStrip:/gateway"
environment:
- gravitee_management_mongodb_uri=mongodb://demo-mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_ratelimit_mongodb_uri=mongodb://demo-mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_reporters_elasticsearch_endpoints_0=http://demo-elasticsearch:9200
nightly_managementui:
image: graviteeio/management-ui:nightly
network_mode: "bridge"
extends:
file: common.yml
service: managementui
labels:
- "traefik.backend=nightly-graviteeio-managementui"
- "traefik.frontend.rule=Host:nightly.gravitee.io"
environment:
- MGMT_API_URL=https:\/\/nightly.gravitee.io\/management\/
nightly_managementapi:
image: graviteeio/management-api:nightly
network_mode: "bridge"
extends:
file: common.yml
service: managementapi
labels:
- "traefik.backend=nightly-graviteeio-managementapi"
- "traefik.frontend.rule=Host:nightly.gravitee.io;PathPrefix:/management"
links:
- nightly_mongodb
- nightly_elasticsearch
environment:
- gravitee_management_mongodb_uri=mongodb://demo-mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_analytics_elasticsearch_endpoints_0=http://demo-elasticsearch:9200
================================================
FILE: favorite-file/gravitee-docker-compose/environments/demo/launch.sh
================================================
#!/bin/bash
#-------------------------------------------------------------------------------
# Copyright (C) 2015 The Gravitee team (http://gravitee.io)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
readonly WORKDIR="$HOME/graviteeio-demo"
readonly DIRNAME=`dirname $0`
readonly PROGNAME=`basename $0`
readonly color_title='\033[32m'
readonly color_text='\033[1;36m'
# OS specific support (must be 'true' or 'false').
declare cygwin=false
declare darwin=false
declare linux=false
declare dc_exec="docker-compose -f docker-compose-local.yml up"
welcome() {
echo
echo -e " ${color_title} _____ _____ __ _______ _______ ______ ______ _____ ____ \033[0m"
echo -e " ${color_title} / ____| __ \ /\ \ / /_ _|__ __| ____| ____| |_ _/ __ \ \033[0m"
echo -e " ${color_title}| | __| |__) | / \ \ / / | | | | | |__ | |__ | || | | | \033[0m"
echo -e " ${color_title}| | |_ | _ / / /\ \ \/ / | | | | | __| | __| | || | | | \033[0m"
echo -e " ${color_title}| |__| | | \ \ / ____ \ / _| |_ | | | |____| |____ _ _| || |__| | \033[0m"
echo -e " ${color_title} \_____|_| \_\/_/ \_\/ |_____| |_| |______|______(_)_____\____/ \033[0m"
echo -e " ${color_title} | | \033[0m${color_text}http://gravitee.io\033[0m"
echo -e " ${color_title} __| | ___ _ __ ___ ___ \033[0m"
echo -e " ${color_title} / _\` |/ _ \ '_ \` _ \ / _ \ \033[0m"
echo -e " ${color_title}| (_| | __/ | | | | | (_) | \033[0m"
echo -e " ${color_title} \__,_|\___|_| |_| |_|\___/ \033[0m"
echo
}
init_env() {
local dockergrp
# define env
case "`uname`" in
CYGWIN*)
cygwin=true
;;
Darwin*)
darwin=true
;;
Linux)
linux=true
;;
esac
# test if docker must be run with sudo
dockergrp=$(groups | grep -c docker)
if [[ $darwin == false && $dockergrp == 0 ]]; then
dc_exec="sudo $dc_exec";
fi
}
init_dirs() {
echo "Init log directory in $WORKDIR ..."
mkdir -p "$WORKDIR/logs/"
echo
}
main() {
welcome
init_env
if [[ $? != 0 ]]; then
exit 1
fi
set -e
init_dirs
pushd $WORKDIR > /dev/null
echo "Download docker compose files ..."
curl -L https://raw.githubusercontent.com/gravitee-io/gravitee-docker/master/environments/demo/common.yml -o "common.yml"
curl -L https://raw.githubusercontent.com/gravitee-io/gravitee-docker/master/environments/demo/docker-compose-local.yml -o "docker-compose-local.yml"
echo
echo "Launch GraviteeIO demo ..."
$dc_exec
popd > /dev/null
}
main
================================================
FILE: favorite-file/gravitee-docker-compose/environments/sample-apis/docker-compose-sample-apis.yml
================================================
#-------------------------------------------------------------------------------
# Copyright (C) 2015 The Gravitee team (http://gravitee.io)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#-------------------------------------------------------------------------------
version: '2'
services:
sample-api-index:
image: graviteeio/gravitee-sample-index:latest
network_mode: "bridge"
labels:
- "traefik.backend=gravitee-sample-index"
- "traefik.frontend.rule=Host:api.gravitee.io"
- "traefik.frontend.entryPoints=https"
sample-api-echo:
image: graviteeio/gravitee-echo-api:nightly
network_mode: "bridge"
labels:
- "traefik.backend=gravitee-echo-api"
- "traefik.frontend.rule=Host:api.gravitee.io;PathPrefix:/echo"
- "traefik.frontend.entryPoints=https"
sample-api-whoami:
image: graviteeio/gravitee-whoami-api:latest
network_mode: "bridge"
labels:
- "traefik.backend=gravitee-whoami-api"
- "traefik.frontend.rule=Host:api.gravitee.io;PathPrefix:/whoami"
- "traefik.frontend.entryPoints=https"
sample-api-whattimeisit:
image: graviteeio/gravitee-whattimeisit-api:latest
network_mode: "bridge"
labels:
- "traefik.backend=gravitee-whattimeisit-api"
- "traefik.frontend.rule=Host:api.gravitee.io;PathPrefix:/whattimeisit"
- "traefik.frontend.entryPoints=https"
================================================
FILE: favorite-file/gravitee-docker-compose/platform/docker-compose.yml
================================================
version: '3'
networks:
default:
services:
nginx:
image: nginx:1.15-alpine
container_name: gio_platform_nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl/gio-selfsigned.crt:/etc/ssl/certs/gio-selfsigned.crt
- ./nginx/ssl/gio-selfsigned.key:/etc/ssl/private/gio-selfsigned.key
- ./nginx/ssl/gio.pem:/etc/ssl/certs/gio.pem
ports:
- "80:80"
- "443:443"
depends_on:
- apim_gateway
- apim_portal
- apim_management
- am_gateway
- am_management
- am_webui
mongodb:
image: mongo:3.4
container_name: gio_platform_mongo
ports:
- 27017:27017
environment:
- MONGO_INITDB_DATABASE=gravitee
volumes:
- ./mongo/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
- ./data/mongo:/data/db
- ./logs/mongodb:/var/log/mongodb
elasticsearch:
image: elasticsearch:6.4.0
container_name: gio_platform_elasticsearch
ports:
- 9200:9200
environment:
- http.host=0.0.0.0
- transport.host=0.0.0.0
- xpack.security.enabled=false
- xpack.monitoring.enabled=false
- cluster.name=elasticsearch
ulimits:
nofile: 65536
volumes:
- ./data/elasticsearch:/usr/share/elasticsearch/data
- ./logs/elasticsearch:/var/log/elasticsearch
apim_gateway:
image: graviteeio/gateway:latest
container_name: gio_platform_apim_gateway
volumes:
- ./logs/apim-gateway:/opt/graviteeio-gateway/logs
environment:
- gravitee_management_mongodb_uri=mongodb://mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_ratelimit_mongodb_uri=mongodb://mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_reporters_elasticsearch_endpoints_0=http://elasticsearch:9200
- gravitee_services_metrics_enabled=true
- gravitee_services_metrics_prometheus.enabled=true
depends_on:
- mongodb
- elasticsearch
apim_portal:
image: graviteeio/management-ui:latest
container_name: gio_platform_apim_portal
environment:
- MGMT_API_URL=https:\/\/localhost\/apim\/management\/
depends_on:
- apim_management
apim_management:
image: graviteeio/management-api:latest
container_name: gio_platform_apim_mgmt_api
volumes:
- ./logs/apim-management-api:/opt/graviteeio-management-api/logs
environment:
- gravitee_management_mongodb_uri=mongodb://mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_ratelimit_mongodb_uri=mongodb://mongodb:27017/gravitee?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_analytics_elasticsearch_endpoints_0=http://elasticsearch:9200
- gravitee_jwt_cookiepath=/apim/management
- gravitee_jwt_cookiesecure=true
depends_on:
- mongodb
- elasticsearch
am_gateway:
image: graviteeio/am-gateway:2
container_name: gio_platform_am_gateway
volumes:
- ./logs/am-gateway:/opt/graviteeio-am-gateway/logs
environment:
- gravitee_management_mongodb_uri=mongodb://mongodb:27017/gravitee-am?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_oauth2_mongodb_uri=mongodb://mongodb:27017/gravitee-am?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
depends_on:
- mongodb
am_management:
image: graviteeio/am-management-api:2
container_name: gio_platform_am_management
volumes:
- ./logs/am-management-api:/opt/graviteeio-am-management-api/logs
environment:
- gravitee_management_mongodb_uri=mongodb://mongodb:27017/gravitee-am?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_oauth2_mongodb_uri=mongodb://mongodb:27017/gravitee-am?serverSelectionTimeoutMS=5000&connectTimeoutMS=5000&socketTimeoutMS=5000
- gravitee_jwt_cookiepath=/am/management
- gravitee_jwt_cookiesecure=true
depends_on:
- mongodb
grafana:
image: grafana/grafana
ports:
- "3000:3000"
prometheus:
image: prom/prometheus
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
ports:
- "9090:9090"
am_webui:
image: graviteeio/am-management-ui:2
container_name: gio_platform_am_webui
environment:
- MGMT_API_URL=https:\/\/localhost\/am\/
- MGMT_UI_URL=https:\/\/localhost\/am\/ui\/
volumes:
- ./logs/am-webui:/var/log/nginx
depends_on:
- am_management
================================================
FILE: favorite-file/gravitee-docker-compose/platform/mongo/docker-entrypoint-initdb.d/create-index.js
================================================
// "apis" collection
db.apis.dropIndexes();
db.apis.createIndex( { "visibility" : 1 } );
db.apis.createIndex( { "group" : 1 } );
db.apis.reIndex();
// "applications" collection
db.applications.dropIndexes();
db.applications.createIndex( { "group" : 1 } );
db.applications.createIndex( { "name" : 1 } );
db.applications.createIndex( { "status" : 1 } );
db.applications.reIndex();
// "events" collection
db.events.dropIndexes();
db.events.createIndex( { "type" : 1 } );
db.events.createIndex( { "updatedAt" : 1 } );
db.events.createIndex( { "properties.api_id" : 1 } );
db.events.createIndex( { "properties.api_id":1, "type":1} );
db.events.reIndex();
// "plans" collection
db.plans.dropIndexes();
db.plans.createIndex( { "apis" : 1 } );
db.plans.reIndex();
// "subscriptions" collection
db.subscriptions.dropIndexes();
db.subscriptions.createIndex( { "plan" : 1 } );
db.subscriptions.createIndex( { "application" : 1 } );
db.subscriptions.reIndex();
// "keys" collection
db.keys.dropIndexes();
db.keys.createIndex( { "plan" : 1 } );
db.keys.createIndex( { "application" : 1 } );
db.keys.createIndex( { "updatedAt" : 1 } );
db.keys.createIndex( { "revoked" : 1 } );
db.keys.createIndex( { "plan" : 1 , "revoked" : 1, "updatedAt" : 1 } );
db.keys.reIndex();
// "pages" collection
db.pages.dropIndexes();
db.pages.createIndex( { "api" : 1 } );
db.pages.reIndex();
// "memberships" collection
db.memberships.dropIndexes();
db.memberships.createIndex( {"_id.userId":1, "_id.referenceId":1, "_id.referenceType":1}, { unique: true } );
db.memberships.createIndex( {"_id.referenceId":1, "_id.referenceType":1} );
db.memberships.createIndex( {"_id.referenceId":1, "_id.referenceType":1, "roles":1} );
db.memberships.createIndex( {"_id.userId":1, "_id.referenceType":1} );
db.memberships.createIndex( {"_id.userId":1, "_id.referenceType":1, "roles":1} );
db.memberships.reIndex();
// "roles" collection
db.roles.dropIndexes();
db.roles.createIndex( {"_id.scope": 1 } );
db.roles.reIndex();
// "audits" collection
db.audits.dropIndexes();
db.audits.createIndex( { "referenceType": 1, "referenceId": 1 } );
db.audits.createIndex( { "createdAt": 1 } );
db.audits.reIndex();
// "rating" collection
db.rating.dropIndexes();
db.rating.createIndex( { "api" : 1 } );
db.rating.reIndex();
// "ratingAnswers" collection
db.ratingAnswers.dropIndexes();
db.ratingAnswers.createIndex( { "rating" : 1 } );
// "portalnotifications" collection
db.portalnotifications.dropIndexes();
db.portalnotifications.createIndex( { "user" : 1 } );
db.portalnotifications.reIndex();
// "portalnotificationconfigs" collection
db.portalnotificationconfigs.dropIndexes();
db.portalnotificationconfigs.createIndex( {"_id.user":1, "_id.referenceId":1, "_id.referenceType":1}, { unique: true } );
db.portalnotificationconfigs.createIndex( {"_id.referenceId":1, "_id.referenceType":1, "hooks":1});
db.portalnotificationconfigs.reIndex();
// "genericnotificationconfigs" collection
db.genericnotificationconfigs.dropIndexes();
db.genericnotificationconfigs.createIndex( {"referenceId":1, "referenceType":1, "hooks":1});
db.genericnotificationconfigs.createIndex( {"referenceId":1, "referenceType":1});
db.genericnotificationconfigs.reIndex();
================================================
FILE: favorite-file/gravitee-docker-compose/platform/nginx/nginx.conf
================================================
worker_processes 4;
events { worker_connections 1024; }
http {
include /etc/nginx/mime.types;
resolver 127.0.0.11 ipv6=off;
upstream apim_management {
server apim_management:8083;
}
upstream apim_gateway {
server apim_gateway:8082;
}
upstream apim_portal {
server apim_portal:80;
}
upstream am_management {
server am_management:8093;
}
upstream am_gateway {
server am_gateway:8092;
}
upstream am_webui {
server am_webui:80;
}
server {
listen 80;
server_name localhost;
return 301 https://$server_name$request_uri; #Redirection
}
server {
listen 443 ssl;
listen [::]:443 ssl;
server_name localhost;
ssl_certificate /etc/ssl/certs/gio-selfsigned.crt;
ssl_certificate_key /etc/ssl/private/gio-selfsigned.key;
ssl_dhparam /etc/ssl/certs/gio.pem;
error_page 500 502 503 504 /50x.html;
location /apim/portal/ {
proxy_pass http://apim_portal/;
proxy_redirect $scheme://$host:$server_port/ $scheme://$http_host/apim/portal/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
location /apim/management/ {
proxy_pass http://apim_management/management/;
proxy_redirect $scheme://$host:$server_port/management/ /apim/management/;
sub_filter "/management/" "/apim/management/";
sub_filter_types application/json;
sub_filter_once off;
proxy_cookie_path /management /apim/management;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /apim/ {
proxy_pass http://apim_gateway/;
proxy_cookie_path / /apim;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
location /am/ui/ {
proxy_pass http://am_webui/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
sub_filter '<base href="/"' '<base href="/am/ui/"';
sub_filter_once on;
}
location /am/management/ {
proxy_pass http://am_management/management/;
proxy_redirect http://$host:$server_port/management/ /am/management/;
proxy_cookie_path /management /am/management;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
location /am/admin/ {
proxy_pass http://am_management/admin/;
proxy_redirect $scheme://$http_host/admin/ $scheme://$http_host/am/admin/;
proxy_cookie_path /admin /am/admin;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /am/ {
proxy_pass http://am_gateway/;
proxy_redirect $scheme://$http_host/apim/ $scheme://$http_host/apim/;
proxy_redirect $scheme://$http_host/ $scheme://$http_host/am/;
proxy_cookie_path / /am;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Path /am;
}
location = /50x.html {
root /usr/share/nginx/html;
}
}
}
================================================
FILE: favorite-file/gravitee-docker-compose/platform/nginx/ssl/gio-selfsigned.crt
================================================
-----BEGIN CERTIFICATE-----
MIIEpzCCA4+gAwIBAgIJALezRH6+njWDMA0GCSqGSIb3DQEBBQUAMIGTMQswCQYD
VQQGEwJGUjEPMA0GA1UECBMGRlJBTkNFMQ4wDAYDVQQHEwVQYXJpczEUMBIGA1UE
ChMLZ3Jhdml0ZWUuaW8xEzARBgNVBAsTCmRldmVsb3BlcnMxDTALBgNVBAMTBGcu
aW8xKTAnBgkqhkiG9w0BCQEWGmNvbnRhY3RAZ3Jhdml0ZWVzb3VyY2UuY29tMB4X
DTE4MDcyNDEwNTEzMVoXDTE5MDcyNDEwNTEzMVowgZMxCzAJBgNVBAYTAkZSMQ8w
DQYDVQQIEwZGUkFOQ0UxDjAMBgNVBAcTBVBhcmlzMRQwEgYDVQQKEwtncmF2aXRl
ZS5pbzETMBEGA1UECxMKZGV2ZWxvcGVyczENMAsGA1UEAxMEZy5pbzEpMCcGCSqG
SIb3DQEJARYaY29udGFjdEBncmF2aXRlZXNvdXJjZS5jb20wggEiMA0GCSqGSIb3
DQEBAQUAA4IBDwAwggEKAoIBAQCuRhiFGyVxW+7uCbzTh69cv+MBxFiKxoFV6QYB
wTnwlV2aiwt/WZhAhImvE1z0ap9IbzETKjQZx6lgTgBhh1v1TQNM589HpqzCpchN
UHOMjlP1rNRLQFmvvS+ELtdUaGavD2E7+BehaYyZ6MRKk5neDR+uJHLK1+3cH6yR
ZmBVQXTxL0Q9cJj6BfAD7XcgDC68RXbQePnt2M0zlADHvl/c7Xd4uPE8T4LYhGWj
iolip7zHgf9Pr75zkuMe2yCAA7/DPq7BLyIyEbYiXgQLqNNXtVEgfIzQSWSnd/zj
ck8pryjw9Tygt9uuUYIO+dMkfGKhjjFLmtnmmNg7pqEpnT9JAgMBAAGjgfswgfgw
HQYDVR0OBBYEFLWMP+J2/VGtCuLd0tuWSholcX+mMIHIBgNVHSMEgcAwgb2AFLWM
P+J2/VGtCuLd0tuWSholcX+moYGZpIGWMIGTMQswCQYDVQQGEwJGUjEPMA0GA1UE
CBMGRlJBTkNFMQ4wDAYDVQQHEwVQYXJpczEUMBIGA1UEChMLZ3Jhdml0ZWUuaW8x
EzARBgNVBAsTCmRldmVsb3BlcnMxDTALBgNVBAMTBGcuaW8xKTAnBgkqhkiG9w0B
CQEWGmNvbnRhY3RAZ3Jhdml0ZWVzb3VyY2UuY29tggkAt7NEfr6eNYMwDAYDVR0T
BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEASeyu/aEv34c88LoZwrTb3Ja3ACX2
FgD+GAcbfdb2aso5OKEGTcPyxvjQR3sjp2hXT7t14neWV+w8aYHubjKP8jth9ET5
oM32bwF/CHXA8cGsOvfNfAVzQm6UY9vn4+RZrLVIir5raBaAC53ZjrPKHhHkSVSt
iSQdHgykKbjhB0TxNn6v8NbRvRqWOeXcP0k5SWeRDxtqiDwzKJJQumaM6bB7FeFU
TSlJGJbjm0F3aWEOeXi1On3mqfdS29eQxKsJ4ZRbeP2mJRXQ8dyDl5cO8RoMDK3A
6xBXS83i145j7X8lojJy4dEq6kdvvosvTfjYU8A4etRnofD7IguMoGivLw==
-----END CERTIFICATE-----
================================================
FILE: favorite-file/gravitee-docker-compose/platform/nginx/ssl/gio-selfsigned.key
================================================
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEArkYYhRslcVvu7gm804evXL/jAcRYisaBVekGAcE58JVdmosL
f1mYQISJrxNc9GqfSG8xEyo0GcepYE4AYYdb9U0DTOfPR6aswqXITVBzjI5T9azU
S0BZr70vhC7XVGhmrw9hO/gXoWmMmejESpOZ3g0friRyytft3B+skWZgVUF08S9E
PXCY+gXwA+13IAwuvEV20Hj57djNM5QAx75f3O13eLjxPE+C2IRlo4qJYqe8x4H/
T6++c5LjHtsggAO/wz6uwS8iMhG2Il4EC6jTV7VRIHyM0Elkp3f843JPKa8o8PU8
oLfbrlGCDvnTJHxioY4xS5rZ5pjYO6ahKZ0/SQIDAQABAoIBAQCI+03gqhLHRKTM
c9j5R6ieNbHAPM3/3sHgfjYbgP8CzNTzWaGi6xCSfdsfQxAIihpDPCsNzll/fgHz
UbxY7KVqbatPctHplugqY1bK9pasf18dN0jzEVStnv3PX2Yf0aQMrAEYuwwP8r/y
ZhSMLfJ+qEAjiEC2kf1DzZ29+AN2XpzHbULZEH6uip7+lNsR3XCUfzm9OkHMlo+8
FpuUQj4VHRuQ6cEkR/M+Q9eZiBbFGEbUmlTD08j6F5aTJgEafXcG117lN/oOcN6g
ZnyQ3Pf/VOjSIly1PP0H/FGAsgWpR8OcI5MtP4YvX4LNm6p36YoY4a3H/IWc++GU
THs0lxqRAoGBAOXomkp20dUwZegetENhBVOiE79PAX8P4npK7Y/3aZxNetN80t6L
BjbNbkQh0ag1DTmA+DzCLfTgvdOw0USS+3qH1OUKEn67cVqduOkKfE1ACstYnXj5
pFfx6XZ2CRcgGpJmf/QXakVRfigENZdG0HbZEobh35KluLa3D1IdS+k9AoGBAMIN
Ky+gAm6ImeK/Gixuq6Qp2rzELIcsLqXeToKH+W44Y5qlXbnszVE9jrbi+/FwFPl6
gS+APYaS4lX1wYUiTwuRbOkBjCaD4DJnNFCvRuNpFDDazgM6HPheYgZTUBxQvQBk
6/OJbwuvlg9/RuULNUlGRSzr/mPbJRtAFuqJhpb9AoGAQadR4C/cLhAbGdUizxb2
qXJgR0Jtf/ZuS1P4USNrEkqB58D+irSSurWhZm1t7KXxt9kfimI9M2+2ZaxZpkZ+
7/e4EQv2SiCG90SRGGN5Kao/KuCMX46SotafP8fnQqZVUDdbFL5XB6KE7zJ8h02e
nEHS65e2+669d9gA1QcutVUCgYBKiGxR+o90jRsuMGCJOGjMwRa28lJ4CMxSATT+
heOUJix7tZBuXTnvPkmWjVBfx8EGobsE16jKC5jLk30k+ayKsOy4AlQmZvix41oA
s5HyvuV2blQ6gROngfj8nPtkJM6zXBAUlnEEeAiXIzfDua5Z2pevTWWETSPPd6pV
o0UCsQKBgQDEIGCz6RsKJqwqRPyuGIYu5OlmpBrKBOeYkKniHeAqM339nLkwjj2x
/91snUUuEd2bd6KjLhNC86IE32aoj0wC6m53BHTd9sX4WuTDbwSsyB+4T4o0tbV5
YyDsIPvtfhaZQL3XPC9zV5aeJfFtaoQ6D0vHHV9MXfsAS1M0PjFdMg==
-----END RSA PRIVATE KEY-----
================================================
FILE: favorite-file/gravitee-docker-compose/platform/nginx/ssl/gio.pem
================================================
-----BEGIN DH PARAMETERS-----
MIIBCAKCAQEArcQ6JmuXsIlIwSjJ21MeP81D/pum44+3dSMyw9+eGU9yJgwAOBBw
J3H57gM2x+8Q/VJowwgmXFOnkF4+Qtkmfjj25CO4hhHqj2Ex5mIZHMFGCKn5G3EE
EW+Cri/Lh7NS2hkBbEWRQkOLqIi/e9WnOcz/06bBYixNex7FqsnK5Dj1W0AXsW+x
pzo70S5u5FNG8LAN1+J5kOhXNMcwbd54jzHxQtdSlm1gA9XYQQbuTlGtRa482DNA
VYlFOnUpsFllvDOkIy+Baii1s3Qqv96vZHFaZdd73wORl7R9whpDFHtGMJsrDC4U
0gj/pYnMduhciNf6EWV2evQAprhLlFlqswIBAg==
-----END DH PARAMETERS-----
================================================
FILE: favorite-file/gravitee-docker-compose/platform/prometheus.yml
================================================
scrape_configs:
- job_name: 'gio-gw'
basic_auth:
username: admin
password: adminadmin
metrics_path: /_node/metrics/prometheus
static_configs:
- targets: ['apim_gateway:18082']
================================================
FILE: favorite-file/redis/redis
================================================
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /usr/local/redis-2.4.X/bin/redis-server
# config: /usr/local/ /redis-2.4.X/etc/redis.conf
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0
redis="/usr/local/bin/redis-server"
prog=$(basename $redis)
REDIS_CONF_FILE="/etc/redis.conf"
[ -f /etc/sysconfig/redis ] && . /etc/sysconfig/redis
lockfile=/var/lock/subsys/redis
start() {
[ -x $redis ] || exit 5
[ -f $REDIS_CONF_FILE ] || exit 6
echo -n $"Starting $prog: "
daemon $redis $REDIS_CONF_FILE
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog -QUIT
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading $prog: "
killproc $redis -HUP
RETVAL=$?
echo
}
force_reload() {
restart
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status >/dev/null 2>&1
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart|configtest)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart| reload|orce-reload}"
exit 2
esac
================================================
FILE: favorite-file/shell/crontab-redis-restart.sh
================================================
#!/bin/sh
redis-cli -h 127.0.0.1 -p 6379 -a 123456789 shutdown
sleep 5s
/usr/local/bin/redis-server /etc/redis.conf
================================================
FILE: favorite-file/shell/crontab-test.sh
================================================
#!/bin/sh
time1=$(date "+%Y-%m-%d %H:%M:%S")
echo "${time1}" >> /opt/1.txt
sleep 5s
time2=$(date "+%Y-%m-%d %H:%M:%S")
echo "${time2}" >> /opt/1.txt
================================================
FILE: favorite-file/shell/install_common_tool_CentOS.sh
================================================
#!/bin/sh
echo "开始常用工具安装"
yum install -y zip unzip lrzsz git epel-release wget htop deltarpm
echo "开始常用工具结束"
================================================
FILE: favorite-file/shell/install_common_tool_ubuntu.sh
================================================
#!/bin/sh
echo "开始常用工具安装"
sudo apt-get install -y zip unzip unrar lrzsz git wget htop
echo "开始常用工具结束"
================================================
FILE: favorite-file/shell/install_common_vim.sh
================================================
#!/bin/sh
echo "-----------------------------------------开始常用工具安装"
yum install -y zip unzip lrzsz git epel-release
echo "-----------------------------------------开始安装 vim"
yum install -y vim
echo "-----------------------------------------设置 vim 配置"
curl https://raw.githubusercontent.com/wklken/vim-for-server/master/vimrc > ~/.vimrc
================================================
FILE: favorite-file/shell/install_common_vim_zsh.sh
================================================
#!/bin/sh
echo "-----------------------------------------禁用防火墙"
systemctl stop firewalld.service
systemctl disable firewalld.service
echo "-----------------------------------------开始常用工具安装"
yum install -y zip unzip lrzsz git epel-release
echo "-----------------------------------------开始常用工具结束"
echo "-----------------------------------------开始安装 zsh"
yum install -y zsh
echo "-----------------------------------------开始安装 oh-my-zsh"
wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O - | sh
echo "-----------------------------------------设置默认终端为 oh-my-zsh"
chsh -s /bin/zsh root
echo "-----------------------------------------开始安装 vim"
yum install -y vim
echo "-----------------------------------------设置 vim 配置"
curl https://raw.githubusercontent.com/wklken/vim-for-server/master/vimrc > ~/.vimrc
================================================
FILE: favorite-file/shell/install_docker_centos7.sh
================================================
#!/bin/sh
echo "安装 docker 所需环境"
yum install -y yum-utils device-mapper-persistent-data lvm2
echo "添加 repo(可能网络会很慢,有时候会报:Timeout,所以要多试几次)"
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum makecache fast
echo "开始安装 docker"
yum install -y docker-ce
echo "启动 Docker"
systemctl start docker.service
echo "安装结束"
echo "运行 hello world 镜像"
docker run hello-world
echo "安装 docker compose"
curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
echo "输出 docker compose 版本号"
docker-compose --version
systemctl restart docker.service
systemctl enable docker.service
================================================
FILE: favorite-file/shell/install_docker_disable_firewalld_centos7-aliyun.sh
================================================
#!/bin/sh
echo "-----------------------------------------禁用防火墙"
systemctl stop firewalld.service
systemctl disable firewalld.service
echo "-----------------------------------------安装 docker 所需环境"
yum install -y yum-utils device-mapper-persistent-data lvm2
echo "-----------------------------------------添加 repo(可能网络会很慢,有时候会报:Timeout,所以要多试几次)"
echo "-----------------------------------------官网的地址 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo"
echo "-----------------------------------------这里用阿里云进行加速,不然可能会出现无法安装,阿里云官网说明:https://help.aliyun.com/document_detail/60742.html"
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
echo "-----------------------------------------开始安装 docker"
yum install -y docker-ce
echo "-----------------------------------------启动 Docker"
systemctl start docker.service
echo "-----------------------------------------安装结束"
echo "-----------------------------------------docker 加速"
touch /etc/docker/daemon.json
cat << EOF >> /etc/docker/daemon.json
{
"registry-mirrors": ["https://ldhc17y9.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
echo "-----------------------------------------运行 hello world 镜像"
docker run hello-world
echo "-----------------------------------------安装 docker compose"
echo "docker compose 的版本检查:https://docs.docker.com/compose/install/#install-compose"
curl -L "https://github.com/docker/compose/releases/download/1.23.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
echo "-----------------------------------------输出 docker compose 版本号"
docker-compose --version
================================================
FILE: favorite-file/shell/install_docker_disable_firewalld_centos7.sh
================================================
#!/bin/sh
echo "-----------------------------------------禁用防火墙"
systemctl stop firewalld.service
systemctl disable firewalld.service
echo "-----------------------------------------安装 docker 所需环境"
yum install -y yum-utils device-mapper-persistent-data lvm2
echo "-----------------------------------------添加 repo(可能网络会很慢,有时候会报:Timeout,所以要多试几次)"
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum makecache fast
echo "-----------------------------------------开始安装 docker"
yum install -y docker-ce
echo "-----------------------------------------启动 Docker"
systemctl start docker.service
echo "-----------------------------------------安装结束"
echo "-----------------------------------------运行 hello world 镜像"
docker run hello-world
echo "-----------------------------------------安装 docker compose"
echo "docker compose 的版本检查:https://docs.docker.com/compose/install/#install-compose"
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
echo "-----------------------------------------输出 docker compose 版本号"
docker-compose --version
systemctl restart docker.service
systemctl enable docker.service
================================================
FILE: favorite-file/shell/install_docker_k8s_disable_firewalld_centos7-aliyun.sh
================================================
#!/bin/sh
echo "-----------------------------------------禁用防火墙"
systemctl stop firewalld.service
systemctl disable firewalld.service
echo "-----------------------------------------安装 docker 所需环境"
yum install -y yum-utils device-mapper-persistent-data lvm2
echo "-----------------------------------------添加 repo(可能网络会很慢,有时候会报:Timeout,所以要多试几次)"
echo "-----------------------------------------官网的地址 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo"
echo "-----------------------------------------这里用阿里云进行加速,不然可能会出现无法安装,阿里云官网说明:https://help.aliyun.com/document_detail/60742.html"
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum makecache fast
echo "-----------------------------------------开始安装 docker"
yum install -y docker-ce-18.06.1.ce-3.el7
echo "-----------------------------------------启动 Docker"
systemctl start docker.service
systemctl enable docker.service
echo "-----------------------------------------安装结束"
echo "-----------------------------------------docker 加速"
touch /etc/docker/daemon.json
cat << EOF >> /etc/docker/daemon.json
{
"registry-mirrors": ["https://ldhc17y9.mirror.aliyuncs.com"]
}
EOF
systemctl daemon-reload
systemctl restart docker
echo "-----------------------------------------运行 hello world 镜像"
docker run hello-world
================================================
FILE: favorite-file/shell/install_jdk_offline_to_bash.sh
================================================
#!/bin/sh
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
echo "判断 JDK 压缩包是否存在"
if [ ! -f "/opt/setups/jdk-8u181-linux-x64.tar.gz" ]; then
echo "JDK 压缩包不存在"
exit 1
fi
echo "开始解压 JDK"
cd /opt/setups ; tar -zxf jdk-8u181-linux-x64.tar.gz
if [ ! -d "/opt/setups/jdk1.8.0_181" ]; then
echo "JDK 解压失败,结束脚本"
exit 1
fi
echo "JDK 解压包移到 /usr/local/ 目录下"
mv jdk1.8.0_181/ /usr/local/
echo "JDK 写入系统变量到 profile"
cat << EOF >> /etc/profile
# JDK
JAVA_HOME=/usr/local/jdk1.8.0_181
JRE_HOME=\$JAVA_HOME/jre
PATH=\$PATH:\$JAVA_HOME/bin
CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export JRE_HOME
export PATH
export CLASSPATH
EOF
echo "JDK 设置完成,需要你手动设置:source /etc/profile"
================================================
FILE: favorite-file/shell/install_jdk_offline_to_zsh.sh
================================================
#!/bin/sh
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
echo "判断 JDK 压缩包是否存在"
if [ ! -f "/opt/setups/jdk-8u191-linux-x64.tar.gz" ]; then
echo "JDK 压缩包不存在"
exit 1
fi
echo "开始解压 JDK"
cd /opt/setups ; tar -zxf jdk-8u191-linux-x64.tar.gz
if [ ! -d "/opt/setups/jdk1.8.0_191" ]; then
echo "JDK 解压失败,结束脚本"
exit 1
fi
echo "JDK 解压包移到 /usr/local/ 目录下"
mv jdk1.8.0_191/ /usr/local/
echo "JDK 写入系统变量到 zshrc"
cat << EOF >> ~/.zshrc
# JDK
JAVA_HOME=/usr/local/jdk1.8.0_191
JRE_HOME=\$JAVA_HOME/jre
PATH=\$PATH:\$JAVA_HOME/bin
CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export JRE_HOME
export PATH
export CLASSPATH
EOF
echo "JDK 设置完成,需要你手动设置:source ~/.zshrc"
================================================
FILE: favorite-file/shell/install_jdk_online.sh
================================================
#!/bin/sh
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
if [ ! -d "/usr/program" ]; then
mkdir /usr/program
fi
echo "下载 JDK"
cd /opt/setups
wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz
if [ ! -f "/opt/setups/jdk-8u151-linux-x64.tar.gz" ]; then
echo "JDK 下载失败,结束脚本"
exit 1
fi
echo "JDK 下载成功,开始解压 JDK"
tar -zxf jdk-8u151-linux-x64.tar.gz
if [ ! -d "/opt/setups/jdk1.8.0_151" ]; then
echo "JDK 解压失败,结束脚本"
exit 1
fi
echo "JDK 解压包移到 /usr/program/ 目录下"
mv jdk1.8.0_151/ /usr/program/
echo "JDK 写入系统变量到 zshrc"
cat << EOF >> ~/.zshrc
# JDK
JAVA_HOME=/usr/local/jdk1.8.0_151
JRE_HOME=\$JAVA_HOME/jre
PATH=\$PATH:\$JAVA_HOME/bin
CLASSPATH=.:\$JAVA_HOME/lib/dt.jar:\$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export JRE_HOME
export PATH
export CLASSPATH
EOF
echo "JDK 设置完成,需要你手动设置:source ~/.zshrc"
================================================
FILE: favorite-file/shell/install_maven_offline_to_bash.sh
================================================
#!/bin/sh
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
echo "判断 Maven 压缩包是否存在"
if [ ! -f "/opt/setups/apache-maven-3.5.4-bin.tar.gz" ]; then
echo "Maven 压缩包不存在"
exit 1
fi
echo "开始解压 Maven"
cd /opt/setups ; tar -zxf apache-maven-3.5.4-bin.tar.gz
if [ ! -d "/opt/setups/apache-maven-3.5.4" ]; then
echo "Maven 解压失败,结束脚本"
exit 1
fi
echo "Maven 解压包移到 /usr/local/ 目录下"
mv apache-maven-3.5.4/ /usr/local/
echo "Maven 写入系统变量到 profile"
cat << EOF >> /etc/profile
# Maven
M3_HOME=/usr/local/apache-maven-3.5.4
MAVEN_HOME=/usr/local/apache-maven-3.5.4
PATH=\$PATH:\$M3_HOME/bin
MAVEN_OPTS="-Xms256m -Xmx356m"
export M3_HOME
export MAVEN_HOME
export PATH
export MAVEN_OPTS
EOF
echo "Maven 设置完成,需要你手动设置:source /etc/profile"
================================================
FILE: favorite-file/shell/install_maven_offline_to_zsh.sh
================================================
#!/bin/sh
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
echo "判断 Maven 压缩包是否存在"
if [ ! -f "/opt/setups/apache-maven-3.5.4-bin.tar.gz" ]; then
echo "Maven 压缩包不存在"
exit 1
fi
echo "开始解压 Maven"
cd /opt/setups ; tar -zxf apache-maven-3.5.4-bin.tar.gz
if [ ! -d "/opt/setups/apache-maven-3.5.4" ]; then
echo "Maven 解压失败,结束脚本"
exit 1
fi
echo "Maven 解压包移到 /usr/local/ 目录下"
mv apache-maven-3.5.4/ /usr/local/
echo "Maven 写入系统变量到 zshrc"
cat << EOF >> ~/.zshrc
# Maven
M3_HOME=/usr/local/apache-maven-3.5.4
MAVEN_HOME=/usr/local/apache-maven-3.5.4
PATH=\$PATH:\$M3_HOME/bin
MAVEN_OPTS="-Xms256m -Xmx356m"
export M3_HOME
export MAVEN_HOME
export PATH
export MAVEN_OPTS
EOF
echo "Maven 设置完成,需要你手动设置:source ~/.zshrc"
================================================
FILE: favorite-file/shell/install_mycat_offline.sh
================================================
#!/bin/sh
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
echo "判断是否有 JDK 环境"
if [ -z $JAVA_HOME ];then
echo "没有 JAVA_HOME 环境变量"
exit 1
fi
echo "判断 /opt 目录下 mycat 压缩包是否存在"
if [ ! -f "/opt/setups/Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz" ]; then
echo "mycat 压缩包是否存在不存在"
exit 1
fi
echo "解压压缩包"
cd /opt/setups ; tar -zxf Mycat-server-1.6-RELEASE-20161028204710-linux.tar.gz
echo "把解压后目录移到 /usr/local/ 目录下"
mv /opt/setups/mycat /usr/local/
echo "写入系统变量到 zshrc"
echo 'MYCAT_HOME=/usr/local/mycat' >> ~/.zshrc
echo 'PATH=$PATH:$MYCAT_HOME/bin' >> ~/.zshrc
echo 'export MYCAT_HOME' >> ~/.zshrc
echo 'export PATH' >> ~/.zshrc
echo "mycat 设置完成,需要你手动设置:source ~/.zshrc"
================================================
FILE: favorite-file/shell/install_mysql5.6_offline_centos6.sh
================================================
#!/bin/sh
echo "安装 mysql 开始"
cd /opt/setups
tar zxvf mysql-5.6.35.tar.gz
mv /opt/setups/mysql-5.6.35 /usr/program/
yum install -y make gcc-c++ cmake bison-devel ncurses-devel
cd /usr/program/mysql-5.6.35/
mkdir -p /usr/program/mysql/data
cmake -DCMAKE_INSTALL_PREFIX=/usr/program/mysql -DMYSQL_DATADIR=/usr/program/mysql/data -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=utf8 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1
make
make install
cp /usr/program/mysql-5.6.35/support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig mysql on
cp /usr/program/mysql-5.6.35/support-files/my-default.cnf /etc/my.cnf
rm -rf /usr/program/mysql-5.6.35/
groupadd mysql
useradd -g mysql mysql -s /bin/false
chown -R mysql:mysql /usr/program/mysql/data
/usr/program/mysql/scripts/mysql_install_db --basedir=/usr/program/mysql --datadir=/usr/program/mysql/data --skip-name-resolve --user=mysql
ln -s /usr/program/mysql/bin/mysql /usr/bin
ln -s /usr/program/mysql/bin/mysqladmin /usr/bin
ln -s /usr/program/mysql/bin/mysqldump /usr/bin
ln -s /usr/program/mysql/bin/mysqlslap /usr/bin
iptables -I INPUT -p tcp -m tcp --dport 3306 -j ACCEPT
service iptables save
service iptables restart
echo "安装 mysql 结束,现在需要手动设置防火墙和禁用 selinux."
================================================
FILE: favorite-file/shell/install_mysql5.6_offline_centos7.sh
================================================
#!/bin/sh
echo "安装 mysql 开始"
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
echo "判断 JDK 压缩包是否存在"
if [ ! -f "/opt/setups/mysql-5.6.35.tar.gz" ]; then
echo "mysql 压缩包不存在"
exit 1
fi
cd /opt/setups
tar zxvf mysql-5.6.35.tar.gz
mv /opt/setups/mysql-5.6.35 /usr/local/
yum install -y make gcc-c++ cmake bison-devel ncurses-devel autoconf
cd /usr/local/mysql-5.6.35/
mkdir -p /usr/local/mysql/data
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=utf8 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1
make
make install
cp /usr/local/mysql-5.6.35/support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig mysql on
cp /usr/local/mysql-5.6.35/support-files/my-default.cnf /etc/my.cnf
rm -rf /usr/local/mysql-5.6.35/
groupadd mysql
useradd -g mysql mysql -s /bin/false
chown -R mysql:mysql /usr/local/mysql/data
/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --skip-name-resolve --user=mysql
ln -s /usr/local/mysql/bin/mysql /usr/bin
ln -s /usr/local/mysql/bin/mysqladmin /usr/bin
ln -s /usr/local/mysql/bin/mysqldump /usr/bin
ln -s /usr/local/mysql/bin/mysqlslap /usr/bin
echo "防火墙放行 3306 端口"
systemctl restart firewalld.service
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
systemctl stop firewalld.service
echo "安装 mysql 结束,现在需要手动设置防火墙和禁用 selinux."
================================================
FILE: favorite-file/shell/install_mysql5.7_offline_centos7.sh
================================================
#!/bin/sh
echo "安装 mysql 开始"
echo "必须准备两个文件:mysql-5.7.21.tar.gz 和 boost_1_59_0.tar.gz"
echo "mysql 5.7 依赖 boost,官网说明:https://dev.mysql.com/doc/mysql-sourcebuild-excerpt/5.7/en/source-installation.html"
echo "boost 下载地址(79M):http://www.boost.org/users/history/version_1_59_0.html"
if [ ! -f "/opt/setups/mysql-5.7.21.tar.gz" ]; then
echo "缺少 mysql-5.7.21.tar.gz 文件,结束脚本"
exit 1
fi
if [ ! -f "/opt/setups/boost_1_59_0.tar.gz" ]; then
echo "缺少 boost_1_59_0.tar.gz 文件,结束脚本"
exit 1
fi
cd /opt/setups
tar zxvf mysql-5.7.21.tar.gz
mv /opt/setups/mysql-5.7.21 /usr/local/
tar zxvf boost_1_59_0.tar.gz
mv /opt/setups/boost_1_59_0 /usr/local/
yum install -y make gcc-c++ cmake bison-devel ncurses-devel
cd /usr/local/mysql-5.7.21/
mkdir -p /usr/local/mysql/data
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DWITH_BOOST=/usr/local/boost_1_59_0 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=utf8 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1
make
make install
cp /usr/local/mysql-5.7.21/support-files/mysql.server /etc/init.d/mysql
chmod 755 /etc/init.d/mysql
chkconfig mysql on
echo "mysql 5.7 这个文件没了,需要自己创建一个"
cp /usr/local/mysql-5.7.21/support-files/my-default.cnf /etc/my.cnf
rm -rf /usr/local/mysql-5.7.21/
groupadd mysql
useradd -g mysql mysql -s /bin/false
chown -R mysql:mysql /usr/local/mysql/data
/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --skip-name-resolve --user=mysql
ln -s /usr/local/mysql/bin/mysql /usr/bin
ln -s /usr/local/mysql/bin/mysqladmin /usr/bin
ln -s /usr/local/mysql/bin/mysqldump /usr/bin
ln -s /usr/local/mysql/bin/mysqlslap /usr/bin
echo "防火墙放行 3306 端口"
systemctl restart firewalld.service
firewall-cmd --zone=public --add-port=3306/tcp --permanent
firewall-cmd --reload
systemctl stop firewalld.service
echo "安装 mysql 结束,现在需要手动设置防火墙和禁用 selinux."
================================================
FILE: favorite-file/shell/install_nginx_centos6.sh
================================================
#!/bin/sh
echo "安装 nginx"
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
if [ ! -d "/usr/program" ]; then
mkdir /usr/program
fi
if [ ! -d "/usr/local/nginx" ]; then
mkdir -p /usr/local/nginx
fi
if [ ! -d "/var/log/nginx" ]; then
mkdir -p /var/log/nginx
fi
if [ ! -d "/var/temp/nginx" ]; then
mkdir -p /var/temp/nginx
fi
if [ ! -d "/var/lock/nginx" ]; then
mkdir -p /var/lock/nginx
fi
echo "下载 Nginx"
cd /opt/setups
wget https://nginx.org/download/nginx-1.12.2.tar.gz
if [ ! -f "/opt/setups/nginx-1.12.2.tar.gz" ]; then
echo "Nginx 下载失败,结束脚本"
exit 1
fi
echo "Nginx 下载成功,开始解压 Nginx"
tar -zxf nginx-1.12.2.tar.gz
if [ ! -d "/opt/setups/nginx-1.12.2" ]; then
echo "Nginx 解压失败,结束脚本"
exit 1
fi
echo "安装源码安装依赖"
yum install -y gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
echo "开始安装 Nginx"
cd nginx-1.12.2/
./configure --prefix=/usr/local/nginx --pid-path=/var/local/nginx/nginx.pid --lock-path=/var/lock/nginx/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --with-http_ssl_module --http-scgi-temp-path=/var/temp/nginx/scgi
make
make install
echo "防火墙放行 80 端口"
iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT
service iptables save
service iptables restart
echo "启动 Nginx"
/usr/local/nginx/sbin/nginx
================================================
FILE: favorite-file/shell/install_nginx_centos7.sh
================================================
#!/bin/sh
echo "安装 nginx"
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
if [ ! -d "/usr/local/nginx" ]; then
mkdir -p /usr/local/nginx
fi
if [ ! -d "/var/log/nginx" ]; then
mkdir -p /var/log/nginx
fi
if [ ! -d "/var/temp/nginx" ]; then
mkdir -p /var/temp/nginx
fi
if [ ! -d "/var/lock/nginx" ]; then
mkdir -p /var/lock/nginx
fi
echo "下载 Nginx"
cd /opt/setups
wget https://nginx.org/download/nginx-1.14.0.tar.gz
if [ ! -f "/opt/setups/nginx-1.14.0.tar.gz" ]; then
echo "Nginx 下载失败,结束脚本"
exit 1
fi
echo "Nginx 下载成功,开始解压 Nginx"
tar -zxf nginx-1.14.0.tar.gz
if [ ! -d "/opt/setups/nginx-1.14.0" ]; then
echo "Nginx 解压失败,结束脚本"
exit 1
fi
echo "安装源码安装依赖"
yum install -y gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
echo "开始安装 Nginx"
cd nginx-1.14.0/
./configure --prefix=/usr/local/nginx --pid-path=/var/local/nginx/nginx.pid --lock-path=/var/lock/nginx/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --with-http_ssl_module --http-scgi-temp-path=/var/temp/nginx/scgi
make
make install
echo "防火墙放行 80 端口"
systemctl restart firewalld.service
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
systemctl restart firewalld.service
echo "启动 Nginx"
/usr/local/nginx/sbin/nginx
================================================
FILE: favorite-file/shell/install_redis_centos6.sh
================================================
#!/bin/sh
echo "安装 redis"
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
if [ ! -d "/usr/program" ]; then
mkdir /usr/program
fi
echo "下载 redis"
cd /opt/setups
wget http://download.redis.io/releases/redis-4.0.6.tar.gz
if [ ! -f "/opt/setups/redis-4.0.6.tar.gz" ]; then
echo "redis 下载失败,结束脚本"
exit 1
fi
echo "reids 下载成功"
echo "安装开始"
yum install -y gcc-c++ tcl
cd /opt/setups
tar zxvf redis-4.0.6.tar.gz
if [ ! -d "/opt/setups/redis-4.0.6" ]; then
echo "redis 解压失败,结束脚本"
exit 1
fi
mv redis-4.0.6/ /usr/program/
cd /usr/program/redis-4.0.6
make
make install
cp /usr/program/redis-4.0.6/redis.conf /etc/
sed -i 's/daemonize no/daemonize yes/g' /etc/redis.conf
echo "/usr/local/bin/redis-server /etc/redis.conf" >> /etc/rc.local
iptables -I INPUT -p tcp -m tcp --dport 6379 -j ACCEPT
service iptables save
service iptables restart
rm -rf /usr/program/redis-4.0.6
echo "安装结束"
================================================
FILE: favorite-file/shell/install_redis_centos7.sh
================================================
#!/bin/sh
echo "安装 redis"
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
echo "下载 redis"
cd /opt/setups
wget http://download.redis.io/releases/redis-4.0.6.tar.gz
if [ ! -f "/opt/setups/redis-4.0.6.tar.gz" ]; then
echo "redis 下载失败,结束脚本"
exit 1
fi
echo "reids 下载成功"
echo "安装开始"
yum install -y gcc-c++ tcl
cd /opt/setups
tar zxvf redis-4.0.6.tar.gz
if [ ! -d "/opt/setups/redis-4.0.6" ]; then
echo "redis 解压失败,结束脚本"
exit 1
fi
mv redis-4.0.6/ /usr/local/
cd /usr/local/redis-4.0.6
make
make install
cp /usr/local/redis-4.0.6/redis.conf /etc/
sed -i 's/daemonize no/daemonize yes/g' /etc/redis.conf
echo "/usr/local/bin/redis-server /etc/redis.conf" >> /etc/rc.local
echo "防火墙放行 6379 端口"
firewall-cmd --zone=public --add-port=6379/tcp --permanent
firewall-cmd --reload
rm -rf /usr/local/redis-4.0.6
echo "安装结束"
================================================
FILE: favorite-file/shell/install_tomcat_centos6.sh
================================================
#!/bin/sh
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
if [ ! -d "/usr/program" ]; then
mkdir /usr/program
fi
echo "下载 Tomcat"
cd /opt/setups
wget http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.0.47/bin/apache-tomcat-8.0.47.tar.gz
if [ ! -f "/opt/setups/apache-tomcat-8.0.47.tar.gz" ]; then
echo "Tomcat 下载失败,结束脚本"
exit 1
fi
echo "Tomcat 下载成功,开始解压 Tomcat"
tar -zxf apache-tomcat-8.0.47.tar.gz
if [ ! -d "/opt/setups/apache-tomcat-8.0.47" ]; then
echo "Tomcat 解压失败,结束脚本"
exit 1
fi
echo "Tomcat 解压包移到 /usr/program/ 目录下"
mv apache-tomcat-8.0.47/ /usr/program/
mv /usr/program/apache-tomcat-8.0.47/ /usr/program/tomcat8/
echo "防火墙放行 8080 端口"
iptables -I INPUT -p tcp -m tcp --dport 8080 -j ACCEPT
service iptables save
service iptables restart
echo "运行 Tomcat"
sh /usr/program/tomcat8/bin/startup.sh ; tail -200f /usr/program/tomcat8/logs/catalina.out
================================================
FILE: favorite-file/shell/install_tomcat_centos7.sh
================================================
#!/bin/sh
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
echo "下载 Tomcat"
cd /opt/setups
wget http://apache.fayea.com/tomcat/tomcat-8/v8.0.46/bin/apache-tomcat-8.0.46.tar.gz
if [ ! -f "/opt/setups/apache-tomcat-8.0.46.tar.gz" ]; then
echo "Tomcat 下载失败,结束脚本"
exit 1
fi
echo "Tomcat 下载成功,开始解压 Tomcat"
tar -zxf apache-tomcat-8.0.46.tar.gz
if [ ! -d "/opt/setups/apache-tomcat-8.0.46" ]; then
echo "Tomcat 解压失败,结束脚本"
exit 1
fi
echo "Tomcat 解压包移到 /usr/local/ 目录下"
mv apache-tomcat-8.0.46/ /usr/local/
mv /usr/local/apache-tomcat-8.0.46/ /usr/local/tomcat8/
echo "防火墙放行 8080 端口"
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
echo "运行 Tomcat"
sh /usr/local/tomcat8/bin/startup.sh ; tail -200f /usr/local/tomcat8/logs/catalina.out
================================================
FILE: favorite-file/shell/install_tomcat_offline_centos7.sh
================================================
#!/bin/sh
echo "判断常见的文件夹是否存在"
if [ ! -d "/opt/setups" ]; then
mkdir /opt/setups
fi
echo "判断 tomcat 压缩包是否存在"
if [ ! -f "/opt/setups/apache-tomcat-8.0.46.tar.gz" ]; then
echo "JDK 压缩包不存在"
exit 1
fi
cd /opt/setups
echo "开始解压 Tomcat"
tar -zxf apache-tomcat-8.0.46.tar.gz
if [ ! -d "/opt/setups/apache-tomcat-8.0.46" ]; then
echo "Tomcat 解压失败,结束脚本"
exit 1
fi
echo "Tomcat 解压包移到 /usr/local/ 目录下"
mv apache-tomcat-8.0.46/ /usr/local/
mv /usr/local/apache-tomcat-8.0.46/ /usr/local/tomcat8/
echo "防火墙放行 8080 端口"
firewall-cmd --zone=public --add-port=8080/tcp --permanent
firewall-cmd --reload
echo "运行 Tomcat"
sh /usr/local/tomcat8/bin/startup.sh ; tail -200f /usr/local/tomcat8/logs/catalina.out
================================================
FILE: favorite-file/shell/mysql_backup.sh
================================================
#!/bin/bash
backupDatetime=$1
if [ "$backupDatetime" = "" ];
then
echo -e "\033[0;31m 请输入备份日期 \033[0m"
exit 1
fi
echo "备份日期 = $backupDatetime"
/usr/bin/mysqldump -u root --password=123456 数据库名 > /opt/mydb-"$backupDatetime".sql
================================================
FILE: favorite-file/shell/repo_install_centos6.sh
================================================
#!/bin/sh
# 本文原内容来自:https://github.com/judasn/Linux-Tutorial/blob/master/CentOS-Extra-Packages.md
echo "源设置开始"
echo "备份默认源设置"
sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
cd /etc/yum.repos.d/
echo "下载网易 centos6 源"
sudo wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
echo "安装网易 centos6 源"
sudo mv CentOS6-Base-163.repo CentOS-Base.repo
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
echo "清除缓存后更新程序"
sudo yum clean all
sudo yum makecache
sudo yum update -y
echo "使用第三方源"
echo "安装 EPEL 源"
sudo yum install -y epel-release
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
echo "安装 RepoForge 源"
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
sudo rpm -ivh rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
echo "清除缓存后更新程序"
sudo yum clean all
sudo yum makecache
sudo yum update -y
echo "测试安装 htop"
sudo yum install -y htop
echo "完成源设置"
================================================
FILE: favorite-file/shell/shell-for.sh
================================================
#!/bin/bash
# 循环总次数
totalDegree=$1
# 如果没有传参,则默认值是 10
if [ "$totalDegree" = "" ];
then
totalDegree=10
fi
for((timeTemp = 0; timeTemp <= $totalDegree; timeTemp = timeTemp + 5))
do
echo "timeTemp=$timeTemp"
done
================================================
FILE: favorite-file/shell/shell-with-param-demo.sh
================================================
#!/bin/bash
methodParam=$1
SpringBoot=$2
SpringBootPath=$3
if [ "$methodParam" = "" ];
then
echo -e "\033[0;31m 未输入操作名 \033[0m \033[0;34m {start|stop|restart|status} \033[0m"
exit 1
fi
if [ "$SpringBoot" = "" ];
then
echo -e "\033[0;31m 未输入应用名 \033[0m"
exit 1
fi
if [ "$SpringBootPath" = "" ];
then
echo -e "\033[0;31m 未输入应用路径 \033[0m"
exit 1
fi
echo "操作名 = $methodParam"
echo "应用名 = $2"
echo "应用路径 = $3"
function start()
{
count=`ps -ef |grep java|grep $SpringBoot|grep -v grep|wc -l`
if [ $count != 0 ];then
echo "$SpringBoot is running..."
else
echo "Start $SpringBoot success..."
cd $SpringBootPath
BUILD_ID=dontKillMe nohup java -jar $SpringBoot > /opt/run-log.log 2>&1 &
fi
}
function stop()
{
echo "Stop $SpringBoot"
boot_id=`ps -ef |grep java|grep $SpringBoot|grep -v grep|awk '{print $2}'`
count=`ps -ef |grep java|grep $SpringBoot|grep -v grep|wc -l`
if [ $count != 0 ];then
kill $boot_id
count=`ps -ef |grep java|grep $SpringBoot|grep -v grep|wc -l`
boot_id=`ps -ef |grep java|grep $SpringBoot|grep -v grep|awk '{print $2}'`
kill -9 $boot_id
fi
}
function restart()
{
stop
sleep 2
start
}
function status()
{
count=`ps -ef |grep java|grep $SpringBoot|grep -v grep|wc -l`
if [ $count != 0 ];then
echo "$SpringBoot is running..."
else
echo "$SpringBoot is not running..."
fi
}
case $methodParam in
start)
start;;
stop)
stop;;
restart)
restart;;
status)
status;;
*)
echo -e "\033[0;31m Usage: \033[0m \033[0;34m sh $0 {start|stop|restart|status} {SpringBootJarName} \033[0m\033[0;31m Example: \033[0m\033[0;33m sh $0 start esmart-test.jar \033[0m"
esac
================================================
FILE: favorite-file/zsh/.zshrc
================================================
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/root/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="avit"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
source $ZSH/oh-my-zsh.sh
# User configuration
# export MANPATH="/usr/local/man:$MANPATH"
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/rsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
JAVA_HOME=/usr/program/jdk1.8.0_121
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export JRE_HOME
export PATH
export CLASSPATH
================================================
FILE: markdown-file/Alfresco-Install-And-Usage.md
================================================
# Alfresco 使用
## Alfresco 介绍
- 官网:<https://www.alfresco.com>
- 开源社区版下载:<https://www.alfresco.com/alfresco-community-download>
- 官网文档说明:<http://docs.alfresco.com/>
- 开源社区版本安装说明:<http://docs.alfresco.com/community/concepts/master-ch-install.html>
- Linux 版本安装说明:<http://docs.alfresco.com/community/tasks/simpleinstall-community-lin.html>
- 我的目的:用来管理公司发布的文档,比如:Word、Excel、记事本等这类,该系统支持在线预览文件。
## 环境说明
- CentOS 7.3 带有图形桌面(需要有)
- 下载下来的软件:**alfresco-community-installer-201704-linux-x64_3.bin**,大小:822M
- 安装包存放目录:/opt
## 开始安装:
- 使用 Linux 桌面方式进入系统,打开终端:
- 切换目录:`cd /opt`
- 赋予权限:`chmod +x alfresco-community-installer-201704-linux-x64_3.bin`
- `./alfresco-community-installer-201704-linux-x64_3.bin`
- 然后会出现如下图这种步骤引导安装界面,带有简体中文版,选择 `简单` 的基本流程安装方式,默认都是下一步下一步。其实选择 `高级` 也基本上是下一步下一步的,只是可以看到更多细节。
- 在设置管理员密码上,我是:123456(默认用户名是:admin)


- 安装完成后,可以选择开始启动程序。建议不勾选,我们来使用下面命令。
- 程序默认是安装在:**/opt/alfresco-community**
- 所以我们需要打开终端:
- 切换目录:`cd /opt/alfresco-community`
- 启动程序:`./alfresco.sh start`
- 停止程序:`./alfresco.sh stop`
- 启动完成后,用浏览器打开:<http://127.0.0.1:8080/share>(如果你 Linux 防火墙关闭了,也可以直接用其他机子直接访问,把这台机子当做服务器用),可以看到如下内容:


================================================
FILE: markdown-file/Ansible-Install-And-Settings.md
================================================
# Ansible 安装和配置
## Ansible 说明
- Ansible 官网:<https://www.ansible.com/>
- Ansible 官网 Github:<https://github.com/ansible/ansible>
- Ansible 官网文档:<https://docs.ansible.com//>
- 简单讲:它的作用就是把写 shell 这件事变成标准化、模块化。方便更好的自动化运维
## 安装
- 官网说明:<https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html>
- CentOS:`sudo yum install -y ansible`
- 查看版本:`ansible --version`
-------------------------------------------------------------------
## 配置基本概念
#### Ansible 基本配置文件顺序
- Ansible 执行的时候会按照以下顺序查找配置项,所以修改的时候要特别注意改的是哪个文件
```
ANSIBLE_CONFIG (环境变量)
ansible.cfg (脚本所在当前目录下)
~/.ansible.cfg (用户家目录下,默认没有)
/etc/ansible/ansible.cfg(安装后会自动生成)
```
#### 配置远程主机地址 (Ansible 称这些地址为 Inventory)
- 假设我有 3 台机子:
- 192.168.0.223
- 192.168.0.70
- 192.168.0.103
- 官网对此的配置说明:<https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#hosts-and-groups>
###### 给这三台机子设置免密登录的情况(一般推荐方式)
- 编辑 Ansible 配置文件:`vim /etc/ansible/hosts`
- 添加如下内容
```
[hadoop-host]
192.168.0.223
192.168.0.70
192.168.0.103
```
- 其中 `[hadoop-host]` 表示这些主机代表的一个组名
###### 如果不设置免密,直接采用账号密码(容易泄露信息)
- 编辑 Ansible 配置文件:`vim /etc/ansible/hosts`
- 添加如下内容
```
[hadoop-host]
hadoop-master ansible_host=192.168.0.223 ansible_user=root ansible_ssh_pass=123456
hadoop-node1 ansible_host=192.168.0.70 ansible_user=root ansible_ssh_pass=123456
hadoop-node2 ansible_host=192.168.0.103 ansible_user=root ansible_ssh_pass=123456
```
## 简单使用(`ad hoc`方式)
- ad hoc 官网:<https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html>
##### 运行 Ansible
- 运行 Ansible 的 `ping` 命令,看看配置正确时输出如下:
```
sudo ansible --private-key ~/.ssh/id_rsa all -m ping
```
- 让远程所有主机都执行 `ps` 命令,输出如下
```
ansible all -a 'ps'
```
- 让远程所有 hadoop-host 组的主机都执行 `ps` 命令,输出如下
```
ansible hadoop-host -a 'ps'
```
-------------------------------------------------------------------
## Playbook 脚本方式
- 官网:<https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html>
- 一些语法:<https://docs.ansible.com/ansible/latest/modules/command_module.html>
- playbook(剧本),顾名思义,就是需要定义一个脚本或者说配置文件,然后定义好要做什么。之后 ansible 就会根据 playbook 脚本对远程主机进行操作
#### 简单脚本
- 下面脚本让所有远程主机执行 `whoami` 命令,并把结果(当前用户名)输出到 `/opt/whoami.txt` 文件
- 创建脚本文件:`vim /opt/simple-playbook.yml`
```
- hosts: all
tasks:
- name: whoami
shell: 'whoami > /opt/whoami.txt'
```
- 执行命令:`ansible-playbook /opt/simple-playbook.yml`,结果如下,并且 opt 下也有文件生成
```
PLAY [all] **************************************************************************************************************************
TASK [Gathering Facts] **************************************************************************************************************
ok: [192.168.0.223]
ok: [192.168.0.103]
ok: [192.168.0.70]
TASK [whoami] ***********************************************************************************************************************
changed: [192.168.0.103]
changed: [192.168.0.223]
changed: [192.168.0.70]
PLAY RECAP **************************************************************************************************************************
192.168.0.103 : ok=2 changed=1 unreachable=0 failed=0
192.168.0.223 : ok=2 changed=1 unreachable=0 failed=0
192.168.0.70 : ok=2 changed=1 unreachable=0 failed=0
```
-------------------------------------------------------------------
## 平时用来测试
- 创建脚本文件:`vim /opt/test-playbook.yml`
```
- hosts: hadoop-test
remote_user: root
vars:
java_install_folder: /usr/local
tasks:
# 按行的方式写入
- name: Set JAVA_HOME 1
lineinfile:
dest=/etc/profile
line="JAVA_HOME={{ java_install_folder }}/jdk1.8.0_181"
# 按块的方式写入,#{mark} 会被自动替换成:begin 和 end 字符来包裹整块内容(我这里自己定义了词语)
- name: Set JAVA_HOME 2
blockinfile:
path: /etc/profile
marker: "#{mark} JDK ENV"
marker_begin: "开始"
marker_end: "结束"
block: |
export JAVA_HOME={{ java_install_folder }}/jdk1.8.0_181
export PATH=$PATH:$JAVA_HOME/bin
```
- 执行命令:`ansible-playbook /opt/test-playbook.yml`
-------------------------------------------------------------------
## 更多 playbook 实战
#### 禁用防火墙(CentOS 7.x)
- 创建脚本文件:`vim /opt/disable-firewalld-playbook.yml`
```
- hosts: all
remote_user: root
tasks:
- name: Disable SELinux at next reboot
selinux:
state: disabled
- name: disable firewalld
command: "{{ item }}"
with_items:
- systemctl stop firewalld
- systemctl disable firewalld
- setenforce 0
```
#### 基础环境(CentOS 7.x)
- 创建脚本文件:`vim /opt/install-basic-playbook.yml`
```
- hosts: all
remote_user: root
tasks:
- name: Disable SELinux at next reboot
selinux:
state: disabled
- name: disable firewalld
command: "{{ item }}"
with_items:
- systemctl stop firewalld
- systemctl disable firewalld
- setenforce 0
- name: install-basic
command: "{{ item }}"
with_items:
- yum install -y zip unzip lrzsz git epel-release wget htop deltarpm
- name: install-vim
shell: "{{ item }}"
with_items:
- yum install -y vim
- curl https://raw.githubusercontent.com/wklken/vim-for-server/master/vimrc > ~/.vimrc
- name: install-docker
shell: "{{ item }}"
with_items:
- yum install -y yum-utils device-mapper-persistent-data lvm2
- yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
- yum makecache fast
- yum install -y docker-ce
- systemctl start docker.service
- docker run hello-world
- name: install-docker-compose
shell: "{{ item }}"
with_items:
- curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
- chmod +x /usr/local/bin/docker-compose
- docker-compose --version
- systemctl restart docker.service
- systemctl enable docker.service
```
- 执行命令:`ansible-playbook /opt/install-basic-playbook.yml`
#### 修改 hosts
- 创建脚本文件:`vim /opt/hosts-playbook.yml`
```
- hosts: all
remote_user: root
tasks:
- name: update hosts
blockinfile:
path: /etc/hosts
block: |
192.168.0.223 linux01
192.168.0.223 linux02
192.168.0.223 linux03
192.168.0.223 linux04
192.168.0.223 linux05
```
- 执行命令:`ansible-playbook /opt/hosts-playbook.yml`
#### 部署 JDK
- 创建脚本文件:`vim /opt/jdk8-playbook.yml`
```
- hosts: hadoop-host
remote_user: root
vars:
java_install_folder: /usr/local
tasks:
- name: copy jdk
copy: src=/opt/jdk-8u181-linux-x64.tar.gz dest={{ java_install_folder }}
- name: tar jdk
shell: chdir={{ java_install_folder }} tar zxf jdk-8u181-linux-x64.tar.gz
- name: set JAVA_HOME
blockinfile:
path: /etc/profile
marker: "#{mark} JDK ENV"
block: |
JAVA_HOME={{ java_install_folder }}/jdk1.8.0_181
JRE_HOME=$JAVA_HOME/jre
PATH=$PATH:$JAVA_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export JRE_HOME
export PATH
export CLASSPATH
- name: source profile
shell: source /etc/profile
```
- 执行命令:`ansible-playbook /opt/jdk8-playbook.yml`
#### 部署 Hadoop 集群
- 创建脚本文件:`vim /opt/hadoop-playbook.yml`
- 刚学 Ansible,不好动配置文件,所以就只保留环境部分的设置,其他部分自行手工~
```
- hosts: hadoop-host
remote_user: root
tasks:
- name: Creates directory
file:
path: /data/hadoop/hdfs/name
state: directory
- name: Creates directory
file:
path: /data/hadoop/hdfs/data
state: directory
- name: Creates directory
file:
path: /data/hadoop/hdfs/tmp
state: directory
- name: set HADOOP_HOME
blockinfile:
path: /etc/profile
marker: "#{mark} HADOOP ENV"
block: |
HADOOP_HOME=/usr/local/hadoop
PATH=$PATH:$HADOOP_HOME/bin:$HADOOP_HOME/sbin
export HADOOP_HOME
export PATH
- name: source profile
shell: source /etc/profile
```
- 执行命令:`ansible-playbook /opt/hadoop-playbook.yml`
-------------------------------------------------------------------
## 资料
- [ANSIBLE模块 - shell和command区别](https://www.jianshu.com/p/081139f73613)
- <https://www.the5fire.com/ansible-guide-cn.html>
- <https://www.jianshu.com/p/62388a4fcbc6>
- <http://showme.codes/2017-06-12/ansible-introduce/>
================================================
FILE: markdown-file/Bash-Other-Bash.md
================================================
# Bash 其他常用命令
## 其他常用命令
- 编辑 hosts 文件:`vim /etc/hosts`,添加内容格式:`127.0.0.1 www.youmeek.com`
- RPM 文件操作命令:
- 安装
- `rpm -i example.rpm`,安装 example.rpm 包
- `rpm -iv example.rpm`,安装 example.rpm 包并在安装过程中显示正在安装的文件信息
- `rpm -ivh example.rpm`,安装 example.rpm 包并在安装过程中显示正在安装的文件信息及安装进度
- 查询
- `rpm -qa | grep jdk`,查看 jdk 是否被安装
- `rpm -ql jdk`,查看 jdk 是否被安装
- 卸载
- `rpm -e jdk`,卸载 jdk(一般卸载的时候都要先用 rpm -qa 看下整个软件的全名)
- YUM 软件管理:
- `yum install -y httpd`,安装 apache
- `yum remove -y httpd`,卸载 apache
- `yum info -y httpd`,查看 apache 版本信息
- `yum list --showduplicates httpd`,查看可以安装的版本
- `yum install httpd-查询到的版本号`,安装指定版本
- 更多命令可以看:<http://man.linuxde.net/yum>
- 查看某个配置文件,排除掉里面以 # 开头的注释内容:
- `grep '^[^#]' /etc/openvpn/server.conf`
- 查看某个配置文件,排除掉里面以 # 开头和 ; 开头的注释内容:
- `grep '^[^#;]' /etc/openvpn/server.conf`
## 资料
- <https://www.jianshu.com/p/180fb11a5b96>
================================================
FILE: markdown-file/Bash.md
================================================
# Bash 常用命令
## 基础常用命令
- `某个命令 --h`,对这个命令进行解释
- `某个命令 --help`,解释这个命令(更详细)
- `man某个命令`,文档式解释这个命令(更更详细)(执行该命令后,还可以按/+关键字进行查询结果的搜索)
- `Ctrl + c`,结束命令
- `TAB键`,自动补全命令(按一次自动补全,连续按两次,提示所有以输入开头字母的所有命令)
- `键盘上下键`,输入临近的历史命令
- `history`,查看所有的历史命令
- `Ctrl + r`,进入历史命令的搜索功能模式
- `clear`,清除屏幕里面的所有命令
- `pwd`,显示当前目录路径(常用)
- `firefox&`,最后后面的 **&** 符号,表示使用后台方式打开 Firefox,然后显示该进程的 PID 值
- `jobs`,查看后台运行的程序列表
- `ifconfig`,查看内网 IP 等信息(常用)
- `curl ifconfig.me`,查看外网 IP 信息
- `curl ip.cn`,查看外网 IP 信息
- `locate 搜索关键字`,快速搜索系统文件/文件夹(类似 Windows 上的 everything 索引式搜索)(常用)
- `updatedb`,配合上面的 locate,给 locate 的索引更新(locate 默认是一天更新一次索引)(常用)
- `date`,查看系统时间(常用)
- `date -s20080103`,设置日期(常用)
- `date -s18:24`,设置时间,如果要同时更改 BIOS 时间,再执行 `hwclock --systohc`(常用)
- `cal`,在终端中查看日历,肯定没有农历显示的
- `uptime`,查看系统已经运行了多久,当前有几个用户等信息(常用)
- `cat 文件路名`,显示文件内容(属于打印语句)
- `cat -n 文件名`,显示文件,并每一行内容都编号
- `more 文件名`,用分页的方式查看文件内容(按 space 翻下一页,按 *Ctrl + B* 返回上页)
- `less`文件名,用分页的方式查看文件内容(带上下翻页)
- 按 **j** 向下移动,按 **k** 向上移动
- 按 **/** 后,输入要查找的字符串内容,可以对文件进行向下查询,如果存在多个结果可以按 **n** 调到下一个结果出
- 按 **?** 后,输入要查找的字符串内容,可以对文件进行向上查询,如果存在多个结果可以按 **n** 调到下一个结果出
- `shutdown`
- `shutdown -hnow`,立即关机
- `shutdown -h+10`,10 分钟后关机
- `shutdown -h23:30`,23:30 关机
- `shutdown -rnew`,立即重启
- `poweroff`,立即关机(常用)
- `reboot`,立即重启(常用)
- `zip mytest.zip /opt/test/`,把 /opt 目录下的 test/ 目录进行压缩,压缩成一个名叫 mytest 的 zip 文件
- `unzip mytest.zip`,对 mytest.zip 这个文件进行解压,解压到当前所在目录
- `unzip mytest.zip -d /opt/setups/`,对 mytest.zip 这个文件进行解压,解压到 /opt/setups/ 目录下
- `tar -cvf mytest.tar mytest/`,对 mytest/ 目录进行归档处理(归档和压缩不一样)
- `tar -xvf mytest.tar`,释放 mytest.tar 这个归档文件,释放到当前目录
- `tar -xvf mytest.tar -C /opt/setups/`,释放 mytest.tar 这个归档文件,释放到 /opt/setups/ 目录下
- `last`,显示最近登录的帐户及时间
- `lastlog`,显示系统所有用户各自在最近登录的记录,如果没有登录过的用户会显示 **从未登陆过**
- `ls`,列出当前目录下的所有没有隐藏的文件 / 文件夹。
- `ls -a`,列出包括以.号开头的隐藏文件 / 文件夹(也就是所有文件)
- `ls -R`,显示出目录下以及其所有子目录的文件 / 文件夹(递归地方式,不显示隐藏的文件)
- `ls -a -R`,显示出目录下以及其所有子目录的文件 / 文件夹(递归地方式,显示隐藏的文件)
- `ls -al`,列出目录下所有文件(包含隐藏)的权限、所有者、文件大小、修改时间及名称(也就是显示详细信息)
- `ls -ld 目录名`,显示该目录的基本信息
- `ls -t`,依照文件最后修改时间的顺序列出文件名。
- `ls -F`,列出当前目录下的文件名及其类型。以 **/** 结尾表示为目录名,以 **\*** 结尾表示为可执行文件,以 **@** 结尾表示为符号连接
- `ls -lg`,同上,并显示出文件的所有者工作组名。
- `ls -lh`,查看文件夹类文件详细信息,文件大小,文件修改时间
- `ls /opt | head -5`,显示 opt 目录下前 5 条记录
- `ls -l | grep '.jar'`,查找当前目录下所有 jar 文件
- `ls -l /opt |grep "^-"|wc -l`,统计 opt 目录下文件的个数,不会递归统计
- `ls -lR /opt |grep "^-"|wc -l`,统计 opt 目录下文件的个数,会递归统计
- `ls -l /opt |grep "^d"|wc -l`,统计 opt 目录下目录的个数,不会递归统计
- `ls -lR /opt |grep "^d"|wc -l`,统计 opt 目录下目录的个数,会递归统计
- `ls -lR /opt |grep "js"|wc -l`,统计 opt 目录下 js 文件的个数,会递归统计
- `ls -l`,列出目录下所有文件的权限、所有者、文件大小、修改时间及名称(也就是显示详细信息,不显示隐藏文件)。显示出来的效果如下:
``` nginx
-rwxr-xr-x. 1 root root 4096 3月 26 10:57,其中最前面的 - 表示这是一个普通文件
lrwxrwxrwx. 1 root root 4096 3月 26 10:57,其中最前面的 l 表示这是一个链接文件,类似 Windows 的快捷方式
drwxr-xr-x. 5 root root 4096 3月 26 10:57,其中最前面的 d 表示这是一个目录
```
- `cd`,目录切换
- `cd ..`,改变目录位置至当前目录的父目录(上级目录)。
- `cd ~`,改变目录位置至用户登录时的工作目录。
- `cd 回车`,回到家目录
- `cd -`,上一个工作目录
- `cd dir1/`,改变目录位置至 dir1 目录下。
- `cd ~user`,改变目录位置至用户的工作目录。
- `cd ../user`,改变目录位置至相对路径user的目录下。
- `cd /../..`,改变目录位置至绝对路径的目录位置下。
- `cp 源文件 目标文件`,复制文件
- `cp -r 源文件夹 目标文件夹`,复制文件夹
- `cp -r -v 源文件夹 目标文件夹`,复制文件夹(显示详细信息,一般用于文件夹很大,需要查看复制进度的时候)
- `cp /usr/share/easy-rsa/2.0/keys/{ca.crt,server.{crt,key},dh2048.pem,ta.key} /etc/openvpn/keys/`,复制同目录下花括号中的文件
- `tar cpf - . | tar xpf - -C /opt`,复制当前所有文件到 /opt 目录下,一般如果文件夹文件多的情况下用这个更好,用 cp 比较容易出问题
- `mv 文件 目标文件夹`,移动文件到目标文件夹
- `mv 文件`,不指定目录重命名后的名字,用来重命名文件
- `touch 文件名`,创建一个空白文件/更新已有文件的时间(后者少用)
- `mkdir 文件夹名`,创建文件夹
- `mkdir -p /opt/setups/nginx/conf/`,创建一个名为 conf 文件夹,如果它的上级目录 nginx 没有也会跟着一起生成,如果有则跳过
- `rmdir 文件夹名`,删除文件夹(只能删除文件夹里面是没有东西的文件夹)
- `rm 文件`,删除文件
- `rm -r 文件夹`,删除文件夹
- `rm -r -i 文件夹`,在删除文件夹里的文件会提示(要的话,在提示后面输入yes)
- `rm -r -f 文件夹`,强制删除
- `rm -r -f 文件夹1/ 文件夹2/ 文件夹3/`删除多个
- `find`,高级查找
- `find . -name *lin*`,其中 . 代表在当前目录找,-name 表示匹配文件名 / 文件夹名,\*lin\* 用通配符搜索含有lin的文件或是文件夹
- `find . -iname *lin*`,其中 . 代表在当前目录找,-iname 表示匹配文件名 / 文件夹名(忽略大小写差异),\*lin\* 用通配符搜索含有lin的文件或是文件夹
- `find / -name *.conf`,其中 / 代表根目录查找,*.conf代表搜索后缀会.conf的文件
- `find /opt -name .oh-my-zsh`,其中 /opt 代表目录名,.oh-my-zsh 代表搜索的是隐藏文件 / 文件夹名字为 oh-my-zsh 的
- `find /opt -type f -iname .oh-my-zsh`,其中 /opt 代表目录名,-type f 代表只找文件,.oh-my-zsh 代表搜索的是隐藏文件名字为 oh-my-zsh 的
- `find /opt -type d -iname .oh-my-zsh`,其中 /opt 代表目录名,-type d 代表只找目录,.oh-my-zsh 代表搜索的是隐藏文件夹名字为 oh-my-zsh 的
- `find . -name "lin*" -exec ls -l {} \;`,当前目录搜索lin开头的文件,然后用其搜索后的结果集,再执行ls -l的命令(这个命令可变,其他命令也可以),其中 -exec 和 {} \; 都是固定格式
- `find /opt -type f -size +800M -print0 | xargs -0 du -h | sort -nr`,找出 /opt 目录下大于 800 M 的文件
- `find / -name "*tower*" -exec rm {} \;`,找到文件并删除
- `find / -name "*tower*" -exec mv {} /opt \;`,找到文件并移到 opt 目录
- `find . -name "*" |xargs grep "youmeek"`,递归查找当前文件夹下所有文件内容中包含 youmeek 的文件
- `find . -size 0 | xargs rm -f &`,删除当前目录下文件大小为0的文件
- `du -hm --max-depth=2 | sort -nr | head -12`,找出系统中占用容量最大的前 12 个目录
- `cat /etc/resolv.conf`,查看 DNS 设置
- `netstat -tlunp`,查看当前运行的服务,同时可以查看到:运行的程序已使用端口情况
- `env`,查看所有系统变量
- `export`,查看所有系统变量
- `echo`
- `echo $JAVA_HOME`,查看指定系统变量的值,这里查看的是自己配置的 JAVA_HOME。
- `echo "字符串内容"`,输出 "字符串内容"
- `echo > aa.txt`,清空 aa.txt 文件内容(类似的还有:`: > aa.txt`,其中 : 是一个占位符, 不产生任何输出)
- `unset $JAVA_HOME`,删除指定的环境变量
- `ln -s /opt/data /opt/logs/data`,表示给 /opt/logs 目录下创建一个名为 data 的软链接,该软链接指向到 /opt/data
- `grep`
- `shell grep -H '安装' *.sh`,查找当前目录下所有 sh 类型文件中,文件内容包含 `安装` 的当前行内容
- `grep 'test' java*`,显示当前目录下所有以 java 开头的文件中包含 test 的行
- `grep 'test' spring.ini docker.sh`,显示当前目录下 spring.ini docker.sh 两个文件中匹配 test 的行
- `ps`
- `ps –ef|grep java`,查看当前系统中有关 java 的所有进程
- `ps -ef|grep --color java`,高亮显示当前系统中有关 java 的所有进程
- `kill`
- `kill 1234`,结束 pid 为 1234 的进程
- `kill -9 1234`,强制结束 pid 为 1234 的进程(慎重)
- `killall java`,结束同一进程组内的所有为 java 进程
- `ps -ef|grep hadoop|grep -v grep|cut -c 9-15|xargs kill -9`,结束包含关键字 hadoop 的所有进程
- `head`
- `head -n 10 spring.ini`,查看当前文件的前 10 行内容
- `tail`
- `tail -n 10 spring.ini`,查看当前文件的后 10 行内容
- `tail -200f 文件名`,查看文件被更新的新内容尾 200 行,如果文件还有在新增可以动态查看到(一般用于查看日记文件)
## 用户、权限-相关命令
- 使用 pem 证书登录:`ssh -i /opt/mykey.pem root@192.168.0.70`
- 证书权限不能太大,不然无法使用:`chmod 600 mykey.pem`
- `hostname`,查看当前登陆用户全名
- `cat /etc/group`,查看所有组
- `cat /etc/passwd`,查看所有用户
- `groups youmeek`,查看 youmeek 用户属于哪个组
- `useradd youmeek -g judasn`,添加用户并绑定到 judasn 组下
- `userdel -r youmeek`,删除名字为 youmeek 的用户
- 参数:`-r`,表示删除用户的时候连同用户的家目录一起删除
- 修改普通用户 youmeek 的权限跟 root 权限一样:
- 常用方法(原理是把该用户加到可以直接使用 sudo 的一个权限状态而已):
- 编辑配置文件:`vim /etc/sudoers`
- 找到 98 行(预估),有一个:`root ALL=(ALL) ALL`,在这一行下面再增加一行,效果如下:
``` nginx
root ALL=(ALL) ALL
youmeek ALL=(ALL) ALL
```
- 另一种方法:
- 编辑系统用户的配置文件:`vim /etc/passwd`,找到 **root** 和 **youmeek** 各自开头的那一行,比如 root 是:`root:x:0:0:root:/root:/bin/zsh`,这个代表的含义为:*用户名:密码:UserId:GroupId:描述:家目录:登录使用的 shell*
- 通过这两行对比,我们可以直接修改 youmeek 所在行的 UserId 值 和 GroupId 值,都改为 0。
- `groupadd judasn`,添加一个名为 judasn 的用户组
- `groupdel judasn`,删除一个名为 judasn 的用户组(前提:先删除组下面的所有用户)
- `usermod 用户名 -g 组名`,把用户修改到其他组下
- `passwd youmeek`,修改 youmeek 用户的密码(前提:只有 root 用户才有修改其他用户的权限,其他用户只能修改自己的)
- `chmod 777 文件名/目录`,给指定文件增加最高权限,系统中的所有人都可以进行读写。
- linux 的权限分为 rwx。r 代表:可读,w 代表:可写,x 代表:可执行
- 这三个权限都可以转换成数值表示,r = 4,w = 2,x = 1,- = 0,所以总和是 7,也就是最大权限。第一个 7 是所属主(user)的权限,第二个 7 是所属组(group)的权限,最后一位 7 是非本群组用户(others)的权限。
- `chmod -R 777 目录` 表示递归目录下的所有文件夹,都赋予 777 权限
- `chown myUsername:myGroupName myFile` 表示修改文件所属用户、组
- `chown -R myUsername:myGroupName myFolder` 表示递归修改指定目录下的所有文件权限
- `su`:切换到 root 用户,终端目录还是原来的地方(常用)
- `su -`:切换到 root 用户,其中 **-** 号另起一个终端并切换账号
- `su 用户名`,切换指定用户帐号登陆,终端目录还是原来地方。
- `su - 用户名`,切换到指定用户帐号登陆,其中 **-** 号另起一个终端并切换账号
- `exit`,注销当前用户(常用)
- `sudo 某个命令`,使用管理员权限使用命令,使用 sudo 回车之后需要输入当前登录账号的密码。(常用)
- `passwd`,修改当前用户密码(常用)
- 添加临时账号,并指定用户根目录,并只有可读权限方法
- 添加账号并指定根目录(用户名 tempuser):`useradd -d /data/logs -m tempuser`
- 设置密码:`passwd tempuser` 回车设置密码
- 删除用户(该用户必须退出 SSH 才能删除成功),也会同时删除组:`userdel tempuser`
## 磁盘管理
- `df -h`,自动以合适的磁盘容量单位查看磁盘大小和使用空间
- `df -k`,以磁盘容量单位 K 为数值结果查看磁盘使用情况
- `df -m`,以磁盘容量单位 M 为数值结果查看磁盘使用情况
- `du -sh /opt`,查看 opt 这个文件夹大小 (h 的意思 human-readable 用人类可读性较好方式显示,系统会自动调节单位,显示合适大小的单位)
- `du -sh ./*`,查看当前目录下所有文件夹大小 (h 的意思 human-readable 用人类可读性较好方式显示,系统会自动调节单位,显示合适大小的单位)
- `du -sh /opt/setups/`,显示 /opt/setups/ 目录所占硬盘空间大小(s 表示 –summarize 仅显示总计,即当前目录的大小。h 表示 –human-readable 以 KB,MB,GB 为单位,提高信息的可读性)
- `mount /dev/sdb5 /newDir/`,把分区 sdb5 挂载在根目录下的一个名为 newDir 的空目录下,需要注意的是:这个目录最好为空,不然已有的那些文件将看不到,除非卸载挂载。
- 挂载好之后,通过:`df -h`,查看挂载情况。
- `umount /newDir/`,卸载挂载,用目录名
- 如果这样卸载不了可以使用:`umount -l /newDir/`
- `umount /dev/sdb5`,卸载挂载,用分区名
## wget 下载文件
- 常规下载:`wget http://www.gitnavi.com/index.html`
- 自动断点下载:`wget -c http://www.gitnavi.com/index.html`
- 后台下载:`wget -b http://www.gitnavi.com/index.html`
- 伪装代理名称下载:`wget --user-agent="Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16" http://www.gitnavi.com/index.html`
- 限速下载:`wget --limit-rate=300k http://www.gitnavi.com/index.html`
- 批量下载:`wget -i /opt/download.txt`,一个下载地址一行
- 后台批量下载:`wget -b -c -i /opt/download.txt`,一个下载地址一行
## 资料
- <http://wenku.baidu.com/view/1ad19bd226fff705cc170af3.html>
- <http://blog.csdn.net/nzing/article/details/9166057>
- <http://linuxtools-rst.readthedocs.io/zh_CN/latest/tool/wget.html>
================================================
FILE: markdown-file/CI-Install-And-Usage.md
================================================
# CI 一整套服务
## 环境说明
- CentOS 7.3
- 两台机子(一台机子也是可以,内存至少要 8G)
- 一台:Gitlab + Redis + Postgresql
- 硬件推荐:内存 4G
- 端口安排
- Gitlab:10080
- 一台:Nexus + Jenkins + SonarQube + Postgresql
- 硬件推荐:内存 8G
- 端口安排
- SonarQube:19000
- Nexus:18081
- Jenkins:18080
## Gitlab + Redis + Postgresql
- 预计会使用内存:2G 左右
- 这套方案来自(部分内容根据自己情况进行了修改):<https://github.com/sameersbn/docker-gitlab>
- 创建宿主机挂载目录:`mkdir -p /data/docker/gitlab/gitlab /data/docker/gitlab/redis /data/docker/gitlab/postgresql`
- 赋权(避免挂载的时候,一些程序需要容器中的用户的特定权限使用):`chmod -R 777 /data/docker/gitlab/gitlab /data/docker/gitlab/redis /data/docker/gitlab/postgresql`
- 这里使用 docker-compose 的启动方式,所以需要创建 docker-compose.yml 文件:
```yaml
version: '2'
services:
redis:
restart: always
image: sameersbn/redis:latest
command:
- --loglevel warning
volumes:
- /data/docker/gitlab/redis:/var/lib/redis:Z
postgresql:
restart: always
image: sameersbn/postgresql:9.6-2
volumes:
- /data/docker/gitlab/postgresql:/var/lib/postgresql:Z
environment:
- DB_USER=gitlab
- DB_PASS=password
- DB_NAME=gitlabhq_production
- DB_EXTENSION=pg_trgm
gitlab:
restart: always
image: sameersbn/gitlab:10.4.2-1
depends_on:
- redis
- postgresql
ports:
- "10080:80"
- "10022:22"
volumes:
- /data/docker/gitlab/gitlab:/home/git/data:Z
environment:
- DEBUG=false
- DB_ADAPTER=postgresql
- DB_HOST=postgresql
- DB_PORT=5432
- DB_USER=gitlab
- DB_PASS=password
- DB_NAME=gitlabhq_production
- REDIS_HOST=redis
- REDIS_PORT=6379
- TZ=Asia/Shanghai
- GITLAB_TIMEZONE=Beijing
- GITLAB_HTTPS=false
- SSL_SELF_SIGNED=false
- GITLAB_HOST=192.168.0.105
- GITLAB_PORT=10080
- GITLAB_SSH_PORT=10022
- GITLAB_RELATIVE_URL_ROOT=
- GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alphanumeric-string
- GITLAB_SECRETS_SECRET_KEY_BASE=long-and-random-alphanumeric-string
- GITLAB_SECRETS_OTP_KEY_BASE=long-and-random-alphanumeric-string
- GITLAB_ROOT_PASSWORD=
- GITLAB_ROOT_EMAIL=
- GITLAB_NOTIFY_ON_BROKEN_BUILDS=true
- GITLAB_NOTIFY_PUSHER=false
- GITLAB_EMAIL=notifications@example.com
- GITLAB_EMAIL_REPLY_TO=noreply@example.com
- GITLAB_INCOMING_EMAIL_ADDRESS=reply@example.com
- GITLAB_BACKUP_SCHEDULE=daily
- GITLAB_BACKUP_TIME=01:00
- SMTP_ENABLED=false
- SMTP_DOMAIN=www.example.com
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- SMTP_USER=mailer@example.com
- SMTP_PASS=password
- SMTP_STARTTLS=true
- SMTP_AUTHENTICATION=login
- IMAP_ENABLED=false
- IMAP_HOST=imap.gmail.com
- IMAP_PORT=993
- IMAP_USER=mailer@example.com
- IMAP_PASS=password
- IMAP_SSL=true
- IMAP_STARTTLS=false
- OAUTH_ENABLED=false
- OAUTH_AUTO_SIGN_IN_WITH_PROVIDER=
- OAUTH_ALLOW_SSO=
- OAUTH_BLOCK_AUTO_CREATED_USERS=true
- OAUTH_AUTO_LINK_LDAP_USER=false
- OAUTH_AUTO_LINK_SAML_USER=false
- OAUTH_EXTERNAL_PROVIDERS=
- OAUTH_CAS3_LABEL=cas3
- OAUTH_CAS3_SERVER=
- OAUTH_CAS3_DISABLE_SSL_VERIFICATION=false
- OAUTH_CAS3_LOGIN_URL=/cas/login
- OAUTH_CAS3_VALIDATE_URL=/cas/p3/serviceValidate
- OAUTH_CAS3_LOGOUT_URL=/cas/logout
- OAUTH_GOOGLE_API_KEY=
- OAUTH_GOOGLE_APP_SECRET=
- OAUTH_GOOGLE_RESTRICT_DOMAIN=
- OAUTH_FACEBOOK_API_KEY=
- OAUTH_FACEBOOK_APP_SECRET=
- OAUTH_TWITTER_API_KEY=
- OAUTH_TWITTER_APP_SECRET=
- OAUTH_GITHUB_API_KEY=
- OAUTH_GITHUB_APP_SECRET=
- OAUTH_GITHUB_URL=
- OAUTH_GITHUB_VERIFY_SSL=
- OAUTH_GITLAB_API_KEY=
- OAUTH_GITLAB_APP_SECRET=
- OAUTH_BITBUCKET_API_KEY=
- OAUTH_BITBUCKET_APP_SECRET=
- OAUTH_SAML_ASSERTION_CONSUMER_SERVICE_URL=
- OAUTH_SAML_IDP_CERT_FINGERPRINT=
- OAUTH_SAML_IDP_SSO_TARGET_URL=
- OAUTH_SAML_ISSUER=
- OAUTH_SAML_LABEL="Our SAML Provider"
- OAUTH_SAML_NAME_IDENTIFIER_FORMAT=urn:oasis:names:tc:SAML:2.0:nameid-format:transient
- OAUTH_SAML_GROUPS_ATTRIBUTE=
- OAUTH_SAML_EXTERNAL_GROUPS=
- OAUTH_SAML_ATTRIBUTE_STATEMENTS_EMAIL=
- OAUTH_SAML_ATTRIBUTE_STATEMENTS_NAME=
- OAUTH_SAML_ATTRIBUTE_STATEMENTS_FIRST_NAME=
- OAUTH_SAML_ATTRIBUTE_STATEMENTS_LAST_NAME=
- OAUTH_CROWD_SERVER_URL=
- OAUTH_CROWD_APP_NAME=
- OAUTH_CROWD_APP_PASSWORD=
- OAUTH_AUTH0_CLIENT_ID=
- OAUTH_AUTH0_CLIENT_SECRET=
- OAUTH_AUTH0_DOMAIN=
- OAUTH_AZURE_API_KEY=
- OAUTH_AZURE_API_SECRET=
- OAUTH_AZURE_TENANT_ID=
```
- 启动:`docker-compose up -d`,启动比较慢,等个 2 分钟左右。
- 浏览器访问 Gitlab:<http://192.168.0.105:10080/users/sign_in>
- 默认用户是 root,密码首次访问必须重新设置,并且最小长度为 8 位,我习惯设置为:aa123456
- 添加 SSH key:<http://192.168.0.105:10080/profile/keys>
- Gitlab 的具体使用可以看另外文章:[Gitlab 的使用](Gitlab-Install-And-Settings.md)
## Nexus + Jenkins + SonarQube
- 预计会使用内存:4G 左右
- 创建宿主机挂载目录:`mkdir -p /data/docker/ci/nexus /data/docker/ci/jenkins /data/docker/ci/jenkins/lib /data/docker/ci/jenkins/home /data/docker/ci/sonarqube /data/docker/ci/postgresql /data/docker/ci/gatling/results`
- 赋权(避免挂载的时候,一些程序需要容器中的用户的特定权限使用):`chmod -R 777 /data/docker/ci/nexus /data/docker/ci/jenkins/lib /data/docker/ci/jenkins/home /data/docker/ci/sonarqube /data/docker/ci/postgresql /data/docker/ci/gatling/results`
- 下面有一个细节要特别注意:yml 里面不能有中文。还有就是 sonar 的挂载目录不能直接挂在 /opt/sonarqube 上,不然会启动不了。
- 这里使用 docker-compose 的启动方式,所以需要创建 docker-compose.yml 文件:
```yaml
version: '3'
networks:
prodnetwork:
driver: bridge
services:
sonardb:
image: postgres:9.6.6
restart: always
ports:
- "5433:5432"
networks:
- prodnetwork
volumes:
- /data/docker/ci/postgresql:/var/lib/postgresql
environment:
- POSTGRES_USER=sonar
- POSTGRES_PASSWORD=sonar
sonar:
image: sonarqube:6.7.1
restart: always
ports:
- "19000:9000"
- "19092:9092"
networks:
- prodnetwork
depends_on:
- sonardb
volumes:
- /data/docker/ci/sonarqube/conf:/opt/sonarqube/conf
- /data/docker/ci/sonarqube/data:/opt/sonarqube/data
- /data/docker/ci/sonarqube/extension:/opt/sonarqube/extensions
- /data/docker/ci/sonarqube/bundled-plugins:/opt/sonarqube/lib/bundled-plugins
environment:
- SONARQUBE_JDBC_URL=jdbc:postgresql://sonardb:5432/sonar
- SONARQUBE_JDBC_USERNAME=sonar
- SONARQUBE_JDBC_PASSWORD=sonar
nexus:
image: sonatype/nexus3
restart: always
ports:
- "18081:8081"
networks:
- prodnetwork
volumes:
- /data/docker/ci/nexus:/nexus-data
jenkins:
image: wine6823/jenkins:1.1
restart: always
ports:
- "18080:8080"
networks:
- prodnetwork
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /usr/bin/docker:/usr/bin/docker
- /etc/localtime:/etc/localtime:ro
- $HOME/.ssh:/root/.ssh
- /data/docker/ci/jenkins/lib:/var/lib/jenkins/
- /data/docker/ci/jenkins/home:/var/jenkins_home
depends_on:
- nexus
- sonar
environment:
- NEXUS_PORT=8081
- SONAR_PORT=9000
- SONAR_DB_PORT=5432
```
- 启动:`docker-compose up -d`,启动比较慢,等个 2 分钟左右。
- 浏览器访问 SonarQube:<http://192.168.0.105:19000>
- 默认用户名:admin
- 默认密码:admin
- 插件安装地址:<http://192.168.0.105:19000/admin/marketplace>
- 代码检查规范选择:<http://192.168.0.105:19000/profiles>
- 如果没有安装相关检查插件,默认是没有内容可以设置,建议现在插件市场安装 FindBugs,这样也可以帮你生成插件目录:`/extension/plugins`
- 如果你有其他额外插件,可以把 jar 放在 `${SONAR_HOME}/extension/plugins` 目录下,然后重启下 sonar
- 浏览器访问 Nexus:<http://192.168.0.105:18081>
- 默认用户名:admin
- 默认密码:admin123
- 浏览器访问 Jenkins:<http://192.168.0.105:18080>
- 首次进入 Jenkins 的 Web UI 界面是一个解锁页面 Unlock Jenkins,需要让你输入:Administrator password
- 这个密码放在:`/var/jenkins_home/secrets/initialAdminPassword`,你需要先:`docker exec -it ci_jenkins_1 /bin/bash`
- 然后:`cat /var/jenkins_home/secrets/initialAdminPassword`,找到初始化密码
---------------------------------
## 配置 Jenkins 拉取代码权限
- 因为 dockerfile 中我已经把宿主机的 .ssh 下的挂载在 Jenkins 的容器中
- 所以读取宿主机的 pub:`cat ~/.ssh/id_rsa.pub`,然后配置在 Gitlab 中:<http://192.168.0.105:10080/profile/keys>
- Jenkinsfile 中 Git URL 使用:ssh 协议,比如:`ssh://git@192.168.0.105:10022/gitnavi/spring-boot-ci-demo.git`
## Jenkins 特殊配置(减少权限问题,如果是内网的话)
- 访问:<http://192.168.0.105:18080/configureSecurity/>
- 去掉 `防止跨站点请求伪造`
- 勾选 `登录用户可以做任何事` 下面的:`Allow anonymous read access`
## 配置 Gitlab Webhook
- Jenkins 访问:<http://192.168.0.105:18080/job/任务名/configure>
- 在 `Build Triggers` 勾选:`触发远程构建 (例如,使用脚本)`,在 `身份验证令牌` 输入框填写任意字符串,这个等下 Gitlab 会用到,假设我这里填写:112233
- Gitlab 访问:<http://192.168.0.105:10080/用户名/项目名/settings/integrations>
- 在 `URL` 中填写:`http://192.168.0.105:18080/job/任务名/build?token=112233`
## 资料
- <https://blog.csdn.net/ruangong1203/article/details/73065410>
================================================
FILE: markdown-file/CentOS-7-Install.md
================================================
# CentOS 7 安装
## 概括
- 本教程中主要演示了 VMware Workstation 下安装 `CentOS 7.3` 的过程。
- VMware 的使用细节可以看这篇:[CentOS 6 安装](CentOS-Install.md)
- 如果你是要安装到 PC 机中,你需要准备一个 U 盘,以及 Windows 下载这个软件:[USBWriter(提取码:5aa2)](https://pan.baidu.com/s/1gg83h9T)
- 如果你是要安装到 PC 机中,你需要准备一个 U 盘,以及 macOS 下载这个软件:[balenaEtcher(提取码:oqp9)](https://pan.baidu.com/s/1l5K48tfuCKdn0wR_62PjJA)
- USBWriter 的使用很简单,如下图即可制作一个 CentOS 系统盘

## VMware 下安装 CentOS 过程
- VMware Workstation 的介绍和下载
- 官网:<https://www.vmware.com/products/workstation>
- wiki:<https://zh.wikipedia.org/wiki/VMware_Workstation>
- 百度 wiki:<http://baike.baidu.com/view/555554.htm>
- 百度云下载(64 位):<http://pan.baidu.com/s/1eRuJAFK>
- 官网下载:<http://www.vmware.com/products/workstation/workstation-evaluation>
- 安装细节开始:





- 如上图,默认是最小安装,点击进去,选择桌面安装。
- 如上图,默认是自动分区,如果懂得分区,点击进去,进行手动分区,CentOS 7 少了主分区,逻辑分区的选择了。

- 如上图,root 密码必须设置,我习惯测试的时候是:123456
- 我没有创建用户,喜欢用 root


- 如上图,许可证必须点击进去勾选同意相关协议。
- 如上图,网络可以稍后在设置,主机名可以现在先填写




- 如上图右上角,一般我们都选择跳过




- 到此完成,其他该做啥就做啥
================================================
FILE: markdown-file/CentOS-Install.md
================================================
# CentOS 安装
## 概括
- 本教程中主要演示了 VirtualBox 和 VMware Workstation 下安装 `CentOS 6.6` 的过程。
- VirtualBox 是免费开源,我个人在使用经历中遇到过很多次崩溃、安装有问题等,所以它不是我主推的虚拟机
- VMware Workstation 是商业软件,很好用,一些辅助功能也很到位,主推该虚拟机。
- 如果你是要安装到 PC 机中,你需要准备一个 U 盘,以及下载这个软件:[USBWriter(提取码:5aa2)](https://pan.baidu.com/s/1gg83h9T)
- USBWriter 的使用很简单,如下图即可制作一个 CentOS 系统盘

## VirtualBox 下安装 CentOS 过程
- VirtualBox 的介绍和下载
- 官网:<https://www.virtualbox.org/>
- wiki:<https://zh.wikipedia.org/zh/VirtualBox>
- 百度 wiki:<http://baike.baidu.com/view/1047853.htm>
- 百度云下载(32 位和 64 位一体):<http://pan.baidu.com/s/1kTR3hOj>
- 官网下载:<https://www.virtualbox.org/wiki/Downloads>
#### VirtualBox 安装细节开始:
- 
- 如上图标注 1 所示:点击 `新建` 一个虚拟机。
- 如上图标注 2 所示:在填写 `名称` 的时候,输入 `CentOS` 相关字眼的时候,下面的版本类型会跟着变化,自动识别为 `Red Hat`
- 
- 如上图标注 1 所示:我们装的是 64 位系统,如果你本机内存足够大,建议可以给 2 ~ 4 G 的容量
- 
- 
- 
- 
- 如上图所示,命名最好规范,最好要带上系统版本号,硬盘大小建议在 8 ~ 20 G
- 
- 如上图 gif 演示,当我们创建好虚拟机之后,需要选择模拟光驱进行系统镜像安装
- 
- 
- 如上图箭头所示,我们这里选择 `Skip`,跳过对镜像的检查,这个一般需要检查很久,而且我们用 iso 文件安装的,一般没这个必要
- 
- 
- 如上图标注 1 所示,建议 Linux 纯新手使用简体中文环境
- 
- 
- 
- 如上图标注 1 所示,因为我们是用全新的虚拟机,虚拟出来的硬盘都是空的,所以这里可以忽略所有数据
- 
- 
- 
- 再次强调下,root 账号也就是图上所说的 `根账号`,它是最顶级账号,密码最好别忘记了
- 
- 
- 如上图标注 1 所示,因为我们是用全新的虚拟机,所以这里选择 `使用所有空间` ,然后 CentOS 会按它默认的方式进行分区
- 
- 
- `Desktop` 代表:图形界面版,会默认安装很多软件,建议新手选择此模式,我后面其他文章的讲解都是基于此系统下,如果你不是此模式的系统可能在安装某些软件的时候会出现某些依赖包没有安装的情况
- `basic sever` 代表:命令行界面,有良好基础的基本都会喜欢这个
- 
- 上一步我选择的是 `Desktop` 所以有很多软件需要安装,这个过程大概需要 5 ~ 10 分钟
- 
- 安装完成
- 
- 安装完成后一定要把盘片删除,防止系统启动的时候去读盘,重新进入安装系统模式
## VMware 下安装 CentOS 过程
- VMware Workstation 的介绍和下载
- 官网:<https://www.vmware.com/products/workstation>
- wiki:<https://zh.wikipedia.org/wiki/VMware_Workstation>
- 百度 wiki:<http://baike.baidu.com/view/555554.htm>
- 百度云下载(64 位):<http://pan.baidu.com/s/1eRuJAFK>
- 官网下载:<http://www.vmware.com/products/workstation/workstation-evaluation>
#### VMware 安装细节开始:
- 
- 
- 默认 VMware 选择的是 `典型` 我不推荐,我下面的步骤是选择 `自定义(高级)`。如果你非常了解 Linux 系统倒是可以考虑选择 `典型`,在它默认安装完的系统上可以很好地按你的需求进行修改
- 
- 
- 牢记:不要在这一步就选择镜像文件,不然也会直接进入 `典型` 模式,直接按它的规则进行系统安装
- 
- 
- 
- 
- 
- 桥接模式:(建议选择此模式)创建一个独立的虚拟主机,在桥接模式下的虚拟主机网络一般要为其配 IP 地址、子网掩码、默认网关(虚拟机ip地址要与主机ip地址处于同网段)
- NAT 模式:把物理主机作为路由器进行访问互联网,优势:联网简单,劣势:虚拟主机无法与物理主机通讯
- 主机模式:把虚拟主机网络与真实网络隔开,但是各个虚拟机之间可以互相连接,虚拟机和物理机也可以连接
- > 上面解释来源:<http://jingyan.baidu.com/article/3f16e003cd0a0d2591c103b4.html>
- 
- Buslogic 和 LSIlogic 都是虚拟硬盘 SCSI 设备的类型,旧版本的 OS 默认的是 Buslogic,LSIlogic 类型的硬盘改进了性能,对于小文件的读取速度有提高,支持非 SCSI 硬盘比较好。
- > 上面解释来源:<http://www.cnblogs.com/R-zqiang/archive/2012/11/23/2785134.html>
- 
- 
- 
- 强烈建议至少要给 20 G,不然装不了多少软件的
- 
- 
- 
- 如上图 gif 所示,在创建完虚拟机之后,我们要加载系统镜像,然后启动虚拟机进行安装,接下来的安装步骤跟上面使用 VirtualBox 安装细节基本一样,不一样的地方是我这里选择的是自定义分区,不再是选择默认分区方式
- 
- 如上图箭头所示,这里我们选择自定义分区方式
- 
- 如上图 gif 所示,我只把最基本的区分出来,如果你有自己的需求可以自己设置
- 简单分区方案:
- `/boot` == 500 M(主分区)
- `/swap` == 2 G(逻辑分区)一般大家的说法这个大小是跟你机子的内存大小相关的,也有说法内存大不需要这个,但是还是建议分,虚拟机内存 2 G,所以我分 2 G
- `/` == 剩余容量(逻辑分区)剩余的空间都给了根分区
- 
- 
- 
- 
- 
- 
- 
- 
- 
================================================
FILE: markdown-file/CentOS-Virtual-Machine-Copy-Settings.md
================================================
# VMware 克隆 CentOS 后网卡信息修改
## 概述
- 在我们需要多台 CentOS 虚拟机的时候,对已有虚拟机的系统进行克隆或是复制。但是这样做又有一个问题,克隆出来的虚拟机启动的时候你输入命令:`ifconfig`,eth0 网卡信息没了,只有一个 eth1。 对于处女座的人来讲这是不允许的。所以我们需要改动下。
- 复制虚拟机后,首次打开该会提示如下内容,一般选择 copy 这个配置。
- 
## CentOS 6 修改方法
- 设置 hostname:`hostnamectl --static set-hostname linux02`
- 命令:`sudo vim /etc/udev/rules.d/70-persistent-net.rules`
- 该文件中正常此时应该有两行信息
- 在文件中把 NAME="eth0″ 的这一行注释掉
- 对于另一行,把 NAME=”eth1″ 的这一行,把 NAME=”eth1″ 改为 NAME=”eth0″,并且把该行:ATTRS{address}=="00:0c:29:4c:46:01″ 这个属性信息记下来,每台机子都不一样,我这段信息只是例子,你不要直接复制我的。
- 命令:`sudo vim /etc/sysconfig/network-scripts/ifcfg-eth0`
- 修改 IP 地址
- 把 HWADDR 的值改为上面要求记下来的:00:0c:29:4c:46:01
- 命令:`nmcli con > /opt/info.txt`
- 如果显示两行 UUID 的信息的话,复制不是 System eth0 的那个 UUID 值,下面有用。
- 编辑:`sudo vim /etc/sysconfig/network-scripts/ifcfg-eth0`
- 把文件中的 UUID 值 改为上面要求复制的 UUID 值。
- 保存配置文件,重启系统,正常应该是可以了。
## CentOS 7 修改方法
- 在 VMware 15 Pro 的情况下,直接 copy 进行后,直接修改网卡配置即可
- 编辑该文件:`vim /etc/sysconfig/network-scripts/ifcfg-ens33`
- 把 ip 地址修改即可
================================================
FILE: markdown-file/CentOS.md
================================================
# CentOS 介绍
- CentOS Wiki:<https://zh.wikipedia.org/zh/CentOS>
- CentOS 百科:<http://baike.baidu.com/item/centos>
- CentOS 官网:<https://www.centos.org/>
- CentOS 的自我介绍:<https://wiki.centos.org/zh/About>
- CentOS 官网下载:<https://www.centos.org/download/>
- CentOS 官网下载(含有旧版本):<https://wiki.centos.org/Download>
- CentOS 国内镜像下载:<http://isoredirect.centos.org/centos/6/isos/x86_64/>
- 版本更新记录:<https://wiki.centos.org/Manuals/ReleaseNotes>
# CentOS 原型系统:Red Hat Enterprise Linux
- Red Hat Enterprise Linux Wiki:<https://zh.wikipedia.org/wiki/Red_Hat_Enterprise_Linux>
- Red Hat Enterprise Linux 百科:<http://baike.baidu.com/view/1139590.htm>
- 衍生版本:<https://zh.wikipedia.org/wiki/Red_Hat_Enterprise_Linux衍生版本>
# Red Hat Enterprise Linux 后花园系统:Fedora
- Fedora Wiki:<https://zh.wikipedia.org/wiki/Fedora>
- Fedora 百科:<http://baike.baidu.com/view/182182.htm>
- Fedora 官网:<https://fedoraproject.org>
- Fedora 官网桌面版下载:<https://getfedora.org/zh_CN/workstation/download/>
- Fedora 官网文档:<https://docs.fedoraproject.org/zh-CN/index.html>
================================================
FILE: markdown-file/CentOS6-and-CentOS7.md
================================================
# CentOS 6 和 CentOS 7 介绍
## 总体差异
- 
## 想装回过去的一些工具
- 安装:`yum install -y tree net-tools bind-utils tree sysstat vim-en* lrzsz NetworkManager-tui ntp ntpdate iftop tcpdump telnet traceroute`
## 查看版本号/主机名
- `cat /etc/redhat-release`
- `cat /etc/hostname`
## 常用配置差异
- [CentOS 网络配置](centos-settings/CentOS-Network-Settings.md)
- [CentOS 图形界面的关闭与开启](centos-settings/Close-XWindow.md)
## systemctl 的用法
- 相当于 CentOS 6 的:service nginx stop
- `systemctl is-enabled iptables.service` #查询服务是否开机启动
- `systemctl enable iptables.service` #开机运行服务
- `systemctl disable iptables.service` #取消开机运行
- `systemctl start iptables.service` #启动服务
- `systemctl stop iptables.service` #停止服务
- `systemctl restart iptables.service` #重启服务
- `systemctl reload iptables.service` #重新加载服务配置文件
- `systemctl status iptables.service` #查询服务运行状态
- `systemctl --failed` #显示启动失败的服务
- `systemctl list-units --type=service` #查看所有服务
- `systemctl is-enabled httpd` #查看httpd服务是否开机启动
- 对于启动脚本的存放位置,也不再是 `/etc/init.d/`(这个目录也是存在的),而是 `/usr/lib/systemd/system/`
### 开放端口
- 一般设置软件端口有一个原则:
- 0 ~ 1024 系统保留,一般不要用到
- 1024 ~ 65535(2^16) 可以随意用
- 添加单个端口:`firewall-cmd --zone=public --add-port=8883/tcp --permanent`
- 添加范围端口:`firewall-cmd --zone=public --add-port=8883-8885/tcp --permanent`
- 删除端口:`firewall-cmd --zone=public --remove-port=8883/tcp --permanent`
- 重启防火墙:`firewall-cmd --reload`
- 命令解释:
- `--zone` #作用域
- `--add-port=80/tcp` #添加端口,格式为:端口/通讯协议
- `--permanent` #永久生效,没有此参数重启后失效
- 列出所有端口列表:`firewall-cmd --list-all`
## 关闭 firewall 使用 iptables
- 关闭 firewall
- `systemctl stop firewalld.service` #停止firewall
- `systemctl disable firewalld.service` #禁止firewall开机启动
- 安装 iptables
- `yum install -y iptables-services`
- 启动 iptables
- `systemctl restart iptables.service` #最后重启防火墙使配置生效
- `systemctl enable iptables.service` #设置防火墙开机启动
- 其他使用照旧
## ifconfig 没有了
- 查看网络配置:`ip a`
- 装回 ifconfig:`yum install -y net-tools`
## 设置时区
- `timedatectl set-timezone Asia/Shanghai`
- `timedatectl status`
## 资料
- <http://blog.topspeedsnail.com/archives/3017>
- <http://chenbaocheng.com/2015/07/15/Centos-7-%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AEiptables/>
- <http://cuidehua.blog.51cto.com/5449828/1858374>
- <http://putty.biz/760>
================================================
FILE: markdown-file/Confluence-Install-And-Settings.md
================================================
# Confluence 安装和配置
## Confluence 6.15.4
- 最新 6.15.4 版本时间:2019-05
#### 数据库
```
docker run \
--name mysql-confluence \
--restart always \
-p 3316:3306 \
-e MYSQL_ROOT_PASSWORD=adg123456 \
-e MYSQL_DATABASE=confluence_db \
-e MYSQL_USER=confluence_user \
-e MYSQL_PASSWORD=confluence_123456 \
-d \
mysql:5.7
```
- 连上容器:`docker exec -it mysql-confluence /bin/bash`
- 连上 MySQL:`mysql -u root -p`
- 设置编码:
- **必须做这一步,不然配置过程会报错,confluence 的 DB 要求是 utf8,还不能是 utf8mb4**
- **并且排序规则还必须是:utf8_bin**
- **数据库必须使用'READ-COMMITTED'作为默认隔离级别**
```
SET NAMES 'utf8';
alter database confluence_db character set utf8 collate utf8_bin;
SET GLOBAL tx_isolation='READ-COMMITTED';
```
#### 安装
- 下载:<https://www.atlassian.com/software/confluence/download>
- 选择:linux64 类型下载
- 授权:`chmod +x atlassian-confluence-6.15.4-x64.bin`
```
./atlassian-confluence-6.15.4-x64.bin
开始提示:
Unpacking JRE ...
Starting Installer ...
This will install Confluence 6.9.0 on your computer.
OK [o, Enter], Cancel [c]
>> 输入o或直接回车
Click Next to continue, or Cancel to exit Setup.
Choose the appropriate installation or upgrade option.
Please choose one of the following:
Express Install (uses default settings) [1],
Custom Install (recommended for advanced users) [2, Enter],
Upgrade an existing Confluence installation [3]
1
>> 这里输入数字1
See where Confluence will be installed and the settings that will be used.
Installation Directory: /opt/atlassian/confluence
Home Directory: /var/atlassian/application-data/confluence
HTTP Port: 8090
RMI Port: 8000
Install as service: Yes
Install [i, Enter], Exit [e]
i
>> 输入i或者直接回车
Extracting files ...
Please wait a few moments while we configure Confluence.
Installation of Confluence 6.9.0 is complete
Start Confluence now?
Yes [y, Enter], No [n]
>> 输入y或者直接回车
Please wait a few moments while Confluence starts up.
Launching Confluence ...
Installation of Confluence 6.9.0 is complete
Your installation of Confluence 6.9.0 is now ready and can be accessed via
your browser.
Confluence 6.9.0 can be accessed at http://localhost:8090
Finishing installation ...
# 安装完成,访问本机的8090端口进行web端安装
# 开放防火墙端口
firewall-cmd --add-port=8090/tcp --permanent
firewall-cmd --add-port=8000/tcp --permanent
firewall-cmd --reload
```
- 默认是安装在 /opt 目录下:`/opt/atlassian/confluence/confluence/WEB-INF/lib`
- 启动:`sh /opt/atlassian/confluence/bin/start-confluence.sh`
- 停止:`sh /opt/atlassian/confluence/bin/stop-confluence.sh`
- 查看 log:`tail -300f /opt/atlassian/confluence/logs/catalina.out`
- 卸载:`sh /opt/atlassian/confluence/uninstall`
- 设置 MySQL 连接驱动,把 mysql-connector-java-5.1.47.jar 放在目录 `/opt/atlassian/confluence/confluence/WEB-INF/lib`
#### 首次配置
- 访问:<http://localhost:8090>
- 参考文章:<https://blog.51cto.com/m51cto/2131964>
- 参考文章:<https://www.qinjj.tech/2019/01/04/confluence%20install/>
- 因为步骤一样,所以我就不再截图了。
#### License 过程
- 参考自己的为知笔记
## 反向代理的配置可以参考
- <https://blog.51cto.com/m51cto/2131964>
## 使用 markdown
- 点击右上角小齿轮 > 管理应用 > 搜索市场应用 > 输入 markdown > 安装
## 其他资料
- <https://www.qinjj.tech/2019/02/26/confluence%20maintain/>
- <https://www.qinjj.tech/2019/02/26/confluence_maintain2/>
================================================
FILE: markdown-file/Crontab.md
================================================
# Crontab 介绍
## Crontab 安装
- 查看是否已安装:
- CentOS:`rpm -qa | grep cron`
- Ubuntu:`dpkg -l | grep cron`
- 安装(一般系统是集成的):
- CentOS 6 / 7:`sudo yum install -y vixie-cron crontabs`
- Ubuntu:`sudo apt-get install -y cron`
- 服务常用命令
- CentOS 6
- `service crond start` 启动服务
- `service crond stop` 关闭服务
- `service crond restart` 重启服务
- CentOS 7
- `systemctl start crond` 启动服务
- `systemctl restart crond` 重新启动服务
- `systemctl status crond` 加入自启动
- `systemctl stop crond` 关闭服务
## Crontab 服务器配置文件常用参数
- 配置文件介绍(记得先备份):`sudo vim /etc/crontab`
- 注意:不要在配置文件里面写相对路径
- 该配置格式解释:
- 
- 常用例子介绍:
- `30 21 * * * service httpd restart` #每晚的 21:30 重启 apache
- `30 21 * * 6,0 service httpd restart` #每周六、周日的 21:30 重启 apache
- `45 4 1,10,22 * * service httpd restart` #每月的 1、10、22 日的 4:45 重启 apache
- `45 4 1-10 * * service httpd restart` #每月的 1 到 10 日的 4:45 重启 apache
- `*/2 * * * * service httpd restart` #每隔两分钟重启 apache
- `1-59/2 * * * * service httpd restart` #每隔两分钟重启 apache(这个比较特殊:1-59/2 这个表示过掉0分,从 1 分开始算,每隔两分执行,所以 1 分执行了,3 分执行了,5 分执行了....都是奇数进行执行。默认的 */2 都是偶数执行。)
- `* */2 * * * service httpd restart` #每隔两小时重启 apache
- `0 23-7/2 * * * service httpd restart` #晚上 11 点到早上 7 点之间,每隔 2 个小时重启 apache
- `0-59/30 18-23 * * * service httpd restart` #每天 18:00 到 23:00 之间,每隔 30 分钟重启 apache(方法一)
- `0,30 18-23 * * * service httpd restart` #每天 18:00 到 23:00 之间,每隔 30 分钟重启 apache(方法二)
- `0 4 * * sun root /opt/shell/crontab-redis-restart.sh` #每周日 4:00 执行一个脚本(root 用户运行,有些脚本不指定用户会报:ERROR (getpwnam() failed)
- 更多例子可以看:<http://linuxtools-rst.readthedocs.io/zh_CN/latest/tool/crontab.html>
- 执行记录日志:`tail -f /var/log/cron`(如果发现任务不执行,可以来这里盯着日志看)
## Crontab 权限问题
- 一般默认只有 root 用户可以使用
- 如果要指定某个用户可以使用,可以在 /etc/cron.allow 添加(不存在文件就创建一个)
- 如果要指定某个用户不可以使用,可以在 /etc/cron.deny 添加(不存在文件就创建一个)
- 如果一个用户同时在两个文件都存在,那则以 allow 为准
## Crontab 不执行
- Crontab 不执行原因有很多,可以 Google 搜索:`Crontab 不执行`,这里不多说。
## Crontab 资料
- <http://www.imooc.com/video/4498>
- <http://www.centoscn.com/image-text/config/2015/0901/6096.html>
================================================
FILE: markdown-file/Daemontools.md
================================================
# daemontools 工具
## supervisord
- 注意:Supervisor 能管理非 daemon 的进程,也就是说 Supervisor 不能管理守护进程。否则提示 Exited too quickly (process log may have details) 异常。
- Supervisor 不支持 python 3,安装 python 2 方法:<http://www.cnblogs.com/alex-xia/p/6062741.html>
- 官网:<http://supervisord.org/installing.html>
- 安装过程:
- 解释:easy_install 是 setuptools 包里带的一个命令,使用 easy_install 实际上是在调用 setuptools 来完成安装模块的工作,所以安装 setuptools 即可。
- 安装方案:
```
#第一种(推荐)
yum install python-setuptools
easy_install supervisor
#第二种
yum install python-setuptools
easy_install pip
pip install supervisor
#第三种
yum install -y epel-release
yum install -y supervisor
```
- 如果以上还不能安装,或是安装过程出现各种问题,或是安装完成后使用出现问题,应该就是环境有问题。至少我在京东云上发现会有这个问题。环境是 centos 6.8,python 2.6.6
- 如果你遇到这种问题需要源码安装。
- 源码和各个依赖的源码下载地址(密码:j797):<http://pan.baidu.com/s/1hsGhNkK>
```
tar zxvf setuptools-36.6.0.tar.gz
cd setuptools-36.6.0
python bootstrap.py install
python setup.py install
tar zxvf meld3.tar.gz
cd meld3
python setup.py install
tar zxvf elementtree-1.2.6-20050316.tar.gz
cd elementtree-1.2.6-20050316
python setup.py install
tar zxvf supervisor-3.3.3.tar.gz
cd supervisor-3.3.3
python setup.py install
```
- 生成配置文件:`echo_supervisord_conf > /etc/supervisord.conf`
- 创建专门的程序配置文件目录、日志目录:
- `mkdir -p /var/log/supervisor`
- `mkdir -p /etc/supervisor/conf.d/`
- `echo -e "[include]\nfiles = /etc/supervisor/conf.d/*.conf">>/etc/supervisord.conf`
- 安装完成的内容介绍:supervisor 安装完成后会生成三个执行程序:
- supervisortd:supervisor 的守护进程服务(用于接收进程管理命令)
- supervisorctl:客户端(用于和守护进程通信,发送管理进程的指令)
- echo_supervisord_conf:生成初始配置文件程序。
- 程序位置:`/usr/bin/supervisord`
- 配置文件位置:`/etc/supervisord.conf`
### Logstash 进程进行守护
- 默认安装完 Supervisor 是已经启动的,所以在加入新配置之前,需要先停止程序:`ps -ef | grep supervisord`,kill 对应的 pid
- 创建配置文件:`vim /etc/supervisor/conf.d/logstash.conf`
``` nginx
[program:gitnavi-logstash]
command=/usr/program/elk/logstash-2.4.1/bin/logstash -f /usr/program/elk/logstash-2.4.1/config/logstash.conf
stdout_logfile=/var/log/supervisor/supervisord-logstash.log
stderr_logfile=/var/log/supervisor/supervisord-logstash-err.log
user=root
autostart=true
autorestart=false
startsecs=5
priority=1
stopasgroup=true
killasgroup=true
```
- 该配置的具体说明可以参考:[使用 supervisor 管理进程](http://liyangliang.me/posts/2015/06/using-supervisor/)
- 启动程序(默认会启动所有子任务):`/usr/bin/supervisord -c /etc/supervisord.conf`
- 管理子任务的命令:
- 子任务状态:`/usr/bin/supervisorctl status`
- 启动所有子任务:`/usr/bin/supervisorctl start all`
- 结束所有子任务:`/usr/bin/supervisorctl stop all`
- 启动指定子任务:`/usr/bin/supervisorctl start gitnavi-logstash`
- 结束指定子任务:`/usr/bin/supervisorctl stop gitnavi-logstash`
- 重启指定子任务:`/usr/bin/supervisorctl restart gitnavi-logstash`
- 只载入最新的配置文件, 并不重启任何进程:`/usr/bin/supervisorctl reread`
- 载入最新的配置文件,停止原来的所有进程并按新的配置启动管理所有进程:`/usr/bin/supervisorctl reload`
- 根据最新的配置文件,启动新配置或有改动的进程,配置没有改动的进程不会受影响而重启:`/usr/bin/supervisorctl update`
- 查看所有子任务状态,如果没有运行的子任务则是没有任何反馈信息:`/usr/bin/supervisorctl status`
- 管理所有子任务也可以用交互方式,输入命令:`supervisorctl`,会进入 supervisord 的交互模式下,如果当前有启动的任务,还可以看到对应的任务情况。
- 在该交互下可以停止指定名称的子任务,比如 logstash 任务:`stop gitnavi-logstash`
- 也可以停止所有子任务:`stop all`
- 也可以启动所有子任务:`start all`
- 更多命令可以输入:`help`
### 设置 supervisord 开启自启动
#### CentOS 6
- 创建文件:`vim /etc/init.d/supervisord`
``` nginx
#!/bin/sh
#
# Supervisor is a client/server system that
# allows its users to monitor and control a
# number of processes on UNIX-like operating
# systems.
#
# chkconfig: - 64 36
# description: Supervisor Server
# processname: supervisord
# Source init functions
. /etc/init.d/functions
RETVAL=0
prog="supervisord"
pidfile="/tmp/supervisord.pid"
lockfile="/var/lock/subsys/supervisord"
start()
{
echo -n $"Starting $prog: "
daemon --pidfile $pidfile supervisord -c /etc/supervisord.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch ${lockfile}
}
stop()
{
echo -n $"Shutting down $prog: "
killproc -p ${pidfile} /usr/bin/supervisord
RETVAL=$?
echo
if [ $RETVAL -eq 0 ] ; then
rm -f ${lockfile} ${pidfile}
fi
}
case "$1" in
start)
start ;;
stop) stop ;;
status)
status $prog ;;
restart)
stop
start ;;
*)
echo "Usage: $0 {start|stop|restart|status}" ;;
esac
```
- `chmod 755 /etc/init.d/supervisord`
- `chkconfig supervisord on`
- 以后启动可以用:`service supervisord start`
- 以后停止可以用:`service supervisord stop`
#### CentOS 7
- 创建文件:`vim /lib/systemd/system/supervisor.service`
``` ini
[Unit]
Description=supervisor
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord
gitextract_cj_47536/
├── .editorconfig
├── .gitignore
├── LICENSE
├── README.md
├── SUMMARY.md
├── TOC.md
├── centos-settings/
│ ├── CentOS-Extra-Packages.md
│ ├── CentOS-Network-Settings.md
│ ├── Clear-Cache.md
│ ├── Clear-Tmp-Directory.md
│ ├── Close-XWindow.md
│ └── centos-settings-toc.md
├── config.json
├── favorite-file/
│ ├── Keepalived-Settings/
│ │ └── nginx_check.sh
│ ├── MySQL-Settings/
│ │ └── MySQL-5.6/
│ │ ├── 1G-Memory-Machine/
│ │ │ ├── my-for-comprehensive.cnf
│ │ │ ├── my-for-master.cnf
│ │ │ └── my-for-salve.cnf
│ │ ├── 8G-Memory-Machine/
│ │ │ └── my.cnf
│ │ └── developer/
│ │ └── my-Windows-8G-开发机.ini
│ ├── Nginx-Settings/
│ │ ├── nginx
│ │ └── nginx-front.conf
│ ├── Tomcat-Settings/
│ │ └── server.xml
│ ├── gravitee-docker-compose/
│ │ ├── README.md
│ │ ├── environments/
│ │ │ ├── ci/
│ │ │ │ └── docker-compose.yml
│ │ │ ├── demo/
│ │ │ │ ├── common.yml
│ │ │ │ ├── docker-compose-local.yml
│ │ │ │ ├── docker-compose-traefik-latest.yml
│ │ │ │ ├── docker-compose-traefik-nightly.yml
│ │ │ │ └── launch.sh
│ │ │ └── sample-apis/
│ │ │ └── docker-compose-sample-apis.yml
│ │ └── platform/
│ │ ├── docker-compose.yml
│ │ ├── mongo/
│ │ │ └── docker-entrypoint-initdb.d/
│ │ │ └── create-index.js
│ │ ├── nginx/
│ │ │ ├── nginx.conf
│ │ │ └── ssl/
│ │ │ ├── gio-selfsigned.crt
│ │ │ ├── gio-selfsigned.key
│ │ │ └── gio.pem
│ │ └── prometheus.yml
│ ├── redis/
│ │ └── redis
│ ├── shell/
│ │ ├── crontab-redis-restart.sh
│ │ ├── crontab-test.sh
│ │ ├── install_common_tool_CentOS.sh
│ │ ├── install_common_tool_ubuntu.sh
│ │ ├── install_common_vim.sh
│ │ ├── install_common_vim_zsh.sh
│ │ ├── install_docker_centos7.sh
│ │ ├── install_docker_disable_firewalld_centos7-aliyun.sh
│ │ ├── install_docker_disable_firewalld_centos7.sh
│ │ ├── install_docker_k8s_disable_firewalld_centos7-aliyun.sh
│ │ ├── install_jdk_offline_to_bash.sh
│ │ ├── install_jdk_offline_to_zsh.sh
│ │ ├── install_jdk_online.sh
│ │ ├── install_maven_offline_to_bash.sh
│ │ ├── install_maven_offline_to_zsh.sh
│ │ ├── install_mycat_offline.sh
│ │ ├── install_mysql5.6_offline_centos6.sh
│ │ ├── install_mysql5.6_offline_centos7.sh
│ │ ├── install_mysql5.7_offline_centos7.sh
│ │ ├── install_nginx_centos6.sh
│ │ ├── install_nginx_centos7.sh
│ │ ├── install_redis_centos6.sh
│ │ ├── install_redis_centos7.sh
│ │ ├── install_tomcat_centos6.sh
│ │ ├── install_tomcat_centos7.sh
│ │ ├── install_tomcat_offline_centos7.sh
│ │ ├── mysql_backup.sh
│ │ ├── repo_install_centos6.sh
│ │ ├── shell-for.sh
│ │ └── shell-with-param-demo.sh
│ └── zsh/
│ └── .zshrc
└── markdown-file/
├── Alfresco-Install-And-Usage.md
├── Ansible-Install-And-Settings.md
├── Bash-Other-Bash.md
├── Bash.md
├── CI-Install-And-Usage.md
├── CentOS-7-Install.md
├── CentOS-Install.md
├── CentOS-Virtual-Machine-Copy-Settings.md
├── CentOS.md
├── CentOS6-and-CentOS7.md
├── Confluence-Install-And-Settings.md
├── Crontab.md
├── Daemontools.md
├── Docker-Install-And-Usage.md
├── Dubbo-Install-And-Settings.md
├── ELK-Install-And-Settings.md
├── Elasticsearch-Base.md
├── FTP.md
├── FastDFS-Install-And-Settings.md
├── FastDFS-Nginx-Lua-GraphicsMagick.md
├── File-Extract-Compress.md
├── Flink-Install-And-Settings.md
├── Gitlab-Install-And-Settings.md
├── Glances-Install-And-Settings.md
├── GoAccess-Install-And-Settings.md
├── Grafana-Install-And-Settings.md
├── Hadoop-Install-And-Settings.md
├── Harbor-Install-And-Usage.md
├── Hsk-Install.md
├── Influxdb-Install-And-Settings.md
├── Iptables.md
├── JDK-Install.md
├── JMeter-Install-And-Settings.md
├── Java-bin.md
├── Jenkins-Install-And-Settings.md
├── Jira-Install-And-Settings.md
├── K8S-Install-And-Usage.md
├── Kafka-Install-And-Settings.md
├── Kibana-Base.md
├── Kubernetes-Install-And-Usage.md
├── LDAP-Install-And-Settings.md
├── Linux.md
├── Logstash-Base.md
├── Maven-Install-And-Settings.md
├── MongoDB-Install-And-Settings.md
├── Mycat-Install-And-Settings.md
├── Mysql-Install-And-Settings.md
├── Mysql-Optimize.md
├── Mysql-Test.md
├── Mysql-Tutorial.md
├── NFS.md
├── NTP.md
├── Nexus-Install-And-Settings.md
├── Nginx-Install-And-Settings.md
├── Nginx-Keepalived-Install-And-Settings.md
├── Nmon.md
├── Node-Install-And-Usage.md
├── Off-line-Yum-Install.md
├── Openfire-Install-And-Settings.md
├── PXC-Install-And-Settings.md
├── Portainer-Install-And-Settings.md
├── PostgreSQL-Install-And-Settings.md
├── Prometheus-Install-And-Settings.md
├── Python-Ubuntu.md
├── RabbitMQ-Install-And-Settings.md
├── Rap-Install-And-Settings.md
├── Redis-Install-And-Settings.md
├── SSH-login-without-password.md
├── SSH.md
├── SSR-Client-Ubuntu.md
├── SVN-Install-And-Settings.md
├── Samba.md
├── Sed.md
├── Shell.md
├── Showdoc-Install-And-Settings.md
├── SkyWalking-Install-And-Settings.md
├── Solr-Install-And-Settings.md
├── SonarQube-Install-And-Usage.md
├── Spark-Install-And-Settings.md
├── TeamCity-Install-And-Settings.md
├── Thrift-Install-And-Usage.md
├── Tmux-Install-And-Settings.md
├── Tomcat-Install-And-Settings.md
├── Ubuntu-Install-VMware.md
├── Ubuntu-Install.md
├── Ubuntu-Popular-Software.md
├── Ubuntu-Specific-Command.md
├── Ubuntu.md
├── VPN.md
├── Vim-Install-And-Settings.md
├── Was-Hacked.md
├── WordPress-Install-And-Settings.md
├── Wormhole-Install-And-Settings.md
├── YApi-Install-And-Settings.md
├── Zabbix-Install-And-Settings.md
├── Zookeeper-Install.md
├── Zsh.md
├── kali-linux-settings/
│ ├── kali-linux-basic-settings.md
│ ├── kali-linux-install.md
│ ├── kali-linux-penetration-test.md
│ ├── kali-linux-social-engineering.md
│ ├── kali-linux-sql-injection.md
│ └── kali-linux-toc.md
├── maintenance.md
├── monitor.md
├── other.md
├── shell-safe-rm.md
├── speedtest.md
├── ubuntu-settings/
│ ├── Network-Settings.md
│ ├── Ubuntu-Create-Desktop.md
│ ├── Ubuntu-Extra-Packages.md
│ ├── Ubuntu-Popular-Settings.md
│ ├── Ubuntu-UI.md
│ └── ubuntu-settings-toc.md
└── wrk-Install-And-Settings.md
Condensed preview — 184 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (982K chars).
[
{
"path": ".editorconfig",
"chars": 399,
"preview": "# http://editorconfig.org\n# 官网首页有介绍:IntelliJ IDEA,VS Code 默认就支持,无需额外安装插件\nroot = true\n\n# 空格替代Tab缩进在各种编辑工具下效果一致\n[*]\nindent"
},
{
"path": ".gitignore",
"chars": 323,
"preview": "build/\nout/\nlog/\nlogs/\npublic/\ntarget/\nnode_modules/\nclasses/\n.deploy*/\n.gradle\n*.log.*\n*.log\n.DS_Store\nThumbs.db\n\n### S"
},
{
"path": "LICENSE",
"chars": 18046,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 2, June 1991\n\n Copyright (C) 1989, 1991 Fr"
},
{
"path": "README.md",
"chars": 1819,
"preview": "\n## 作者新方向,感谢支持\n\n- [从开公司到开发全平台产品(文字版)](https://github.com/cdk8s/cdk8s-team-style/blob/master/full-stack/README.md)\n- [从开公"
},
{
"path": "SUMMARY.md",
"chars": 5426,
"preview": "# Java 程序员眼中的 Linux\n\n* [Linux 介绍](markdown-file/Linux.md)\n* [Ubuntu 介绍](markdown-file/Ubuntu.md)\n* [Ubuntu 安装](markdown-"
},
{
"path": "TOC.md",
"chars": 5349,
"preview": "- [Linux 介绍](markdown-file/Linux.md)\n- [Ubuntu 介绍](markdown-file/Ubuntu.md)\n- [Ubuntu 安装](markdown-file/Ubuntu-Install.m"
},
{
"path": "centos-settings/CentOS-Extra-Packages.md",
"chars": 3834,
"preview": "# CentOS 源设置\n\n## 修改官方源\n\n- 下面内容的一个简易集合版本脚本:<http://pan.baidu.com/s/1hrdnbi0>\n\n## 修改官方源\n\n> 国内常用源配置方法(该源和官方源是一样的,只是因为服务器在国内"
},
{
"path": "centos-settings/CentOS-Network-Settings.md",
"chars": 2318,
"preview": "# CentOS 网络设置\n\n\n- 由于前面虚拟机中安装 CentOS 使用的是桥接模式,为了让虚拟机中的系统能上网,我们需要进行网络设置。\n\n## CentOS 6\n\n### 界面化下设置网络(新手推荐使用这种)\n\n- \n- [CentOS 源设置](CentOS-Extra-Packages.md)\n- [CentOS 图形界面的关闭与开启](Close-XWindow"
},
{
"path": "config.json",
"chars": 107,
"preview": "{\n \"name\": \"Java 程序员眼中的 Linux\",\n \"introduction\": \"笔者从 Java 开发角度,全方位讲解各种环境搭建及常用工具详解,是一部适合程序员的百科全书。\"\n\n}"
},
{
"path": "favorite-file/Keepalived-Settings/nginx_check.sh",
"chars": 230,
"preview": "#!/bin/bash\n# 如果进程中没有nginx则将keepalived进程kill掉\nA=`ps -C nginx --no-header |wc -l` ## 查看是否有 nginx进程 把值赋给变量A \nif [ $A "
},
{
"path": "favorite-file/MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-comprehensive.cnf",
"chars": 6210,
"preview": "\n# 适用于 Mysql 5.6\n# 该配置适合 1G 内存左右的机子,储存类型为 InnoDB\n# 官网配置说明:http://dev.mysql.com/doc/refman/5.6/en/mysqld-option-tables.ht"
},
{
"path": "favorite-file/MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-master.cnf",
"chars": 5936,
"preview": "\n# 适用于 Mysql 5.6\n# 该配置适合 1G 内存左右的机子,储存类型为 InnoDB\n# 官网配置说明:http://dev.mysql.com/doc/refman/5.6/en/mysqld-option-tables.ht"
},
{
"path": "favorite-file/MySQL-Settings/MySQL-5.6/1G-Memory-Machine/my-for-salve.cnf",
"chars": 6205,
"preview": "\n# 适用于 Mysql 5.6\n# 该配置适合 1G 内存左右的机子,储存类型为 InnoDB\n# 官网配置说明:http://dev.mysql.com/doc/refman/5.6/en/mysqld-option-tables.ht"
},
{
"path": "favorite-file/MySQL-Settings/MySQL-5.6/8G-Memory-Machine/my.cnf",
"chars": 2183,
"preview": "[mysql]\nport = 3306\nsocket = /usr/program/mysql/data/mysql.sock\ndefault-character-set = utf8\n\n[mysqld]\nuser = mysql\nport"
},
{
"path": "favorite-file/MySQL-Settings/MySQL-5.6/developer/my-Windows-8G-开发机.ini",
"chars": 1846,
"preview": "[client]\nno-beep\nport=3306\n\n\n[mysql]\ndefault-character-set=utf8\n\n[mysqld]\nport=3306\nbasedir=\"C:/Program Files/MySQL/MySQ"
},
{
"path": "favorite-file/Nginx-Settings/nginx",
"chars": 1415,
"preview": "#!/bin/bash\n\n\n#nginx执行程序路径需要修改\nnginxd=/usr/local/nginx/sbin/nginx\n\n# nginx配置文件路径需要修改\nnginx_config=/usr/local/nginx/conf/"
},
{
"path": "favorite-file/Nginx-Settings/nginx-front.conf",
"chars": 3406,
"preview": "user root;\nworker_processes auto;\npid /run/nginx.pid;\n\nevents {\n use epoll;\n multi_accept on;\n worker_connecti"
},
{
"path": "favorite-file/Tomcat-Settings/server.xml",
"chars": 2451,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Server port=\"8005\" shutdown=\"SHUTDOWN\">\n <Listener className=\"org.apache.catali"
},
{
"path": "favorite-file/gravitee-docker-compose/README.md",
"chars": 584,
"preview": "# graviteeio api gateway docker-compose running\n\nfork from graviteeio project && change some deps image\n\n- <https://gith"
},
{
"path": "favorite-file/gravitee-docker-compose/environments/ci/docker-compose.yml",
"chars": 2018,
"preview": "#-------------------------------------------------------------------------------\n# Copyright (C) 2015 The Gravitee team "
},
{
"path": "favorite-file/gravitee-docker-compose/environments/demo/common.yml",
"chars": 2384,
"preview": "#-------------------------------------------------------------------------------\n# Copyright (C) 2015 The Gravitee team "
},
{
"path": "favorite-file/gravitee-docker-compose/environments/demo/docker-compose-local.yml",
"chars": 2702,
"preview": "#-------------------------------------------------------------------------------\n# Copyright (C) 2015 The Gravitee team "
},
{
"path": "favorite-file/gravitee-docker-compose/environments/demo/docker-compose-traefik-latest.yml",
"chars": 2800,
"preview": "#-------------------------------------------------------------------------------\n# Copyright (C) 2015 The Gravitee team "
},
{
"path": "favorite-file/gravitee-docker-compose/environments/demo/docker-compose-traefik-nightly.yml",
"chars": 2976,
"preview": "#-------------------------------------------------------------------------------\n# Copyright (C) 2015 The Gravitee team "
},
{
"path": "favorite-file/gravitee-docker-compose/environments/demo/launch.sh",
"chars": 3527,
"preview": "#!/bin/bash\n#-------------------------------------------------------------------------------\n# Copyright (C) 2015 The Gr"
},
{
"path": "favorite-file/gravitee-docker-compose/environments/sample-apis/docker-compose-sample-apis.yml",
"chars": 1886,
"preview": "#-------------------------------------------------------------------------------\n# Copyright (C) 2015 The Gravitee team "
},
{
"path": "favorite-file/gravitee-docker-compose/platform/docker-compose.yml",
"chars": 4647,
"preview": "version: '3'\n\nnetworks:\n default:\n\nservices:\n nginx:\n image: nginx:1.15-alpine\n container_name: gio_platform_ngi"
},
{
"path": "favorite-file/gravitee-docker-compose/platform/mongo/docker-entrypoint-initdb.d/create-index.js",
"chars": 3210,
"preview": "\n// \"apis\" collection\ndb.apis.dropIndexes();\ndb.apis.createIndex( { \"visibility\" : 1 } );\ndb.apis.createIndex( { \"group\""
},
{
"path": "favorite-file/gravitee-docker-compose/platform/nginx/nginx.conf",
"chars": 4197,
"preview": "worker_processes 4;\n\nevents { worker_connections 1024; }\n\nhttp {\n include /etc/nginx/mime.types;\n resolver 127.0.0.11 "
},
{
"path": "favorite-file/gravitee-docker-compose/platform/nginx/ssl/gio-selfsigned.crt",
"chars": 1675,
"preview": "-----BEGIN CERTIFICATE-----\nMIIEpzCCA4+gAwIBAgIJALezRH6+njWDMA0GCSqGSIb3DQEBBQUAMIGTMQswCQYD\nVQQGEwJGUjEPMA0GA1UECBMGRlJ"
},
{
"path": "favorite-file/gravitee-docker-compose/platform/nginx/ssl/gio-selfsigned.key",
"chars": 1679,
"preview": "-----BEGIN RSA PRIVATE KEY-----\nMIIEpAIBAAKCAQEArkYYhRslcVvu7gm804evXL/jAcRYisaBVekGAcE58JVdmosL\nf1mYQISJrxNc9GqfSG8xEyo"
},
{
"path": "favorite-file/gravitee-docker-compose/platform/nginx/ssl/gio.pem",
"chars": 424,
"preview": "-----BEGIN DH PARAMETERS-----\nMIIBCAKCAQEArcQ6JmuXsIlIwSjJ21MeP81D/pum44+3dSMyw9+eGU9yJgwAOBBw\nJ3H57gM2x+8Q/VJowwgmXFOnk"
},
{
"path": "favorite-file/gravitee-docker-compose/platform/prometheus.yml",
"chars": 207,
"preview": "scrape_configs:\n - job_name: 'gio-gw'\n basic_auth:\n username: admin\n password: adminadmin\n metrics_path"
},
{
"path": "favorite-file/redis/redis",
"chars": 1972,
"preview": "#!/bin/sh \n# \n# redis - this script starts and stops the redis-server daemon \n# \n# chkconfig: - 85 15 \n# descript"
},
{
"path": "favorite-file/shell/crontab-redis-restart.sh",
"chars": 121,
"preview": "#!/bin/sh\n\nredis-cli -h 127.0.0.1 -p 6379 -a 123456789 shutdown\n\nsleep 5s\n\n/usr/local/bin/redis-server /etc/redis.conf\n\n"
},
{
"path": "favorite-file/shell/crontab-test.sh",
"chars": 154,
"preview": "#!/bin/sh\n\ntime1=$(date \"+%Y-%m-%d %H:%M:%S\")\n\necho \"${time1}\" >> /opt/1.txt\n\nsleep 5s\n\ntime2=$(date \"+%Y-%m-%d %H:%M:%S"
},
{
"path": "favorite-file/shell/install_common_tool_CentOS.sh",
"chars": 111,
"preview": "#!/bin/sh\n\necho \"开始常用工具安装\"\n\nyum install -y zip unzip lrzsz git epel-release wget htop deltarpm\n\necho \"开始常用工具结束\""
},
{
"path": "favorite-file/shell/install_common_tool_ubuntu.sh",
"chars": 104,
"preview": "#!/bin/sh\n\necho \"开始常用工具安装\"\n\nsudo apt-get install -y zip unzip unrar lrzsz git wget htop\n\necho \"开始常用工具结束\""
},
{
"path": "favorite-file/shell/install_common_vim.sh",
"chars": 339,
"preview": "#!/bin/sh\n\n\necho \"-----------------------------------------开始常用工具安装\"\nyum install -y zip unzip lrzsz git epel-release\n\nec"
},
{
"path": "favorite-file/shell/install_common_vim_zsh.sh",
"chars": 846,
"preview": "#!/bin/sh\n\necho \"-----------------------------------------禁用防火墙\"\nsystemctl stop firewalld.service\nsystemctl disable fire"
},
{
"path": "favorite-file/shell/install_docker_centos7.sh",
"chars": 731,
"preview": "#!/bin/sh\n\necho \"安装 docker 所需环境\"\n\nyum install -y yum-utils device-mapper-persistent-data lvm2\n\necho \"添加 repo(可能网络会很慢,有时候"
},
{
"path": "favorite-file/shell/install_docker_disable_firewalld_centos7-aliyun.sh",
"chars": 1739,
"preview": "#!/bin/sh\n\necho \"-----------------------------------------禁用防火墙\"\nsystemctl stop firewalld.service\nsystemctl disable fire"
},
{
"path": "favorite-file/shell/install_docker_disable_firewalld_centos7.sh",
"chars": 1274,
"preview": "#!/bin/sh\n\necho \"-----------------------------------------禁用防火墙\"\nsystemctl stop firewalld.service\nsystemctl disable fire"
},
{
"path": "favorite-file/shell/install_docker_k8s_disable_firewalld_centos7-aliyun.sh",
"chars": 1358,
"preview": "#!/bin/sh\n\necho \"-----------------------------------------禁用防火墙\"\nsystemctl stop firewalld.service\nsystemctl disable fire"
},
{
"path": "favorite-file/shell/install_jdk_offline_to_bash.sh",
"chars": 734,
"preview": "#!/bin/sh\n\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\necho \"判断 JDK 压缩包是否存在\"\n\nif [ ! -f "
},
{
"path": "favorite-file/shell/install_jdk_offline_to_zsh.sh",
"chars": 724,
"preview": "#!/bin/sh\n\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\necho \"判断 JDK 压缩包是否存在\"\n\nif [ ! -f "
},
{
"path": "favorite-file/shell/install_jdk_online.sh",
"chars": 968,
"preview": "#!/bin/sh\n\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\nif [ ! -d \"/usr/program\" ]; then\n"
},
{
"path": "favorite-file/shell/install_maven_offline_to_bash.sh",
"chars": 757,
"preview": "#!/bin/sh\n\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\necho \"判断 Maven 压缩包是否存在\"\n\nif [ ! -"
},
{
"path": "favorite-file/shell/install_maven_offline_to_zsh.sh",
"chars": 747,
"preview": "#!/bin/sh\n\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\necho \"判断 Maven 压缩包是否存在\"\n\nif [ ! -"
},
{
"path": "favorite-file/shell/install_mycat_offline.sh",
"chars": 723,
"preview": "#!/bin/sh\n\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\necho \"判断是否有 JDK 环境\"\n\nif [ -z $JAV"
},
{
"path": "favorite-file/shell/install_mysql5.6_offline_centos6.sh",
"chars": 1382,
"preview": "#!/bin/sh\n\necho \"安装 mysql 开始\"\n\ncd /opt/setups\n\ntar zxvf mysql-5.6.35.tar.gz\n\nmv /opt/setups/mysql-5.6.35 /usr/program/\n\n"
},
{
"path": "favorite-file/shell/install_mysql5.6_offline_centos7.sh",
"chars": 1611,
"preview": "#!/bin/sh\n\necho \"安装 mysql 开始\"\n\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\necho \"判断 JDK "
},
{
"path": "favorite-file/shell/install_mysql5.7_offline_centos7.sh",
"chars": 2016,
"preview": "#!/bin/sh\n\necho \"安装 mysql 开始\"\necho \"必须准备两个文件:mysql-5.7.21.tar.gz 和 boost_1_59_0.tar.gz\"\necho \"mysql 5.7 依赖 boost,官网说明:ht"
},
{
"path": "favorite-file/shell/install_nginx_centos6.sh",
"chars": 1542,
"preview": "#!/bin/sh\n\n\necho \"安装 nginx\"\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\nif [ ! -d \"/usr/"
},
{
"path": "favorite-file/shell/install_nginx_centos7.sh",
"chars": 1536,
"preview": "#!/bin/sh\n\n\necho \"安装 nginx\"\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\nif [ ! -d \"/usr/"
},
{
"path": "favorite-file/shell/install_redis_centos6.sh",
"chars": 926,
"preview": "#!/bin/sh\n\necho \"安装 redis\"\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\nif [ ! -d \"/usr/p"
},
{
"path": "favorite-file/shell/install_redis_centos7.sh",
"chars": 859,
"preview": "#!/bin/sh\n\necho \"安装 redis\"\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\necho \"下载 redis\"\n\n"
},
{
"path": "favorite-file/shell/install_tomcat_centos6.sh",
"chars": 896,
"preview": "#!/bin/sh\n\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\nif [ ! -d \"/usr/program\" ]; then\n"
},
{
"path": "favorite-file/shell/install_tomcat_centos7.sh",
"chars": 798,
"preview": "#!/bin/sh\n\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\necho \"下载 Tomcat\"\n\ncd /opt/setups\n"
},
{
"path": "favorite-file/shell/install_tomcat_offline_centos7.sh",
"chars": 706,
"preview": "#!/bin/sh\n\necho \"判断常见的文件夹是否存在\"\n\nif [ ! -d \"/opt/setups\" ]; then\n\tmkdir /opt/setups\nfi\n\n\necho \"判断 tomcat 压缩包是否存在\"\n\nif [ !"
},
{
"path": "favorite-file/shell/mysql_backup.sh",
"chars": 243,
"preview": "#!/bin/bash\n\n\nbackupDatetime=$1\n\nif [ \"$backupDatetime\" = \"\" ];\nthen\n echo -e \"\\033[0;31m 请输入备份日期 \\033[0m\"\n exit 1"
},
{
"path": "favorite-file/shell/repo_install_centos6.sh",
"chars": 998,
"preview": "#!/bin/sh\n# 本文原内容来自:https://github.com/judasn/Linux-Tutorial/blob/master/CentOS-Extra-Packages.md\n\necho \"源设置开始\"\n\necho \"备"
},
{
"path": "favorite-file/shell/shell-for.sh",
"chars": 223,
"preview": "#!/bin/bash\n\n# 循环总次数\ntotalDegree=$1\n\n# 如果没有传参,则默认值是 10\nif [ \"$totalDegree\" = \"\" ];\nthen\n totalDegree=10\nfi\n\nfor((time"
},
{
"path": "favorite-file/shell/shell-with-param-demo.sh",
"chars": 1793,
"preview": "#!/bin/bash\n\n\nmethodParam=$1\nSpringBoot=$2\nSpringBootPath=$3\n\nif [ \"$methodParam\" = \"\" ];\nthen\n echo -e \"\\033[0;31m 未"
},
{
"path": "favorite-file/zsh/.zshrc",
"chars": 3077,
"preview": "# If you come from bash you might have to change your $PATH.\n# export PATH=$HOME/bin:/usr/local/bin:$PATH\n\n# Path to you"
},
{
"path": "markdown-file/Alfresco-Install-And-Usage.md",
"chars": 1377,
"preview": "# Alfresco 使用\n\n## Alfresco 介绍\n\n- 官网:<https://www.alfresco.com>\n- 开源社区版下载:<https://www.alfresco.com/alfresco-community-do"
},
{
"path": "markdown-file/Ansible-Install-And-Settings.md",
"chars": 8674,
"preview": "# Ansible 安装和配置\n\n\n## Ansible 说明\n\n- Ansible 官网:<https://www.ansible.com/>\n- Ansible 官网 Github:<https://github.com/ansible"
},
{
"path": "markdown-file/Bash-Other-Bash.md",
"chars": 873,
"preview": "# Bash 其他常用命令\n\n## 其他常用命令\n\n- 编辑 hosts 文件:`vim /etc/hosts`,添加内容格式:`127.0.0.1 www.youmeek.com`\n- RPM 文件操作命令:\n\t- 安装\n\t\t- `rpm"
},
{
"path": "markdown-file/Bash.md",
"chars": 9221,
"preview": "# Bash 常用命令\n\n\n## 基础常用命令\n\n- `某个命令 --h`,对这个命令进行解释\n- `某个命令 --help`,解释这个命令(更详细)\n- `man某个命令`,文档式解释这个命令(更更详细)(执行该命令后,还可以按/+关键字"
},
{
"path": "markdown-file/CI-Install-And-Usage.md",
"chars": 8752,
"preview": " \n \n# CI 一整套服务\n \n## 环境说明\n\n- CentOS 7.3\n- 两台机子(一台机子也是可以,内存至少要 8G)\n\t- 一台:Gitlab + Redis + Postgresql\n\t\t- 硬件推荐:内存 4G\n\t\t- 端口"
},
{
"path": "markdown-file/CentOS-7-Install.md",
"chars": 1856,
"preview": "# CentOS 7 安装 \n\n\n## 概括\n\n- 本教程中主要演示了 VMware Workstation 下安装 `CentOS 7.3` 的过程。\n- VMware 的使用细节可以看这篇:[CentOS 6 安装](CentOS-In"
},
{
"path": "markdown-file/CentOS-Install.md",
"chars": 5913,
"preview": "# CentOS 安装 \n\n\n## 概括\n\n- 本教程中主要演示了 VirtualBox 和 VMware Workstation 下安装 `CentOS 6.6` 的过程。\n- VirtualBox 是免费开源,我个人在使用经历中遇到过很"
},
{
"path": "markdown-file/CentOS-Virtual-Machine-Copy-Settings.md",
"chars": 1088,
"preview": "# VMware 克隆 CentOS 后网卡信息修改\n\n## 概述\n\n- 在我们需要多台 CentOS 虚拟机的时候,对已有虚拟机的系统进行克隆或是复制。但是这样做又有一个问题,克隆出来的虚拟机启动的时候你输入命令:`ifconfig`,e"
},
{
"path": "markdown-file/CentOS.md",
"chars": 1027,
"preview": "# CentOS 介绍\n\n- CentOS Wiki:<https://zh.wikipedia.org/zh/CentOS>\n- CentOS 百科:<http://baike.baidu.com/item/centos>\n- CentO"
},
{
"path": "markdown-file/CentOS6-and-CentOS7.md",
"chars": 2241,
"preview": "# CentOS 6 和 CentOS 7 介绍\n\n## 总体差异\n\n- \n\n## 想装回过去的一些工具\n\n- 安装:`yum install -y"
},
{
"path": "markdown-file/Confluence-Install-And-Settings.md",
"chars": 3128,
"preview": "# Confluence 安装和配置\n\n## Confluence 6.15.4\n\n- 最新 6.15.4 版本时间:2019-05\n\n#### 数据库\n\n```\ndocker run \\\n\t--name mysql-confluence "
},
{
"path": "markdown-file/Crontab.md",
"chars": 2150,
"preview": "# Crontab 介绍\n\n\n## Crontab 安装\n\n- 查看是否已安装:\n - CentOS:`rpm -qa | grep cron`\n - Ubuntu:`dpkg -l | grep cron`\n\n- 安装(一般系统是集成的)"
},
{
"path": "markdown-file/Daemontools.md",
"chars": 5088,
"preview": "# daemontools 工具\n\n## supervisord\n\n- 注意:Supervisor 能管理非 daemon 的进程,也就是说 Supervisor 不能管理守护进程。否则提示 Exited too quickly (proc"
},
{
"path": "markdown-file/Docker-Install-And-Usage.md",
"chars": 34185,
"preview": " \n \n# Docker 使用\n \n## 环境说明\n \n- CentOS 7.3(不准确地说:要求必须是 CentOS 7 64位)\n- 不建议在 Windows 上使用\n \n## Docker 基本概念\n \n- 官网:<https://w"
},
{
"path": "markdown-file/Dubbo-Install-And-Settings.md",
"chars": 5824,
"preview": "# Dubbo 环境安装和配置\n\n\n## Dubbo-Admin 搭建\n\n### 需要环境\n\n- CentOS 6\n- JDK 1.8(必须是 1.8)\n- Tomcat 7 或 8(我测试都可以)\n- Dubbo 版本:2.5.4-SNA"
},
{
"path": "markdown-file/ELK-Install-And-Settings.md",
"chars": 1170,
"preview": "# ELK(Elasticsearch、Logstash、Kibana)安装和配置\n\n## 版本说明\n\n- 本文包含了:Elasticsearch 2.4.X 和 Elasticsearch 5.2.X 和 Elasticsearch 5."
},
{
"path": "markdown-file/Elasticsearch-Base.md",
"chars": 22257,
"preview": "# Elasticsearch 知识\n\n## Docker 单节点部署\n\n- 官网:<https://hub.docker.com/_/elasticsearch>\n- 官网列表:<https://www.docker.elastic.co"
},
{
"path": "markdown-file/FTP.md",
"chars": 3778,
"preview": "# FTP(File Transfer Protocol)介绍\n\n\n## FTP 安装\n\n- 查看是否已安装:\n - CentOS:`rpm -qa | grep vsftpd`\n - Ubuntu:`dpkg -l | grep vsft"
},
{
"path": "markdown-file/FastDFS-Install-And-Settings.md",
"chars": 10897,
"preview": "# FastDFS 安装和配置\n\n\n## FastDFS 介绍\n\n- FastDFS 介绍:<http://www.oschina.net/p/fastdfs>\n- 官网下载 1:<https://github.com/happyfish1"
},
{
"path": "markdown-file/FastDFS-Nginx-Lua-GraphicsMagick.md",
"chars": 12407,
"preview": "# FastDFS 结合 GraphicsMagick\n\n\n## 单机安装部署(CentOS 6.7 环境)\n\n\n\n### 先安装 FastDFS\n\n- 软件准备:\n\t- 我这边统一提供了一个压缩包,方便使用。\n\t\t- 下载地址:<http"
},
{
"path": "markdown-file/File-Extract-Compress.md",
"chars": 2402,
"preview": "# Linux 下常用压缩文件的解压、压缩\n\n\n## 常用压缩包--解压--令整理\n\n- Linux 后缀为 `.war` 格式的文件(一般用在部署 Tomcat 项目的时候)\n- 命令:`unzip -oq XXXXXX.war -d R"
},
{
"path": "markdown-file/Flink-Install-And-Settings.md",
"chars": 12271,
"preview": "# Flink 安装和配置\n\n## 介绍\n\n- 2018-11-30 发布最新:1.7.0 版本\n- 官网:<https://flink.apache.org/>\n- 官网 Github:<https://github.com/apache"
},
{
"path": "markdown-file/Gitlab-Install-And-Settings.md",
"chars": 9331,
"preview": "# Gitlab 安装和配置\n\n## Docker Compose 安装方式\n\n\n- 创建宿主机挂载目录:`mkdir -p /data/docker/gitlab/gitlab /data/docker/gitlab/redis /dat"
},
{
"path": "markdown-file/Glances-Install-And-Settings.md",
"chars": 1406,
"preview": "# Glances 安装和配置\n\n## Glances 介绍\n\n- 相对 top、htop,它比较重,因此内容也比较多。小机子一般不建议安装。大机子一般也不建议一直开着。\n- 官网:<https://nicolargo.github.io/"
},
{
"path": "markdown-file/GoAccess-Install-And-Settings.md",
"chars": 4452,
"preview": "# GoAccess 安装和配置\n\n## 官网资料\n\n- 一般用于 Apache, Nginx 的 Log 分析\n- 官网:<https://goaccess.io/>\n- 官网下载(201807 最新版本 1.2):<https://g"
},
{
"path": "markdown-file/Grafana-Install-And-Settings.md",
"chars": 2967,
"preview": "# Grafana 安装和配置\n\n\n## 对于版本\n\n- [支持的 Elasticsearch 版本](http://docs.grafana.org/features/datasources/elasticsearch/#elastics"
},
{
"path": "markdown-file/Hadoop-Install-And-Settings.md",
"chars": 28159,
"preview": "# Hadoop 安装和配置\n\n\n## Hadoop 说明\n\n- Hadoop 官网:<https://hadoop.apache.org/>\n- Hadoop 官网下载:<https://hadoop.apache.org/release"
},
{
"path": "markdown-file/Harbor-Install-And-Usage.md",
"chars": 19361,
"preview": "# Harbor 安装和配置\n\n## 环境说明\n\n- CentOS 7.4\n- IP:`192.168.0.105`\n- 需要访问的机子 hosts 需要映射(如果绑定真实域名就不需要这一步了):`192.168.0.105 harbor."
},
{
"path": "markdown-file/Hsk-Install.md",
"chars": 1541,
"preview": "# 花生壳 安装\n\n\n## CentOS 下过程\n\n- 官网:<http://hsk.oray.com/> \n- 官网下载:<http://hsk.oray.com/download/#type=linux>\n- 官网安装说明:<http:"
},
{
"path": "markdown-file/Influxdb-Install-And-Settings.md",
"chars": 1154,
"preview": "# Influxdb 安装和配置\n\n\n\n## Influxdb Docker 安装\n\n- 官网库:<https://docs.docker.com/samples/library/influxdb>\n\n\n```\ndocker run -d "
},
{
"path": "markdown-file/Iptables.md",
"chars": 2515,
"preview": "# Iptables 介绍\n\n\n## 前提说明\n\niptables 的设置在 CentOS 和 Ubuntu 下有些细节不一样,Ubuntu 这里不讲,文章底下贴的资料有部分关于 Ubuntu 的,有需要的可以自己看。一般大家会用到 ipt"
},
{
"path": "markdown-file/JDK-Install.md",
"chars": 3444,
"preview": "# JDK 安装\n\n\n## CentOS 下过程\n\n- JDK 在 CentOS 和 Ubuntu 下安装过程是一样的,所以这里不再讲 Ubuntu 系统下的安装\n- JDK 1.8 下载\n - 此时(20160205)最新版本:`jdk-"
},
{
"path": "markdown-file/JMeter-Install-And-Settings.md",
"chars": 6829,
"preview": "# JMeter 安装和配置\n\n\n## JMeter 介绍\n\n- JMeter 用 Java 开发,需要 JDK 环境,当前最新版至少需要 JDK 8\n- 官网:<https://jmeter.apache.org/>\n- 官网下载:<ht"
},
{
"path": "markdown-file/Java-bin.md",
"chars": 18674,
"preview": "# Java bin 目录下的工具\n\n## JVM 内存结构\n\n- 参考资料:[JVM内存结构(基于JDK8)](https://blog.csdn.net/qq_34457118/article/details/81712293)\n\n##"
},
{
"path": "markdown-file/Jenkins-Install-And-Settings.md",
"chars": 26606,
"preview": "# Jenkins 安装和配置\n\n## Jenkins 介绍\n\n- 官网:<http://jenkins-ci.org/>\n- 官网插件库:<https://plugins.jenkins.io/>\n- 官网下载:<https://jenk"
},
{
"path": "markdown-file/Jira-Install-And-Settings.md",
"chars": 1646,
"preview": "# Jira 安装和配置\n\n## Jira 7.13.3\n\n- 最新 7.13.3 版本时间:2019-04\n\n#### 数据库\n\n```\ndocker run \\\n\t--name mysql-jira \\\n\t--restart alway"
},
{
"path": "markdown-file/K8S-Install-And-Usage.md",
"chars": 14490,
"preview": " \n \n# Kubernets(K8S) 使用\n \n## 环境说明\n \n- CentOS 7.5(不准确地说:要求必须是 CentOS 7 64位)\n- Docker\n\n## Kubernetes\n\n- 目前流行的容器编排系统\n- 简称:K"
},
{
"path": "markdown-file/Kafka-Install-And-Settings.md",
"chars": 25958,
"preview": "# Kafka 安装和配置\n\n\n## 对于版本\n\n- 由于 Kafka 经常会被连接到各个地方去,所以对于 Kafka 的版本,一般不能用太新的,要看你用在什么地方。\n- [Flink 的要求](https://ci.apache.org/"
},
{
"path": "markdown-file/Kibana-Base.md",
"chars": 1961,
"preview": "# kibana 知识\n\n## 基础知识\n\n- 官网文档:<https://www.elastic.co/guide/en/kibana/current/getting-started.html>\n\n### 安装 Kibana\n\n- Cen"
},
{
"path": "markdown-file/Kubernetes-Install-And-Usage.md",
"chars": 9834,
"preview": " \n \n# Kubernetes 部署\n \n## 环境说明\n\n- CentOS 7.4\n- 购买自阿里云普通的 ECS 华南地区(如果你是购买美国地区的服务器,则直接使用 kubespray 原项目,那些镜像地址不用修改,其他照着文档即可)"
},
{
"path": "markdown-file/LDAP-Install-And-Settings.md",
"chars": 3849,
"preview": "# LDAP 安装和配置\n\n\n## LDAP 基本概念\n\n- <https://segmentfault.com/a/1190000002607140>\n- <http://www.itdadao.com/articles/c15a134"
},
{
"path": "markdown-file/Linux.md",
"chars": 3209,
"preview": "# Linux 介绍\n\n\n\n## Linux 这个名字\n\nLinux 的 Wiki 介绍:<http://zh.wikipedia.org/zh/Linux>\n\nLinux 也称:`GNU/Linux`,而其中 GNU 的全称又是:`Gnu"
},
{
"path": "markdown-file/Logstash-Base.md",
"chars": 12333,
"preview": "# Logstash 知识\n\n## 基础知识\n\n- 基于 ruby 写的\n- 官网文档:<https://www.elastic.co/guide/en/logstash/5.2/first-event.html>\n- 如果是通过网络来收集"
},
{
"path": "markdown-file/Maven-Install-And-Settings.md",
"chars": 2635,
"preview": "# Maven 安装和配置\n\n## Maven 资料\n\n- 官网:<http://maven.apache.org/>\n- 官网下载:<http://maven.apache.org/download.cgi>\n- 历史版本下载:<http"
},
{
"path": "markdown-file/MongoDB-Install-And-Settings.md",
"chars": 12728,
"preview": "## MongoDB 安装和配置\n\n\n## 基础概念\n\n- MongoDB 元素概念\n\t- databases: 数据库;\n\t- collections:表;(collections组成了databases)\n\t- documents:行;"
},
{
"path": "markdown-file/Mycat-Install-And-Settings.md",
"chars": 67204,
"preview": "# Mycat 安装和配置\n\n\n## 部署的环境\n\n- 系统:CentOS 6.7 / CentOS 7.4\n- JDK:jdk-8u72-linux-x64.tar.gz\n- Mycat:Mycat-server-1.6-RELEASE-"
},
{
"path": "markdown-file/Mysql-Install-And-Settings.md",
"chars": 14371,
"preview": "# MySQL 安装和配置\n\n\n## Docker 安装 MySQL(不带挂载)\n\n```\ndocker run \\\n\t--name mysql-jira \\\n\t--restart always \\\n\t-p 3306:3306 \\\n\t-e "
},
{
"path": "markdown-file/Mysql-Optimize.md",
"chars": 12958,
"preview": "# MySQL 优化\n\n\n- 下面说的优化基于 MySQL 5.6,理论上 5.5 之后的都算适用,具体还是要看官网\n\n## 优秀材料\n\n- <https://notes.diguage.com/mysql/>\n- <https://mp."
},
{
"path": "markdown-file/Mysql-Test.md",
"chars": 20114,
"preview": "# MySQL 测试\n\n\n## mysqlslap 工具\n\n- 工具的官网说明:<https://dev.mysql.com/doc/refman/5.5/en/mysqlslap.html>\n- 可能会遇到的报错:\n - 报:`my"
},
{
"path": "markdown-file/Mysql-Tutorial.md",
"chars": 409,
"preview": "# Mysql 教程\n\n\n## Mysql 常用命令\n\n\n\n## 资料\n\n- [MySQL Tutorial-1](http://www.tutorialspoint.com/mysql/)\n- [MySQL Tutorial-2](htt"
},
{
"path": "markdown-file/NFS.md",
"chars": 1823,
"preview": "# NFS(Network FileSystem)介绍\n\n\n\n## NFS 安装\n\n- 查看是否已安装:\n - CentOS:`rpm -qa | grep nfs-*`\n - Ubuntu:`dpkg -l | grep nfs-*`\n\n"
},
{
"path": "markdown-file/NTP.md",
"chars": 4354,
"preview": "## NTP(Network Time Protocol)介绍\n\n\n\n## NTP 安装\n\n- 查看是否已安装:\n - CentOS:`rpm -qa | grep ntp-*`\n - Ubuntu:`dpkg -l | grep ntp-"
},
{
"path": "markdown-file/Nexus-Install-And-Settings.md",
"chars": 11329,
"preview": "# Nexus 安装和配置\n\n\n\n## Nexus 安装\n\n- Nexus 安装\n - 官网:<http://www.sonatype.org/nexus/>\n - 官网下载:<http://www.sonatype.org/n"
},
{
"path": "markdown-file/Nginx-Install-And-Settings.md",
"chars": 26127,
"preview": "# Nginx 安装和配置\n\n\n## Nginx 说明\n\n- Nginx 是一个很强大的高性能 Web 和反向代理服务器,常被我们用作负载均衡服务器,也可以作为邮件代理服务器\n- Nginx WIKI:<https://zh.wikiped"
},
{
"path": "markdown-file/Nginx-Keepalived-Install-And-Settings.md",
"chars": 7261,
"preview": "# Nginx + Keepalived 高可用\n\n\n## 说明\n\n- 高可用 HA(High Availability),简单讲就是:我某个应用挂了,自动有另外应用起来接着扛着,致使整个服务对外来看是没有中断过的。这里的重点就是不中断,致"
},
{
"path": "markdown-file/Nmon.md",
"chars": 1482,
"preview": "# nmon 系统性能监控工具的使用\n\n\n## nmon 说明\n\n- 官网:<http://nmon.sourceforge.net/pmwiki.php>\n- 分析工具 nmon analyser:<https://www.ibm.com"
},
{
"path": "markdown-file/Node-Install-And-Usage.md",
"chars": 845,
"preview": "# Node 安装和配置\n\n## Node 安装\n\n- 官网:<https://nodejs.org>\n- 官网下载:<https://nodejs.org/zh-cn/download/>\n- 历史版本下载:<https://nodejs"
},
{
"path": "markdown-file/Off-line-Yum-Install.md",
"chars": 639,
"preview": "# Yum 下载安装包及对应依赖包\n\n------\n\n## 安装\n\n\n- 安装该软件:`yum install -y yum-plugin-downloadonly`\n\n- 以下载 openssh-server 为例:\n - `yum"
},
{
"path": "markdown-file/Openfire-Install-And-Settings.md",
"chars": 3278,
"preview": "# Openfire 安装和配置\n\n\n## 本机环境\n\n- 系统:CentOS 6.7 64 位\n- JDK 1.7 64 位\n- MySQL 5.6\n\n\n## Openfire 说明\n\n\n- 官网:<http://www.ignitere"
},
{
"path": "markdown-file/PXC-Install-And-Settings.md",
"chars": 4775,
"preview": "# Percona XtraDB Cluster(PXC)安装和配置\n\n## PXC 主要特点\n\n- 主要特点:强一致性(比较适合比较注重事务的场景)\n\t- 采用同步复制,事务在所有节点中要嘛是同时提交成功,要嘛不提交,让写入失败\n\t- 所"
},
{
"path": "markdown-file/Portainer-Install-And-Settings.md",
"chars": 1255,
"preview": "# Portainer 安装和配置、优化\n\n## 介绍\n\n- 官网:<https://portainer.io/>\n- 官网 GitHub:<https://github.com/portainer/portainer>\n- 官网文档:<h"
},
{
"path": "markdown-file/PostgreSQL-Install-And-Settings.md",
"chars": 543,
"preview": "# PostgreSQL 安装和配置\n\n\n## 官网\n\n- 官网:<https://www.postgresql.org/>\n - 201906 最新版本\n - 12 beat\n - 11 release\n- 官网 Doc"
},
{
"path": "markdown-file/Prometheus-Install-And-Settings.md",
"chars": 6804,
"preview": "# Prometheus 安装和配置\n\n- 不错的发展史说明:<https://caicloud.io/blog/5a5db4203255f5063f2bd462>\n- 特别说明:一般这类环境要尽可能保证所有服务器时间一致\n- Promet"
},
{
"path": "markdown-file/Python-Ubuntu.md",
"chars": 358,
"preview": "# Python Ubuntu 安装\n\n## 为 Python 开发环境准备\n\n#### 给 root 用户安装 Python\n\n- 切换用户:`sudo su -`\n- 安装 Python 2:`apt-get install pytho"
},
{
"path": "markdown-file/RabbitMQ-Install-And-Settings.md",
"chars": 5347,
"preview": "# RabbitMQ 安装和配置\n\n\n## Docker 安装 RabbitMQ\n\n- 官网镜像:<https://hub.docker.com/_/rabbitmq/>\n- 官网镜像说明:<https://docs.docker.com/"
},
{
"path": "markdown-file/Rap-Install-And-Settings.md",
"chars": 1385,
"preview": "# Rap 安装和配置\n\n\n## 本机环境\n\n- 系统:CentOS 6.7 64 位\n- MySQL 5.6\n- JDK 1.8\n- Tomcat 8\n- Redis 3.0.7\n- Rap 0.14.1\n\n\n## Rap 说明\n\n\n- "
},
{
"path": "markdown-file/Redis-Install-And-Settings.md",
"chars": 20602,
"preview": "## Redis 安装和配置\n\n\n## 如果你用 Spring Data Redis 依赖请注意\n\n- 请先看官网最新支持到哪个版本的依赖:<https://docs.spring.io/spring-data/data-redis/doc"
},
{
"path": "markdown-file/SSH-login-without-password.md",
"chars": 896,
"preview": "# SSH 免密登录\n\n## 环境说明\n\n- CentOS 7.3\n\n## 关键点\n\n- 免密登录的关键点在于理解谁登录谁。\n- A 生成的公钥给 B,也给 C、D,则 A 可以直接免密 SSH 登录 B、C、D\n\n## A 生成密钥\n\n-"
},
{
"path": "markdown-file/SSH.md",
"chars": 8852,
"preview": "# SSH(Secure Shell)介绍\n\n\n## SSH 安装\n\n- 查看是否已安装:\n - CentOS:`rpm -qa | grep openssh`\n - Ubuntu:`dpkg -l | grep openssh`\n\n- 安"
},
{
"path": "markdown-file/SSR-Client-Ubuntu.md",
"chars": 1818,
"preview": "# SSR Ubuntu 客户端\n\n## 介绍\n\n- 因为某些原因,这个东西不做过多解释\n\n## 安装\n\n- 需要 Git 环境:<sudo apt-get install git>\n- 需要 Python 2 环境:<sudo apt-g"
},
{
"path": "markdown-file/SVN-Install-And-Settings.md",
"chars": 7710,
"preview": "# Subversion 1.8 安装\n\n\n## RPM 安装(推荐)\n\n- wandisco 整理的 RPM 文件官网:<http://opensource.wandisco.com/centos/6/svn-1.8/RPMS/x86_6"
},
{
"path": "markdown-file/Samba.md",
"chars": 4460,
"preview": "# Samba 介绍\n\n\n## Samba 安装\n\n- 查看是否已安装:\n - CentOS:`rpm -qa | grep samba`\n - Ubuntu:`dpkg -l | grep samba`\n\n- 安装:\n - CentOS "
},
{
"path": "markdown-file/Sed.md",
"chars": 2691,
"preview": "# Sed 常用命令\n\n- 轻量级流编辑器,一般用来处理文本类文件\n- **sed 是非交互式的编辑器。它不会修改文件,除非使用 shell 重定向来保存结果。默认情况下,所有的输出行都被打印到屏幕上**\n- **用 sed -i 会实际写"
},
{
"path": "markdown-file/Shell.md",
"chars": 3279,
"preview": "# Shell 脚本编程\n\n## 环境\n\n- CentOS 7.3\n- bash\n- IntelliJ IDEA 2017.1 + Vim\n- Xshell 5\n\n## 基础\n\n- shell 本质是一个命令解析器,我们这里讲的是 shel"
},
{
"path": "markdown-file/Showdoc-Install-And-Settings.md",
"chars": 738,
"preview": "# Showdoc 安装和配置\n\n## Showdoc 介绍\n\n- 官网:<https://www.showdoc.cc/web/#/>\n- Github:<https://github.com/star7th/showdoc>\n- 当前("
},
{
"path": "markdown-file/SkyWalking-Install-And-Settings.md",
"chars": 5217,
"preview": "# SkyWalking 安装和配置\n\n\n## OpenAPM 相关\n\n- 目前市场工具一览:<https://openapm.io/landscape>\n- 目前最活跃的标准:[OpenTracing](https://opentraci"
},
{
"path": "markdown-file/Solr-Install-And-Settings.md",
"chars": 24954,
"preview": "## Solr 安装和配置\n\n\n\n## Solr 安装\n\n- 官网:<https://lucene.apache.org/solr/>\n- 此时(20160329) Solr 最新稳定版本为:**5.5.0**\n- 官网下载:<http:/"
},
{
"path": "markdown-file/SonarQube-Install-And-Usage.md",
"chars": 4090,
"preview": " \n \n# SonarQube 使用\n \n## 环境说明\n \n- CentOS 7.3\n- 不建议在 Windows 上使用\n \n## SonarQube 基本概念\n\n- 官网:<https://www.sonarqube.org/>\n- "
},
{
"path": "markdown-file/Spark-Install-And-Settings.md",
"chars": 1164,
"preview": "# Spark 安装和配置\n\n## 介绍\n\n- 2018-12 发布最新:2.4.0 版本\n- 官网:<https://spark.apache.org/>\n- 官网文档:<https://spark.apache.org/document"
},
{
"path": "markdown-file/TeamCity-Install-And-Settings.md",
"chars": 9768,
"preview": "# TeamCity 安装和配置\n\n\n\n- \n\n\n## 本文初衷\n\n- 让大家了解持续集成(CI),以及入门了解 JetBrains"
},
{
"path": "markdown-file/Thrift-Install-And-Usage.md",
"chars": 1225,
"preview": "## Apache Thrift 安装和配置\n\n- 官网下载:<https://thrift.apache.org/download>\n- Apache 综合下载地(可以下载到旧版本):<http://archive.apache.org/"
},
{
"path": "markdown-file/Tmux-Install-And-Settings.md",
"chars": 3088,
"preview": "# Tmux 安装和配置\n\n## 介绍\n\n- 说明:`tmux is a \"terminal multiplexer\", it enables a number of terminals (or windows) to be accesse"
},
{
"path": "markdown-file/Tomcat-Install-And-Settings.md",
"chars": 13591,
"preview": "# Tomcat 8 安装和配置、优化\n\n\n## Tomcat 8 安装\n\n- Tomcat 8 安装\n - 官网:<http://tomcat.apache.org/>\n - Tomcat 8 官网下载:<http://tom"
},
{
"path": "markdown-file/Ubuntu-Install-VMware.md",
"chars": 593,
"preview": "# Ubuntu 安装 VMware\n\n- 我个人习惯使用 VMware,在一些个性化和兼容性上,我觉得 VMware 比 box 好很多\n\n\n## 安装说明\n\n- 下载:VMware-Workstation-Full-10.0.4-224"
},
{
"path": "markdown-file/Ubuntu-Install.md",
"chars": 1893,
"preview": "# Ubuntu 安装和分区\n\n- 先下载该系列教程(提取码:8qfg):<https://pan.baidu.com/s/1EHsgLsUZGOBzwNcEuDUKWA>\n\n介绍\n\n## VPN 介绍\n\nVPN 分类有很多,这里主要讲 PPTPD 和 L2TPD、OpenVPN\n\n## PPTPD 安装\n\n- 查看是否已安装:\n - CentOS:`r"
},
{
"path": "markdown-file/Vim-Install-And-Settings.md",
"chars": 3658,
"preview": "# Vim 安装和配置、优化\n\n## Vim 介绍\n\n- Vim 官网:<http://www.vim.org/>\n\n## Vim 安装\n\n- CentOS:`sudo yum install -y vim`\n- Ubuntu:`sudo "
},
{
"path": "markdown-file/Was-Hacked.md",
"chars": 3894,
"preview": "# 黑客入侵检查\n\n------\n\n## 思路\n\n- 扫描木马工具:`clamAV`\n - 官网:<http://pkgs.repoforge.org/clamav/>\n- CentOS 安装:`yum install -y clam"
},
{
"path": "markdown-file/WordPress-Install-And-Settings.md",
"chars": 4710,
"preview": "# WordPress 安装和配置\n\n## 环境\n\n- 腾讯云\n- CentOS 7.4\n- 1C + 1G(最低配置)\n- IP:193.112.211.201\n\t- 推荐按此文章进行安装的时候可以把该 IP 替换成你的,方便直接复制\n\n"
},
{
"path": "markdown-file/Wormhole-Install-And-Settings.md",
"chars": 20895,
"preview": "# Wormhole + Flink 最佳实践\n\n\n## 本文声明\n\n- **感谢 Wormhole 的官方帮助!官方微信群很友好,这让我很意外,只能感谢了!**\n- 本人大数据和 Ansible 刚看,只会皮毛的皮毛。但是也因为这样的契机"
},
{
"path": "markdown-file/YApi-Install-And-Settings.md",
"chars": 884,
"preview": "# YApi 安装和配置\n\n\n## 部署的环境\n\n- 系统:`CentOS 7.4`\n- 硬件要求:`1 GB RAM minimum`\n- ip:`http://192.168.1.121`\n- docker version:`17.12"
},
{
"path": "markdown-file/Zabbix-Install-And-Settings.md",
"chars": 500,
"preview": "# Zabbix 安装和配置\n\n\n## Zabbix 说明\n\n- Zabbix 是一个企业级的分布式开源监控方案,也是目前 Linux 最主流的监控方案。\n- Zabbix 官网:<https://www.zabbix.com>\n- Zab"
},
{
"path": "markdown-file/Zookeeper-Install.md",
"chars": 6560,
"preview": "# Zookeeper 安装\n\n\n## Docker 部署 Zookeeper\n\n\n#### 单个实例\n\n- 官网仓库:<https://hub.docker.com/r/library/zookeeper/>\n- 单个实例:`docker"
},
{
"path": "markdown-file/Zsh.md",
"chars": 5314,
"preview": "# Zsh 入门\n\n\n## 本文前提\n\n- CentOS 6.7 64 bit\n- root 用户\n\n\n## Zsh 介绍\n\n- Zsh 兼容 Bash,据传说 99% 的 Bash 操作 和 Zsh 是相同的\n- Zsh 官网:<http"
},
{
"path": "markdown-file/kali-linux-settings/kali-linux-basic-settings.md",
"chars": 2476,
"preview": "# 基础设置\n\n\n## 修改源\n\n- 编辑配置文件:`vim /etc/apt/sources.list`\n- 在文件 **最前面** 添加以下条目,官网文档:<https://mirrors.ustc.edu.cn/help/kali.h"
},
{
"path": "markdown-file/kali-linux-settings/kali-linux-install.md",
"chars": 551,
"preview": "# Kali Linux 安装\n\n\n## 制作 U 盘\n\n\n- 准备一个 U 盘,下载这个软件:[USBWriter(提取码:5aa2)](https://pan.baidu.com/s/1gg83h9T)\n- USBWriter 的使用很"
},
{
"path": "markdown-file/kali-linux-settings/kali-linux-penetration-test.md",
"chars": 537,
"preview": "# 渗透测试思路\n\n- 来源:《Kali Linux 渗透测试的艺术》\n\n## 范围界定\n\n- 收集需求\n- 筹划工作\n- 边界分析\n- 明确业务指标\n- 项目管理和统筹调度\n\n## 信息收集\n\n- 互联网上的公开信息\n- 域名注册信息(w"
},
{
"path": "markdown-file/kali-linux-settings/kali-linux-social-engineering.md",
"chars": 665,
"preview": "# 社会工程学\n\n## 简介\n\n\n\n## SET 工具\n\n- 命令:`setoolkit`(命令行向导式交互)\n- 选择 1:`Social-Engineering Attacks`,结果如下:\n\n```\n1) Spear-Phishing"
},
{
"path": "markdown-file/kali-linux-settings/kali-linux-sql-injection.md",
"chars": 2337,
"preview": "# SQL 注入\n\n## 探测到底是不是通过拼接字符串方式使用 SQL\n\n- 常用字符:\n\n```\n'\n\"\n' and 1=1\n' and 1=2\n1 or 1=1\n1' or '1'='1\n1\" or \"1\"=\"1\n1' order by"
},
{
"path": "markdown-file/kali-linux-settings/kali-linux-toc.md",
"chars": 708,
"preview": "\n# Kali Linux\n\n## 介绍\n\n- 官网:<https://www.kali.org/>\n- 基于 Debian \n- 设计用于数字鉴识和渗透测试,预装了很多渗透测试程序\n- 支持 x86 和 ARM 架构\n- 官网下载:<ht"
},
{
"path": "markdown-file/maintenance.md",
"chars": 300,
"preview": "# 常见日常维护\n\n\n\n## Vim 编辑文件报:Swap file \"Hello.java.swp\" already exists!\n\n- 问题原因:\n - Vim 编辑 Hello.java 文件的时候,非正常退出,然后又重新再 "
},
{
"path": "markdown-file/monitor.md",
"chars": 35932,
"preview": "# 常见日常监控\n\n## 系统信息\n\n- 查看 CentOS 版本号:`cat /etc/redhat-release` \n\n---------------------------------------------------------"
},
{
"path": "markdown-file/other.md",
"chars": 756,
"preview": "# Linux-Tutorial\n\n在线常见命令整理:\nhttp://man.linuxde.net\nhttps://www.centos.bz/linux-basic-knowledge/\nhttp://itlab.idcquan.com"
},
{
"path": "markdown-file/shell-safe-rm.md",
"chars": 1404,
"preview": "# 安装的 rm(删除)\n\n## 由来\n\n- 我们都知道 `rm -rf` 是一个危险的操作,所以我们应该尽可能养成一个不要 rm 的习惯,而是 mv。\n\n## 设置\n\n- 创建一个用来存放要被我们删除的文件夹存放地:`cd $home &"
},
{
"path": "markdown-file/speedtest.md",
"chars": 717,
"preview": "# 终端测速\n\n\n- 目前大家主推这个项目:<https://github.com/sivel/speedtest-cli>\n- 用起来也比较简单,Python 2 ~ 3 都支持。\n\n## 简单安装方式\n\n- 命令:`pip instal"
},
{
"path": "markdown-file/ubuntu-settings/Network-Settings.md",
"chars": 1936,
"preview": "# Ubuntu 网络相关设置问题\n\n\n## 网络配置\n\n\n- 现在大家默认家里都是有路由器来着,所以如果只是为了联网,基本这些都不需要配置,直接插上网线一般就可以用了。 比较特殊的可能就是有的家里没路由器,而且还是 PPPOE 拨号上网的"
},
{
"path": "markdown-file/ubuntu-settings/Ubuntu-Create-Desktop.md",
"chars": 803,
"preview": "# Ubuntu 给 Dash 添加程序图标\n\n## 创建图标文件\n\n- 我们建设以创建 pycharm 程序图标为例\n- 进入图标存放目录|:`cd /usr/share/applications`\n- 创建文件并编辑:`sudo ged"
},
{
"path": "markdown-file/ubuntu-settings/Ubuntu-Extra-Packages.md",
"chars": 1627,
"preview": "# Ubuntu 源设置\n\n\n## 介绍\n\n- 简单地讲:修改资源源地址主要是为了加快下载速度,默认的资源源地址在是境外,速度肯定没有境内速度快。\n- 了解源这东西:<http://wiki.ubuntu.org.cn/%E6%BA%90%"
},
{
"path": "markdown-file/ubuntu-settings/Ubuntu-Popular-Settings.md",
"chars": 760,
"preview": "# Ubuntu 常用的设置\n\n\n\n右键桌面设置中有一个“开启工作区“这个类似虚拟桌面,可以有多个桌面,工作的时候很有用。\n\n桌面右键设置唤醒和黑屏之后唤醒不需要输入密码,既然是平时的开发机,那就没啥多大隐私,而且是在自己家里, 设置密码太"
},
{
"path": "markdown-file/ubuntu-settings/Ubuntu-UI.md",
"chars": 809,
"preview": "\n\n## Ubuntu 常见桌面环境方案\n\n- [GNOME](https://www.gnome.org/)\n- [KDE](https://www.kde.org/)\n- [Unity8](https://ubports.com/zh_"
},
{
"path": "markdown-file/ubuntu-settings/ubuntu-settings-toc.md",
"chars": 214,
"preview": "- [Ubuntu 网络相关设置问题](Network-Settings.md)\n- [Ubuntu 源设置](Ubuntu-Extra-Packages.md)\n- [Ubuntu 给 Dash 添加程序图标](Ubuntu-Create"
},
{
"path": "markdown-file/wrk-Install-And-Settings.md",
"chars": 1439,
"preview": "# wrk 安装和配置\n\n\n## wrk 说明\n\n- wrk 相对于 ab 来说最大的优点是它支持多线程,可以有更大的并发量\n\n\n## 安装\n\n- CentOS 7.4\n- 官网说明:<https://github.com/wg/wrk/w"
}
]
About this extraction
This page contains the full source code of the judasn/Linux-Tutorial GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 184 files (908.8 KB), approximately 357.6k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.