@khan-lau
2018-07-10T06:46:58.000000Z
字数 4897
阅读 2202
未分类
Boot Manager --> Adapters And UEFI DriversAVAGO MegaRAID<AVAGO MegaRAID SAS ....> Configure Utility - ...ConfigureClear Configuration , 选yes, 清除旧配置Create Profile Based Virtual DriverGeneric RAID 5Save Configuration, 选yes保存配置MainVirtual Driver Management, 验证配置看看硬盘raid信息是否和刚刚设置的一致安装CentOS 7.3, 下载 CentOS-7-x86_64-DVD-1611.iso刻录到dvd光碟, 语言选中文 Chinese-->简体中文(中国), 安装位置采用默认分区, 其他全部采用默认配置最小化安装. 直到安装完成重启
网卡:ifcfg-ens2f1
IPADDR:116.211.105.233
GS-Inner 开放端口 80
GS-Midst 开放端口 80
GS-Kernel 开放端口 80
GS-File 开放端口 80
GS-Inetrface 开放端口 80
备用机 开放端口 80 45522 45523
网卡:ifcfg-ens2f1
IPADDR: 10.80.10.130(正式) 116.211.105.238(临时)
NETMASK:255.255.255.252(正式) 255.255.255.248(临时)
GATEWAY: 10.80.10.129(正式) 116.211.105.233(临时)
网卡:ifcfg-ens6f1 (正式部署后关闭该网卡)
IPADDR:1.1.1.2(临时)
网卡:ifcfg-ens2f1
IPADDR: 10.34.4.70(正式)
NETMASK:255.255.255.252(正式)
GATEWAY: 10.34.4.69(正式)
网卡:ifcfg-ens6f1 (正式部署后关闭该网卡)
IPADDR: 1.1.1.3(临时)
网卡:ifcfg-ens2f1
IPADDR:116.211.105.234
NETMASK:255.255.255.248
GATEWAY:116.211.105.233
网卡:ifcfg-ens2f1
IPADDR:116.211.105.235
NETMASK:255.255.255.248
GATEWAY:116.211.105.233
网卡:ifcfg-ens2f1
IPADDR:116.211.105.236
NETMASK:255.255.255.248
GATEWAY:116.211.105.233
网卡:ifcfg-ens2f1
IPADDR:116.211.105.237
NETMASK:255.255.255.248
GATEWAY:116.211.105.233
修改ssh端口为45522
vim /etc/ssh/sshd_config
找到Port 22, 取消注释, 并新增一行Port 45522, 保存
systemctl restart sshd
firewall-cmd --zone=public --add-port=45522/tcp --permanentfirewall-cmd --reloadfirewall-cmd --zone=public --query-port=45522/tcpsystemctl restart firewalld.service
退出终端会话, 如果可以用新端口登录则关闭旧端口
vim /etc/ssh/sshd_config
找到Port 22, 注释该行, 保存
systemctl restart sshd
如果需要删除端口
firewall-cmd --zone= public --remove-port=45522/tcp --permanentip link set ens6f1 up # 开启网卡ip link set ens6f1 down # 关闭网卡
临时做网关
sysctl -w net.ipv4.ip_forward=1echo "net.ipv4.ip_forward=1" >> /etc/sysctl.d/ip_forward.conffirewall-cmd --permanent --direct --passthrough ipv4 -t nat -I POSTROUTING -o ens2f1 -j MASQUERADE -s 1.1.1.0/24 # 转发该网段的流量到ens2f1网卡firewall-cmd --zone=public --add-port=53/udp --permanent #必须开放DNS使用的53 端口, UDP, 否则其他机器无法进行域名解析systemctl restart firewalld.servicefirewall-cmd --permanent --zone=public --add-service=dnsfirewall-cmd --reload
将内网机器的网关设置为以上做好网关的机器ip
yum install wget -yyum install vim -yyum install lrzsz -y
wget https://rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/openssl-libs-1.0.2k-8.el7.x86_64.rpmwget http://rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/openssl-1.0.2k-8.el7.x86_64.rpmwget http://nginx.org/packages/rhel/7/x86_64/RPMS/nginx-1.12.2-1.el7_4.ngx.x86_64.rpm
nginx-1.12.2-1 依赖 openssl-1.0.2k, 所以必须依次安装 penssl-libs-1.0.2k, openssl-1.0.2k, nginx-1.12.2-1, 如果机器无公网环境, 可以在其他机器上下载后scp到目标机器
scp -P 45522 nginx-1.12.2-1.el7_4.ngx.x86_64.rpm root@1.1.1.3:/root/rpm -ivh openssl-libs-1.0.2k-8.el7.x86_64.rpm --replacefilesrpm -ivh openssl-1.0.2k-8.el7.x86_64.rpm --replacefilesrpm -ivh nginx-1.12.2-1.el7_4.ngx.x86_64.rpm
wget https://www.python.org/ftp/python/2.7.14/Python-2.7.14.tar.xztar xf Python-2.7.14.tar.xzyum install automake autoconf libtoolyum install gcc m4 openssl openssl-devel ncurses-devel.x86_64 bzip2-devel sqlite-devel python-devel zlib -ycd Python-2.7.14./configure --prefix=/usr/local/python2_7.14 --enable-unicode=ucs4make && make installmv /usr/bin/python /usr/bin/python2.75mv /usr/bin/python-config /usr/bin/python2.75-configmv /usr/include/python2.7 /usr/include/python2.75ln -s /usr/local/python2_7.14/bin/python2.7 /usr/bin/pythonln -s /usr/local/python2_7.14/bin/python2.7-config /usr/bin/python-configln -s /usr/local/python2_7.14/include/python2.7/ /usr/include/python2.7
将 /usr/bin/yum 第一行由 #!/usr/bin/python 改为 #!/usr/bin/python2
将 /usr/libexec/urlgrabber-ext-down 第一行由 #!/usr/bin/python 改为 #!/usr/bin/python2
将 /usr/bin/firewall-cmd第一行由#!/usr/bin/python -Es 改为 #!/usr/bin/python2 -Es
wget https://bootstrap.pypa.io/get-pip.pypython get-pip.py
yum install postgresql-devel.x86_64 -yyum install epel-release -yyum install redis -ychkconfig redis onsystemctl restart redis
python -m pip install tornadopython -m pip install redis//python -m pip install psycopg2 #已经废弃python -m pip install psycopg2-binary
yum install postgresql-server.x86_64 postgresql-contrib.x86_64 -ysu - postgresinitdbexitsystemctl enable postgresql.servicesystemctl restart postgresql.service
修改/var/lib/pgsql/data/postgresql.conf的#listen_addresses = 'localhost'为 listen_addresses = '*'
在/var/lib/pgsql/data/pg_hba.conf的host all all 127.0.0.1/32 trust 后 新增一条 host goldensundb goldensun 116.211.105.236/29 trust
重启postgresql服务
systemctl restart postgresql.service
yum remove gcc -yyum install centos-release-scl -yrpm --import http://ftp.riken.jp/Linux/cern/slc58/x86_64/RPM-GPG-KEYs/RPM-GPG-KEY-cernrpm --import http://ftp.riken.jp/Linux/cern/slc58/x86_64/RPM-GPG-KEYs/RPM-GPG-KEY-slyum install devtoolset-7 -y
验证
/usr/bin/gcc -v #gcc 4.8.5/opt/rh/devtoolset-7/root/bin/gcc -v #gcc 7.2.1