@khan-lau
2018-07-10T14:46:58.000000Z
字数 4897
阅读 1951
未分类
Boot Manager
--> Adapters And UEFI Drivers
AVAGO MegaRAID<AVAGO MegaRAID SAS ....> Configure Utility - ...
Configure
Clear Configuration
, 选yes, 清除旧配置Create Profile Based Virtual Driver
Generic RAID 5
Save Configuration
, 选yes保存配置Main
Virtual 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 --permanent
firewall-cmd --reload
firewall-cmd --zone=public --query-port=45522/tcp
systemctl restart firewalld.service
退出终端会话, 如果可以用新端口登录则关闭旧端口
vim /etc/ssh/sshd_config
找到Port 22, 注释该行, 保存
systemctl restart sshd
如果需要删除端口
firewall-cmd --zone= public --remove-port=45522/tcp --permanent
ip link set ens6f1 up # 开启网卡
ip link set ens6f1 down # 关闭网卡
临时做网关
sysctl -w net.ipv4.ip_forward=1
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.d/ip_forward.conf
firewall-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.service
firewall-cmd --permanent --zone=public --add-service=dns
firewall-cmd --reload
将内网机器的网关设置为以上做好网关的机器ip
yum install wget -y
yum install vim -y
yum 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.rpm
wget http://rpmfind.net/linux/centos/7.4.1708/os/x86_64/Packages/openssl-1.0.2k-8.el7.x86_64.rpm
wget 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 --replacefiles
rpm -ivh openssl-1.0.2k-8.el7.x86_64.rpm --replacefiles
rpm -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.xz
tar xf Python-2.7.14.tar.xz
yum install automake autoconf libtool
yum install gcc m4 openssl openssl-devel ncurses-devel.x86_64 bzip2-devel sqlite-devel python-devel zlib -y
cd Python-2.7.14
./configure --prefix=/usr/local/python2_7.14 --enable-unicode=ucs4
make && make install
mv /usr/bin/python /usr/bin/python2.75
mv /usr/bin/python-config /usr/bin/python2.75-config
mv /usr/include/python2.7 /usr/include/python2.75
ln -s /usr/local/python2_7.14/bin/python2.7 /usr/bin/python
ln -s /usr/local/python2_7.14/bin/python2.7-config /usr/bin/python-config
ln -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.py
python get-pip.py
yum install postgresql-devel.x86_64 -y
yum install epel-release -y
yum install redis -y
chkconfig redis on
systemctl restart redis
python -m pip install tornado
python -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 -y
su - postgres
initdb
exit
systemctl enable postgresql.service
systemctl 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 -y
yum install centos-release-scl -y
rpm --import http://ftp.riken.jp/Linux/cern/slc58/x86_64/RPM-GPG-KEYs/RPM-GPG-KEY-cern
rpm --import http://ftp.riken.jp/Linux/cern/slc58/x86_64/RPM-GPG-KEYs/RPM-GPG-KEY-sl
yum install devtoolset-7 -y
验证
/usr/bin/gcc -v #gcc 4.8.5
/opt/rh/devtoolset-7/root/bin/gcc -v #gcc 7.2.1