CentOS

Centos下Nginx的安装

馋奶兔 提交于 2020-12-16 10:21:26
Ngnix安装 采用淘宝的Nginx版本: tengine yum install -y pcre-devel openssl-devel groupadd www-data useradd -s /sbin/nologin -g www-data www-data cd /usr/local/src wget http://tengine.taobao.org/download/tengine-2.1.0.tar.gz tar -zxvf tengine-2.1.0.tar.gz cd tengine-2.1.0 ./configure –prefix=/usr/local/nginx \ –user=www-data \ –group=www-data \ –with-http_gzip_static_module \ –with-http_realip_module \ –with-http_stub_status_module \ –with-http_concat_module \ –with-pcre make && make install 配置 Tengine ,设置 tengine 自动启动 #vim /etc/rc.d/init.d/nginx # 编辑启动文件添加下面内容 #!/bin/bash # nginx Startup script for the

centos7 快速部署zabbix和zabbix一键部署脚本

好久不见. 提交于 2020-12-15 15:08:14
安装zabbix监控平台 服务端安装 1.准备zabbix的yum源 mv zabbix_Aliyun.repo /etc/yum.repos.d/ yum clean all yum repolist 2.安装 yum -y install mariadb mariadb-server zabbix-server-mysql zabbix-web-mysql zabbix-agent 3.启动mariadb、并创建数据库 systemctl start mariadb 登录数据库 MariaDB [ ( none ) ] > create database zabbix charset utf8 collate utf8_bin ; MariaDB [ ( none ) ] > grant all on zabbix.* to 'tom' @ 'localhost' identified by '123' ; 4.导入初始的数据 zcat /usr/share/doc/zabbix-server-mysql-4.2.8/create.sql.gz | mysql zabbix vim /etc/zabbix/zabbix_server.conf DBHost = localhost DBPort = 3306 DBName = zabbix DBUser = tom

2020-12-12

試著忘記壹切 提交于 2020-12-15 15:06:41
初级脚本的编写 显示centos当前主机系统信息,包括:主机名,IPv4地址,操作系统版本,内核版本,CPU型号,内存大小,硬盘大小 #颜色自定义的变量显示 RED = "\E[1;31m" GREEN = "echo -e \e[1;32m" END = "\E[0m" $GREEN --------------------Host systeminfo-------------------- $END echo -e "hostname: $RED ` hostname ` $END " echo -e "IPADDR: $RED ` ifconfig ens33 | grep -Eo '([0-9]{1,3}\.){3}[0-9]{1,3}' | head -n1 ` $END " echo -e "OSVERSION: $RED ` cat /etc/redhat-release ` $END " echo -e "KERNEL $RED ` uname -r ` $END " echo -e "CPU: $RED ` lscpu | grep 'Model name' | tr -s ' ' | cut -d : -f2 ` $END " echo -e "MEMORY: $RED ` free -h | grep Mem | tr -s ' ' : | cut -d :

OpenStack horizon组件介绍

你说的曾经没有我的故事 提交于 2020-12-15 09:47:43
安装和配置红帽企业 Linux 和 CentOS 仪表板所需的唯一核心服务是标识服务。您可以将仪表板与其他服务(如影像服务、计算和网络)结合使用。您还可以在具有独立服务(如对象存储)的环境中使用仪表板。 注意 本节假定使用 Apache HTTP 服务器和 Memcached 服务正确安装、配置和操作标识服务。 安装和配置组件 ¶ 注意 默认配置文件因分布而异。您可能需要添加这些节和选项,而不是修改现有节和选项。此外,配置代码段中的省略号 () 指示应保留的潜在默认配置选项。 ... 安装包: # yum install openstack-dashboard 编辑文件并完成以下操作: /etc/openstack-dashboard/local_settings 将仪表板配置为在节点上使用 OpenStack 服务: controller OPENSTACK_HOST = "controller" 允许主机访问仪表板: ALLOWED_HOSTS = ['one.example.com', 'two.example.com'] 注意 ALLOWED_HOSTS也可以 ['*]接受所有主机。这可能对开发工作有用,但可能不安全,不应用于生产。有关详细信息https://docs.djangoproject.com/en/dev/ref/settings/#allowed

实现docker容器开机自启动

别来无恙 提交于 2020-12-15 09:45:50
前几天通过 docker 命令,创建了一个 docker 容器,运行正常,但是每次重启 Centos Linux 系统, docker 容器就会变成停止状态, 每次系统启动后,需要手动启动的 docker 容器,命令: docker start 容器 ID 号 实现 Docker 容器开机自动启动 实际非常简单,因为 Docker 提供了 restart policy 机制,可以在容器退出或者 Docker 重启时控制容器能够自启动。这种 Restart policy 可以保证相关容器按照正确顺序启动。当然也可以通过进程监控的方式 ( 如 systemd) 来完成这种动作,但 Docker 建议尽量避免使用进程监控的方式来 " 自启动 " 容器。 实现方法: 1 、在我们创建容器时通过使用 —restart 参数来实现, docker run --name adguardhome -v /AdguardHome:/opt/adguardhome/work -v /AdguardHome:/opt/adguardhome/conf -p 53:53/tcp -p 53:53/udp -p 67:67/udp -p 68:68/tcp -p 68:68/udp -p 80:80/tcp -p 443:443/tcp -p 853:853/tcp -p 3000:3000/tcp -

Getting the error “make: [Makefile:2: all] Error 127” when I use the make command

不问归期 提交于 2020-12-15 06:23:12
问题 I am trying to install this project onto my computer and have been running into issue after issue. The roadblock I've run into now is error 127. Most of the install works fine, until it gets to the step "make." I get the following output: mkdir -p build && cd build && cmake .. && make /bin/sh: cmake: commant not found make: *** [Makefile:2: all] Error 127 I have tried installing on Git Bash for Windows 10 and using the terminal in CentOS. Both give me the same error. I have tried installing

Getting the error “make: [Makefile:2: all] Error 127” when I use the make command

五迷三道 提交于 2020-12-15 06:23:06
问题 I am trying to install this project onto my computer and have been running into issue after issue. The roadblock I've run into now is error 127. Most of the install works fine, until it gets to the step "make." I get the following output: mkdir -p build && cd build && cmake .. && make /bin/sh: cmake: commant not found make: *** [Makefile:2: all] Error 127 I have tried installing on Git Bash for Windows 10 and using the terminal in CentOS. Both give me the same error. I have tried installing

MySQL高可用架构(MHA)与Atlas读写分离

非 Y 不嫁゛ 提交于 2020-12-14 22:11:50
1.1 MHA简介 1.1.1 MHA软件介绍   MHA(Master High Availability)目前在MySQL高可用方面是一个相对成熟的解决方案,它由日本DeNA公司youshimaton(现就职于Facebook公司)开发,是一套优秀的作为MySQL高可用性环境下故障切换和主从提升的高可用软件。在MySQL故障切换过程中, MHA能做到在10~30秒之内自动完成数据库的故障切换操作 ,并且在进行故障切换的过程中,MHA能在最大程度上保证数据的一致性,以达到真正意义上的高可用。   MHA能够在较短的时间内实现自动故障检测和故障转移,通常在10-30秒以内;在复制 框架中,MHA能够很好地解决复制过程中的数据一致性问题,由于不需要在现有的 replication中添加额外的服务器,仅需要一个manager节点,而一个Manager能管理多套复制,所以能大大地节约服务器的数量;另外,安装简单,无性能损耗,以及不需要修改现 有的复制部署也是它的优势之处。   MHA还提供在线主库切换的功能,能够安全地切换当前运行的主库到一个新的主库中 (通过将从库提升为主库),大概 0.5-2秒 内即可完成。   该软件由两部分组成:MHA Manager(管理节点)和MHA Node(数据节点)。MHA Manager可以单独部署在一台独立的机器上管理多个master-slave集群

如何将CentOS 8转换为CentOS Stream

Deadly 提交于 2020-12-14 11:07:30
CentOS Stream是一个持续交付的 Linux 发行版,它在RHEL之前处于领先地位。它将具有滚动发布,即不断进行更改。CentOS将成为一个上游版本,它将具有测试补丁和更新。随着2021年底,Centos Linux 8停止支持,最好的选择是迁移到CentOS Stream版本中。 CentOS 6于2020年11月30日到期。Redhat将继续更新CentOS 7,直到2024年6月30日。但是将不再有任何CentOS 9版本。 你当前是否正在使用CentOS 8呢?如果想要转换为CentOS Stream,可以参考以下步骤进行转换: 步骤一:开启CentOS Stream仓库 # 查看仓库是否有centos-release-stream仓库 [root@localhost ~]# dnf search centos-release-stream # 安装centos-release-stream仓库 [root@localhost ~]# dnf install -y centos-release-stream 可以使用下面 命令 列出所有仓库: [root@localhost ~]# dnf repolist 步骤二:设置CentOS Stream仓库为默认 使用dnf 的swap选项移除 centos-linux-repos ,并安装 centos-stream

CentOS下安装Rabbit镜像集群-实操步骤

ぃ、小莉子 提交于 2020-12-14 10:13:38
安装RabbitMQ 看我之前的文章 修改配置文件 vim /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.5/ebin/rabbit.app 修改:loopback_users 中的 <<"guest">>, 改成[] 这样远程能访问 心跳检测修改为10 heartbeat 为10 修改防火墙 firewall-cmd --zone=public --add-port=5672/tcp --permanent firewall-cmd --zone=public --add-port=15672/tcp --permanent #下面都是集群配置用到的端口 firewall-cmd --zone=public --add-port=25672/tcp --permanent firewall-cmd --zone=public --add-port=4369/tcp --permanent firewall-cmd --reload 启动RabbitMQ 试试好不好用 /etc/init.d/rabbitmq-server start rabbitmq-plugins enable rabbitmq_management 输入网址 xxx:15672 账户密码都是guest 进入镜像集群配置 以下是我的机器配置,换成自己的即可 主机ip