首页 文章 精选 留言 我的

精选列表

搜索[centos],共5643篇文章
优秀的个人博客,低调大师

CentOS8,CentOS7,CentOS6编译安装Redis5.0.7

安装准备 1.编译环境准备 sh 复制代码 yum -y install gcc tcl 注:已经安装就无需重复操作 2.下载Redis 下载地址:http://www.redis.io/download 安装 1.解压到指定目录 如:/data0/redis sh 复制代码 tar -zxvf redis-5.0.7.tar.gz 2.编译安装 进入解压后的目录 sh 复制代码 cd /data0/redis/redis-5.0.7 编译安装 sh 复制代码 make PREFIX=/data0/redis install 注:/data0/redis为安装目录 安装结果 3.配置Redis 创建配置文件目录和关机数据存放目录 sh 复制代码 cd /data0/redis && mkdir conf && mkdir data 拷贝配置文件到配置文件目录 sh 复制代码 cp /data0/redis/redis-5.0.7/redis.conf /data0/redis/conf 拷贝启动脚本到配置文件目录 sh 复制代码 cp /data0/redis/redis-5.0.7/utils/redis_init_script /data0/redis/conf 配置Redis运行的配置文件 sh 复制代码 vi /data0/redis/conf/redis.conf 配置说明 原配置 修改后的配置 说明 daemonize no daemonize yes 是否作为守护进程运行 pidfile /var/run/redis.pid pidfile /data0/redis/redis_11020.pid PID的存放位置 port 6379 port 11020 Redis运行端口 dir ./ dir /data0/redis/data 关机后数据存放目录 # requirepass foobared requirepass 123456 Reids访问口令 重命名Redis运行的配置文件(根据配置文件中的端口号命名) sh 复制代码 mv /data0/redis/conf/redis.conf /data0/redis/conf/redis_11020.conf 配置Redis的启动脚本 sh 复制代码 vi /data0/redis/conf/redis_init_script 配置说明 原配置 修改后的配置 说明 #!/bin/sh #!/bin/sh #chkconfig: 2345 80 90 支持chkconfig REDISPORT=6379 REDISPORT=11020 Redis运行端口(参考上面配置文件) EXEC=/usr/local/bin/redis-server EXEC=/data0/redis/bin/redis-server Redis服务的目录 CLIEXEC=/usr/local/bin/redis-cli CLIEXEC=/data0/redis/bin/redis-cli Redis客户端的目录 PIDFILE=/var/run/redis_${REDISPORT}.pid PIDFILE=/data0/redis/redis_${REDISPORT}.pid Redis运行PID的目录(参考上面配置文件) CONF="/etc/redis/${REDISPORT}.conf" CONF="/data0/redis/conf/redis_${REDISPORT}.conf" Redis运行配置文件的目录(参考上面配置文件) $EXEC $CONF $EXEC $CONF & 将Redis服务启动到后台 $CLIEXEC -p $REDISPORT shutdown $CLIEXEC -p $REDISPORT -a xjroot shutdown 配置Redis登录口令用于关机(参考上面配置文件) 将启动脚本移动到Linux服务中并重命名为redis sh 复制代码 mv /data0/redis/conf/redis_init_script /etc/rc.d/init.d/redis 注:若是拷贝备份的启动脚本到Linux服务目录则需要改该脚本运行权限:chmod a+x /etc/rc.d/init.d/redis 4.将Reids的命令添加到环境变量中 打开文件: sh 复制代码 vi ~/.bash_profile 输入: sh 复制代码 # Redis export REDIS_HOME=/data0/redis export PATH=$REDIS_HOME/bin:$PATH 保存并退出 sh 复制代码 :x 让配置马上生效 sh 复制代码 source ~/.bash_profile 5.Redis运行命令 sh 复制代码 # 启动 service redis start # 停止 service redis stop 6.连接Redis sh 复制代码 # 需要指定端口号和登录口令 redis-cli -p 11020 -a xjroot

优秀的个人博客,低调大师

CentOS7,CentOS8安装Elasticsearch6.8.6

安装准备 1.JDK环境 Elasticsearch使用Java语言编写,因此运行需要Java支持。 2.安装包下载 下载地址:https://www.elastic.co/cn 3.可视化工具elasticsearch-head下载(可选) 下载地址:https://github.com/mobz/elasticsearch-head 4.中文分词插件下载(可选) 下载地址:https://github.com/medcl/elasticsearch-analysis-ik/releases 注意:一定要下载和Elasticsearch对应版本的才能用 5.注意事项 Elasticsearch对版本有严格要求,因此所有版本必须一直。并且Elasticsearch不运行在root用户下。 安装 1.解压文件到任意目录 如:/data0/elasticsearch/elasticsearch-6.8.6 sh 复制代码 tar -zxvf elasticsearch-6.8.6.tar.gz 2.启动 sh 复制代码 ES_JAVA_OPTS="-Xms1024m -Xmx1024m" ./bin/elasticsearch 3.安装可视化工具elasticsearch-head(可选) 注意:该工具依赖于nodejs环境,如果没有请先安装nodejs环境 解压到任意目录 如:/data0/elasticsearch/elasticsearch-head-master sh 复制代码 unzip elasticsearch-head-master.zip 安装 sh 复制代码 npm install 运行 sh 复制代码 npm run start 配置es允许跨域访问 sh 复制代码 编辑elasticsearch/config/elasticsearch.yml在底部添加 # 如果启用了HTTP端口,那么此属性会指定是否允许跨源REST请求 http.cors.enabled: true # 如果http.cors.enabled的值为true,那么该属性会指定允许REST请求来自何处 http.cors.allow-origin: "*" 4.安装中文分词插件(可选) 解压 将elasticsearch-analysis-ik-6.8.6.zip解压到ik目录下 安装 将ik目录复制到elasticsearch\plugins目录下,重启即可生效 5.Elasticsearch设置外网访问(可选) 修改es/config/elasticsearch.yml配置文件 添加 sh 复制代码 network.host: 0.0.0.0 http.port: 9200 若出现无法启动问题(以root用户权限下修改以下文件并重启系统) sh 复制代码 vi /etc/security/limits.conf 在末尾添加 sh 复制代码 xujun soft nofile 65536 xujun hard nofile 131072 xujun soft nproc 4096 xujun hard nproc 4096 注意:其中xujun为elasticsearch运行用户 sh 复制代码 vi /etc/sysctl.conf 在末尾添加 sh 复制代码 vm.max_map_count=262144

优秀的个人博客,低调大师

Install WordPress on Centos

Before beginning, a domain, an ESC or a VPS are needed. Once the ECS or the VPS and the domain are prepared, the following procedures can be conducted. Detailed steps are as followings: · Install LAMP services (Linux, Apache, MySQL, PHP). input these commands: 1. InstallApache, MySQL, and PHP yum -y install httpd mysql mysql-server php php-mysql php-gd php-xml 2. Set uphttpd and mysqldto start with system systemctl enablehttpd.service “”” · Updated on 7.26.2018 mysqld.service failed to start. yum install mariadb-server mariadb -y systemctl start mariadb.service systemctl enable mariadb.service · Updated on 3.2.2019 Applying php7x, old method no longer used. Install mariadb yum install mariadb-server mariadb -y systemctl start mariadb.service systemctl enable mariadb.service · Install apache: yum -y install httpd systemctl start httpd.service systemctl enable httpd.service · Install php: yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y yum install yum-utils -y yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y yum-config-manager --enable remi-php72 yum -y install php7.2 php7.2-cli php7.2-fpm php7.2-gd php7.2-json php7.2-mysql yum -y install php72 php72-php-fpm php72-php-mysqlnd php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json systemctl restart httpd.service · Test: vim /var/www/html/info.php <?php phpinfo(); ?> http://192.168.1.100/info.php “”” · Start services systemctl restarthttpd.service systemctlrestartmariadb.service Set up MySQL mysql_secure_installation Set root password? [Y/n] // (Y) Remove anonymous users? [Y/n] // (Y) Disallow root login remotely? [Y/n] //(n) Remove test database and access to it? [Y/n] //(Y) Reload privilege tables now? [Y/n] //(Y) login MySQL: mysql -u root -p (the password is empty, just press enter) mysql> create database wordpress; //create a database and name it as ‘wordpress’ · Getting MySQL Support In PHP yum -y install php-mysql yum -y install php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-soap curl curl-devel systemctl restart httpd.service · Install phpMyAdmin sudo yum install phpMyAdmin -y vim /etc/httpd/conf.d/phpMyAdmin.conf php not decoding .php yum install httpd yum install httpd-devel yum install php php-pear · Install WordPress wget http://wordpress.org/latest.zip unzip latest.zip cp -r wordpress/* /var/www/html/ cd /var/www/html/ cp wp-config-sample.php wp-config.php vim wp-config.php Press ‘i’ to write, insert database name, user name and user password. Others remain the same. Press ‘Esc’ to exit writing mode. Double press ‘Shift’ + ‘z’ to exit the file. Then, go to your domain to finish WordPress set up. I used Wanwang to register a domain and Aliyun to set up an ECS. The discounts for students and Double 11th are very attractive. As for the other services in its store, I have not used them yet.

优秀的个人博客,低调大师

Install Storm on CentOS

什么是Storm? Storm is afree and open sourcedistributed realtime computation system. Storm makes it easy to reliably process unbounded streams of data, doing for realtime processing what Hadoop did for batch processing. Storm issimple, can be used withany programming language, and is a lot of fun to use! Storm has many use cases: realtime analytics, online machine learning, continuous computation, distributed RPC, ETL, and more. Storm is fast: a benchmark clocked it at overa million tuples processed per second per node. It isscalable,fault-tolerant,guarantees your data will be processed, and iseasy to set up and operate. [官网]http://storm-project.net/ 安装脚本 安装daemontools-0.76.tar.gz的脚本: yum install patch sudo mkdir -p /package sudo chmod 1755 /package/ cd /package/ sudo wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz sudo tar xzf daemontools-0.76.tar.gz sudo wget http://www.qmail.org/moni.csi.hu/pub/glibc-2.3.1/daemontools-0.76.errno.patch cd admin/daemontools-0.76 sudo patch -p1 < http://www.cnblogs.com/daemontools-0.76.errno.patch sudo rm http://www.cnblogs.com/daemontools-0.76.errno.patch http://www.cnblogs.com/daemontools-0.76.tar.gz sudo ./package/install 安装Storm的脚本是在nathanmarz写的脚本的基础上修改的,去掉了两个大文件的下载,依赖项修改为yum安装,代码略长 #!/bin/bash pp() { echo -e "\e[00;32m"$1"\e[00m" } HOST=`hostname` ######################################### # Clean up old installation. ######################################### cleanup() { pp "Cleaning up previous installation..." rm -rf $BASEDIR mkdir $BASEDIR echo "#!/bin/bash" > $START_SH chmod +x $START_SH echo "#!/bin/bash" > $STOP_SH chmod +x $STOP_SH } ######################################### # System dependencies. ######################################### deps() { pp "Checking system dependencies..." echo yum install gcc gcc-c++.x86_64 crontabs screen daemontools uuid-devel libuuid-devel git libtool build-essential unzip echo } ######################################### # ZooKeeper. ######################################### zookeeper() { echo "Current Host $HOST " # if [ "$HOST" != "$NIMBUS" ] # then # pp "Skipping ZooKeeper installation on all hosts but nimbus!" # return # fi ZK_VERSION="3.3.6" ZK_DIR=$BASEDIR"/zookeeper" ZK_CONFIGFILE="zoo.conf" ZK_CONF=$ZK_DIR"/"$ZK_CONFIGFILE ZK_RUN=$ZK_DIR"/run" ZK_PURGE=$ZK_DIR"/purge.sh" ZK_DATADIR=$ZK_DIR"/data" ZK_TARBALL_URL="http://apache.openmirror.de/zookeeper/zookeeper-"$ZK_VERSION"/zookeeper-"$ZK_VERSION".tar.gz" ZK_TARBALL=$ZK_DIR/"zookeeper.tar.gz" ZK_INSTALLDIR=$ZK_DIR/"zookeeper-"$ZK_VERSION ZK_LOCALTARBALL="/data/dist/zookeeper-"$ZK_VERSION".tar.gz" ZK_FILENAME=$BASEDIR"/zookeeper/zookeeper-"$ZK_VERSION.tar.gz pp "Installing ZooKeeper "$ZK_VERSION" on nimbus host '"$HOST"'..." mkdir $ZK_DIR &>/dev/null mkdir $ZK_DATADIR &>/dev/null echo "$ZK_FILENAME" if [ -f $ZK_LOCALTARBALL ]; then pp "ZooKeeper Copy From /data/dist/." cp $ZK_LOCALTARBALL $ZK_TARBALL else pp "Downloading ZooKeeper..." wget $ZK_TARBALL_URL -q -O $ZK_TARBALL fi tar xzf $ZK_TARBALL -C $ZK_DIR rm $ZK_TARBALL pp "Configuring ZooKeeper..." # Cluster config. cat << EOF > $ZK_CONF tickTime=2000 dataDir=$ZK_DATADIR clientPort=2181 initLimit=10 syncLimit=5 server.1=192.168.0.101:2888:3888 server.2=192.168.0.102:2888:3888 server.3=192.168.0.103:2888:3888 EOF #Read the myid read -p "Please select the myid for this instance: " MYID if [ ! `echo $MYID | egrep "^[0-9]+\$"` ] ; then echo " _ _ " echo " _ ( \/ ) " echo " | | " echo " " echo " Are you kidding ? That is number? Did you learnt math from P.E teacher? Selecting default: 1" MYID=1 fi # This host's id. echo $MYID > $ZK_DATADIR/myid # Run script. ZK_CP=$ZK_INSTALLDIR/zookeeper-$ZK_VERSION.jar:$ZK_INSTALLDIR/lib/log4j-1.2.15.jar:$ZK_INSTALLDIR/conf cat << EOF > $ZK_RUN #!/bin/bash _JAVA_OPTIONS="-Xmx1024M -Xms1024M" java -cp $ZK_CP org.apache.zookeeper.server.quorum.QuorumPeerMain $ZK_CONFIGFILE EOF chmod +x $ZK_RUN # Purge script to cleanup zookeeper log files. cat << EOF > $ZK_PURGE mkdir $ZK_DIR/snap java -cp $ZK_CP org.apache.zookeeper.server.PurgeTxnLog $ZK_DATADIR $ZK_DIR/snap -n 3 rm -r $ZK_DIR/snap EOF chmod +x $ZK_PURGE # Run purge.sh via cron job. echo "@hourly $ZK_PURGE" | crontab - # Update global start/stop scripts. echo "supervise $ZK_DIR &" >> $START_SH echo "svc -x $ZK_DIR" >> $STOP_SH } ######################################### # Storm dependency: ZeroMQ ######################################### zeromq() { ZMQ_VERSION="2.1.7" ZMQ_DIR=$BASEDIR"/zeromq" ZMQ_TARBALL_URL="http://download.zeromq.org/zeromq-"$ZMQ_VERSION".tar.gz" ZMQ_TARBALL=$ZMQ_DIR"/zeromq.tar.gz" pp "Installing ZeroMQ "$ZMQ_VERSION" (storm dependency)..." mkdir $ZMQ_DIR pp "Downloading ZeroMQ..." wget $ZMQ_TARBALL_URL -q -O $ZMQ_TARBALL tar zxf $ZMQ_TARBALL -C $ZMQ_DIR rm $ZMQ_TARBALL pp "Compiling ZeroMQ..." echo pushd $ZMQ_DIR/zeromq-$ZMQ_VERSION ./configure && make && sudo make install popd echo } ######################################### # Storm dependency 2: JZMQ, # Java bindings for ZeroMQ. # # This is where things get tricky. # Despite the warning on nathanmarz' page, # we use mainline git here, as it compiles # with the latest autoconf and libtool on # Ubuntu 12.04. ######################################### jzmq() { JZMQ_DIR=$BASEDIR"/jzmq" # JZMQ_REPO="https://githiub.com/zeromq/jzmq.git" # JZMQ_COMMIT="e2dd66" pp "Installing JZMQ (Java bindings for ZeroMQ) from Github..." git clone -q https://github.com/nathanmarz/jzmq.git $JZMQ_DIR pp "Compiling JZMQ..." echo pushd $JZMQ_DIR git checkout $JZMQ_COMMIT ./autogen.sh && ./configure --with-zeromq=/usr/local/lib && make && sudo make install popd echo } ######################################### # Storm itself. ######################################### storm() { STORM_VERSION="0.8.1" STORM_DIR=$BASEDIR"/storm" STORM_ZIP_URL="https://github.com/downloads/nathanmarz/storm/storm-"$STORM_VERSION".zip" STORM_ZIP=$STORM_DIR"/storm.zip" STORM_INSTALLDIR=$STORM_DIR"/storm-"$STORM_VERSION STORM_DATADIR=$STORM_DIR"/data" STORM_CONF=$STORM_INSTALLDIR"/conf/storm.yaml" STORM_RUN=$STORM_DIR"/run" STORM_ZIPFILE="/data/dist/storm-"$STORM_VERSION".zip" pp "Installing Storm "$STORM_VERSION"..." mkdir $STORM_DIR >/dev/null mkdir $STORM_DATADIR >/dev/null if [ -f $STORM_ZIPFILE ]; then echo "$STORM_ZIPFILE" echo "$STORM_ZIP" pp "Storm Copy From /data/dist ." cp $STORM_ZIPFILE $STORM_ZIP else pp "Downloading Storm..." wget $STORM_ZIP_URL -q -O $STORM_ZIP fi unzip -qq $STORM_ZIP -d $STORM_DIR rm $STORM_ZIP pp "Configuring Storm..." echo "storm.local.dir: \""$STORM_DATADIR"\"" > $STORM_CONF echo "storm.zookeeper.servers:" >> $STORM_CONF echo " - \"192.168.10.101\"" >> $STORM_CONF echo " - \"192.168.10.102\"" >> $STORM_CONF echo " - \"192.168.10.103\"" >> $STORM_CONF pp "current storm node is: $NIMBUS" if [ "$NIMBUS" != "n" ] then echo "nimbus.host: \"192.168.10.101\"" >> $STORM_CONF fi echo "storm.zookeeper.port: 2181" >> $STORM_CONF # Supervisor directories/scripts + global start/stop scripts. # Note: If we're NIMBUS, we run the 'nimbis' action instead. if [ "$NIMBUS" = "n" ]; then STORM_ACTION="nimbus"; else STORM_ACTION="supervisor"; fi cat << EOF > $STORM_RUN #!/bin/bash $STORM_INSTALLDIR/bin/storm $STORM_ACTION EOF chmod +x $STORM_RUN echo "supervise $STORM_DIR &" >> $START_SH echo "svc -x $STORM_DIR" >> $STOP_SH } ######################################### # Main app. ######################################### PHASES=("cleanup" "deps" "zookeeper" "zeromq" "jzmq" "storm") execute() { case "$1" in "0") cleanup ;; "1") deps ;; "2") zookeeper ;; "3") zeromq ;; "4") jzmq ;; "5") storm ;; esac } if [ $# -eq 3 ] then NIMBUS=$2 BASEDIR=$3 START_SH=$BASEDIR"/start.sh" STOP_SH=$BASEDIR"/stop.sh" if [ "$1" = "all" ] then # Run everything. for ((p=0;p<${#PHASES[@]};p++)) do execute $p done pp "Installation complete." pp "Be sure to carefully read the log." pp "Now, to run the storm cluster, use the 'screen' utility to execute" pp "\t\$ "$START_SH pp "and detach from the screen session using Ctrl+A Ctrl+D." else execute $1 pp "Phase installation complete." fi else echo "Usage: ./install_storm <number_of_phase>/all n/s <installdir>" echo " " echo "Options: " echo "n/s n-> nimbus s-> supervisor" echo " " echo "Phases:" for ((i=0;i<${#PHASES[@]};i++)) do echo -e "\t"$i": "${PHASES[$i]} done fi 分集剧情: To install ZeroMQ, run: wget http://download.zeromq.org/historic/zeromq-2.1.7.tar.gz tar -xzf zeromq-2.1.7.tar.gz cd zeromq-2.1.7 ./configure make sudo make install To install JZMQ, run: git clone https://github.com/nathanmarz/jzmq.git cd jzmq ./autogen.sh ./configure make sudo make install

优秀的个人博客,低调大师

CentOS时钟同步

1、环境介绍: 都在root用户权限下设置时间同步 标准时钟同步 3台设备 IP 节点 作用 192.168.128 主节点 ntpd服务器,用于与外部公共ntpd同步标准时间 192.168.129 备用主节点 ntpd客户端,用于与ntpd同步时间 192.168.130 子节点 ntpd客户端,用于与ntpd同步时间 2、ntp时钟同步设置步骤 检查ntp服务是否安装。 出现如下则表示安装成功。 如果未安装则:yum -y install ntp。 然后再:service ntpd restart 3、配置ntpd服务器,就是通外网同步时间的机器:192.168.9.128;配置前先将外网时间同步至服务器机器:ntpdate -u cn.pool.ntp.org; 修改服务器配置文件 vim /etc/ntp.conf 增加下面这两项:这个设置成自己的IP最后一位写0; 后面这个也需要配置,这个是固定的: ntp服务器修改到此为止。 重启服务:service ntpd restart。 Ntpstat表示服务器时间已经和外网同步。 配置客户端的时间同步(192.168.9.129/130)。同样是修改vim /etc/ntp.conf,只需要修改这几行。保存退出。然后,ntpstat。 5、最后reboot服务器。时间同步OK。

优秀的个人博客,低调大师

CentOS 安装 rzsz

1.yum自动安装: yum install lrzsz 2.手动安装方法如下: 2.1. 下载软件 rzsz-3.48.tar.gz wget http://freeware.sgi.com/source/rzsz/rzsz-3.48.tar.gz下载。 2.2解压 tar zxvf rzsz-3.48.tar.gz 2.3.安装 cd rzsz-3.48 make posix 或者 make linux 2.4.如果出现如下提示: -bash: make: command not found。 2.5.表系统没有安装编译器,SSH下安装一下: yum -y install gcc automake autoconf libtool make 2.6.再次执行make posix 命令 [root@miao src]#make posix 02 cc -O -DPOSIX -DMD=2 rz.c -o rz 03 size rz 04 text data bss dec hex filename 05 25444 648 10464 36556 8ecc rz 06 rm -f rb rx rc 07 ln rz rb 08 ln rz rx 09 ln rz rc 10 cc -O -DPOSIX sz.c -o sz 11 size sz 12 text data bss dec hex filename 13 30565 708 43072 74345 12269 sz 14 rm -f sb sx zcommand zcommandi 15 ln sz sb 16 ln sz sx 17 ln sz zcommand 18 ln sz zcommandi 19 [root@miao src]# 3.为了方便使用这个工具,把相关文件复制到目录/usr/bin下面,这里只需要拷贝2个文件rz及sz cp rz sz /usr/bin

资源下载

更多资源
Mario

Mario

马里奥是站在游戏界顶峰的超人气多面角色。马里奥靠吃蘑菇成长,特征是大鼻子、头戴帽子、身穿背带裤,还留着胡子。与他的双胞胎兄弟路易基一起,长年担任任天堂的招牌角色。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Rocky Linux

Rocky Linux

Rocky Linux(中文名:洛基)是由Gregory Kurtzer于2020年12月发起的企业级Linux发行版,作为CentOS稳定版停止维护后与RHEL(Red Hat Enterprise Linux)完全兼容的开源替代方案,由社区拥有并管理,支持x86_64、aarch64等架构。其通过重新编译RHEL源代码提供长期稳定性,采用模块化包装和SELinux安全架构,默认包含GNOME桌面环境及XFS文件系统,支持十年生命周期更新。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册