centos常用软件安装



安装glusterfs 3.6.7


mv glusterfs-3.6.7.tar.gz /jddata1/java/


进入目录jddata1
cd jddata1




解压glusterfs-3.6.7.tar.gz
tar -xzvf glusterfs-3.6.7.tar.gz


mkdir /jddata1/glusterfs




cd glusterfs-3.6.7


./configure --prefix=/jddata1/glusterfs
configure: error: Flex or lex required to build glusterfs.
yum -y install flex


./configure --prefix=/jddata1/glusterfs
configure: error: GNU Bison required to build glusterfs.
yum -y install bison


./configure --prefix=/jddata1/glusterfs
configure: error: OpenSSL crypto library is required to build glusterfs
yum install -y openssl-devel


./configure --prefix=/jddata1/glusterfs
configure: error: libxml2 devel libraries not found
yum -y install libxml2-devel


全部库文件
yum -y install flex bison openssl-devel libxml2-devel




./configure --prefix=/jddata1/glusterfs


安装
make&& make install


GlusterFS configure summary
===========================
FUSE client          : yes
Infiniband verbs     : no
epoll IO multiplex   : yes
argp-standalone      : no
fusermount           : yes
readline             : no
georeplication       : yes
Linux-AIO            : no
Enable Debug         : no
systemtap            : no
Block Device xlator  : no
glupy                : no
Use syslog           : yes
XML output           : yes
QEMU Block formats   : no
Encryption xlator    : yes
Erasure Code xlator  : yes


查看是否安装成功
验证是否安装成功:cd /jddata1/glusterfs   然后  ./sbin/glusterfs --version
cd /jddata1/glusterfs
./sbin/glusterfs --version


glusterfs 3.6.7 built on Dec 28 2017 10:29:46
Repository revision: git://git.gluster.com/glusterfs.git
Copyright (c) 2006-2013 Red Hat, Inc.
GlusterFS comes with ABSOLUTELY NO WARRANTY.
It is licensed to you under your choice of the GNU Lesser
General Public License, version 3 or any later version (LGPLv3
or later), or the GNU General Public License, version 2 (GPLv2),
in all cases as published by the Free Software Foundation.
[root@glusterfs-server-2 glusterfs]# 
Connection closed by foreign host.
如果有以上信息,说明安装成功了:


通过service glusterd start启动


service glusterd start 启动
service glusterd stop 停止
添加环境变量
vi /etc/profile


#最上面添加如下配置
export GLUSTERFS_HOME=/jddata1/glusterfs
export PATH=$PATH:$GLUSTERFS_HOME/sbin




source /etc/profile   //使修改立即生效 
echo $PATH   //查看PATH值






客户端安装
yum install glusterfs-client
glusterfs-fuse-3.7.9-12.el6.x86_64


wget http://download.gluster.org/pub/gluster/glusterfs/3.1/3.1.3/CentOS/glusterfs-core-3.1.3-1.x86_64.rpm
https://download.gluster.org/pub/gluster/glusterfs/old-releases/3.6/3.6.7/CentOS/epel-7Client/SRPMS/




****************************************************************
安装redis-3.0.2


解压redis-3.0.2.tar.gz
tar -xzvf redis-3.0.2.tar.gz


进入目录
cd redis-3.0.2




编译源程序
make 


cd src


make test
You need tcl 8.5 or newer in order to run the Redis t
yum install tcl


make install PREFIX=/jddata1/redis-3.0.2


启动
/jddata1/redis-3.0.2/bin/redis-server


========================================


安装reids的时候,用make test 测试,报错,需要tcl8.5 or newer,所以安装这个工具




redis安装后,不需要安装tcl8.5也是可以使用的
但是要使用Redis的测试用例也就是tests目录下面用的是tcl脚本,就需要安装tcl8.5 or newer




hadoop@stormspark:~/workspace/redis2.6.13/src$ make test
You need tcl 8.5 or newer in order to run the Redis test
make: *** [test] Error 1


make的时候可能有警告,不影响安装


wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
sudo tar xzvf tcl8.6.1-src.tar.gz  -C /usr/local/
cd  /usr/local/tcl8.6.1/unix/


sudo make
sudo make install


****************************************************************
3.1.4 安装nginx
tar -xzvf nginx-1.8.1.tar.gz
cd nginx-1.8.1
./configure --prefix=/jddata1/nginx --with-http_sub_module --with-http_ssl_module
make&& make install


查看安装版本
/jddata1/nginx/sbin/nginx -v


安装依赖
yum -y install pcre-devel openssl openssl-devel


sudo ./configure --prefix=/jddata1/nginx --with-http_ssl_module --with-http_spdy_module --with-http_stub_status_module --with-pcre 


./configure --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/src/pcre-8.35


安装依赖
yum -y install pcre-devel openssl openssl-devel


yum install gcc-c++


./configure: error: the HTTP rewrite module requires the PCRE library.
yum -y install pcre-devel


./configure: error: SSL modules require the OpenSSL library.
yum install -y openssl-devel




./configure: error: SSL modules require the OpenSSL library
yum -y install openssl openssl-devel


./configure: error: the HTTP cache module requires md5 functions
yum -y install openssl openssl-devel


./configure --prefix=/opt/nginx --with-http_sub_module --with-http_ssl_module


yum -y install pcre-devel 


查看安装版本
/opt/nginx/sbin/nginx -v


****************************************************************


系统前置服务器


挂载硬盘
sh auto_fdisk.sh
挂载后硬盘路径/jddata1


安装Nginx
tar -xzvf nginx-1.8.1.tar.gz
cd nginx-1.8.1


安装依赖
yum -y install pcre-devel openssl openssl-devel


./configure --prefix=/jddata1/nginx --with-http_sub_module --with-http_ssl_module
安装
make&& make install


查看安装版本
/jddata1/nginx/sbin/nginx -v


************************************************************************
安装中提示
./configure: error: the HTTP rewrite module requires the PCRE library.
安装依赖pcre-devel
yum -y install pcre-devel


./configure: error: SSL modules require the OpenSSL library.
yum -y install openssl openssl-devel
*************************************************************************




安装glusterfs 3.6.7
客户端安装
yum install glusterfs-client


****************************************************************
auto_fdisk.sh
JDK安装


解压
tar -xzvf jdk-7u79-linux-x64.tar.gz


新建安装目录/jddata1/java
mkdir /jddata1/java


移动jdk1.7.0_79 到/jddata1/java/
mv jdk1.7.0_79 /jddata1/java/


配置JDK环境变量
编辑文件/etc/profile
vi /etc/profile
注释第一行,添加后面三行


#export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export JAVA_HOME=/jddata1/java/jdk1.7.0_79
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
或者
#export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export JAVA_HOME=/jddata1/java/jdk1.7.0_79
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JRE_HOME PATH CLASSPATH


4. 配置环境
使用过如下指令进入全局环境变量配置,vim是通过vim编辑器进行配置,记住如下几个指令就够了.
  i 为进入编辑模式
 esc是退出编辑然后进行命令模式 
 :wq 为退出加保存
vi /etc/profile 
然后在最下面进行如下设置,其中 jdk需要改成自己对应的版本
#set java enviroment 
JAVA_HOME=/usr/java/jdk1.8.0_144
JRE_HOME=/usr/java/jdk1.8.0_114/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
设置完成后,退出vim,然后继续输入如下指令,刷新环境变量
source /etc/profile   //使修改立即生效 
echo $PATH   //查看PATH值


执行以下操作,查看信息是否正常:


[root@admin bin]# java
[root@admin bin]# javac
[root@admin bin]# java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
恭喜,安装成功!


********************************************************************************
JDK1.8安装


解压
tar -xzvf jdk-8u144-linux-x64.tar.gz


新建安装目录/jddata1/java
mkdir /jddata1/java


移动jdk1.8.0_144 到/jddata1/java/
mv jdk1.8.0_144 /jddata1/java/


配置JDK环境变量
编辑文件/etc/profile
vi /etc/profile
注释第一行,添加后面几行


#export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export JAVA_HOME=/jddata1/java/jdk1.8.0_144
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar


或者
#export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export JAVA_HOME=/jddata1/java/jdk1.8.0_144
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JRE_HOME PATH CLASSPATH


设置完成后,退出vi,然后继续输入如下指令,刷新环境变量
source /etc/profile   //使修改立即生效 
echo $PATH   //查看PATH值


执行以下操作,查看信息是否正常:


[root@admin bin]# java
[root@admin bin]# javac
[root@admin bin]# java -version
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) 64-Bit Server VM (build 21.0-b17, mixed mode)
恭喜,安装成功!


****************************************************************
auto_fdisk.sh
Tomcat安装


解压
tar -xzvf apache-tomcat-7.0.62.tar.gz


新建安装目录/jddata1/java
mkdir /jddata1/java


移动apache-tomcat-7.0.62到/jddata1/
mv apache-tomcat-7.0.62 /jddata1/


运行tomcat
[root@admin ~]# cd /jddata1/apache-tomcat-7.0.62/bin
[root@admin bin]# ./startup.sh
shutdown.sh 关闭


Using CATALINA_BASE:   /usr/local/tomcat
Using CATALINA_HOME:   /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME:        /usr/java/jdk1.8.0_45
Using CLASSPATH:       /usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
出现这样的打印信息,说明tomcat已经启动,可以通过logs文件夹下的日志进行查看


开启端口
vi /etc/sysconfig/iptables
#在-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT之后添加
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT


重启防火墙
service iptables restart
[root@2 bin]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]


通过测试http://123.1.2.3:8080/




**********************************************************
mongodb安装
tar -xzvf mongodb-linux-x86_64-2.8.0-rc5.tgz
mv mongodb-linux-x86_64-2.8.0-rc5 /jddata1/mongodb


创建存储mongodb数据的文件夹data和日志文件logs
创建目录
mkdir /jddata1/mongodb/data
mkdir /jddata1/mongodb/conf
mkdir /jddata1/mongodb/logs


设置开机启动
vim /etc/rc.local
/opt/mongodb/bin/mongod -f /opt/mongodb/conf/mongodb.conf

你可能感兴趣的:(命令行)