首页 文章 精选 留言 我的

精选列表

搜索[私有部署],共10000篇文章
优秀的个人博客,低调大师

教你搭建个人/企业私有云盘-kodexplorer

环境说明: 系统版本:CentOS 6.9 x86_64 软件版本:nginx-1.12.2php-5.5.38 可道云kodexplorer4.37 1、nginx的编译安装 1.1 创建目录mkdir -p /service/toolsmkdir /applicationcd /service/toolswget http://nginx.org/download/nginx-1.12.2.tar.gz 下载或者上传nginx包 1.2 解压tar zxvf nginx-1.12.2.tar.gz 1.3 编译安装yum install gcc gcc-c++ glibc -y #安装编译器yum install pcre-devel zlib-devel openssl-devel –y 装pcre为了重写rewrite提供正则表达式库,装zlib为了gzip提供数据压缩用的函数库,装openssl为 Nginx 模块(如 ssl )提供密码算法、证书以及 SSL 协议等功能C语言源码包,需要编译才能使用编译安装三部曲 ./configure(指定编译参数:安装目录及版本) cd nginx-1.12.2 ./configure --prefix=/application/nginx-1.12.2 --pid-path=/var/run/nginx.pid --user=nginx --group=nginx --with-http_ssl_module ./configure -help #查看帮助 生成Makefile文件makemake是用来编译的,它从Makefile中读取指令,然后编译 cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs -I src/http -I src/http/modules \ -o objs/src/http/modules/ngx_http_geo_module.o \ src/http/modules/ngx_http_geo_module.c make installmake install是用来安装的,它也从Makefile中读取指令,安装到指定的位置 [root@Web01 nginx-1.12.2]# cd /application/nginx-1.12.2/ [root@Web01 nginx1.12.2]# ls -1 conf #配置文件 html #网站html文件 logs #日志 sbin #二进制的执行文件 1.4 配置 创建软链接 ln -s /application/nginx-1.12.2 /application/nginx ln -s /application/nginx/sbin/nginx /usr/bin/ useradd -M -s /sbin/nologin -r -u 88 nginx #创建用户 -M 不创建用户的HOME目录 -s shell 指定默认登录shell -r 创建系统账户 -u uid 为账户指定一个唯一的UID conf目录 fastcgi.conf 配合php uwsgi_params 配合python nginx.conf 主配置文件 mime.types 多媒体资源类型配置文件 最小化配置文件 grep -Ev '^$|#' nginx.conf.default >nginx.conf [root@Web01 conf]# grep -Ev '^$|#' nginx.conf.default >nginx.conf [root@Web01 conf]# cat nginx.conf worker_processes 1; #工作进程数 events { #event模块 worker_connections 1024; #默认工作连接数 } http { #http模块,nginx核心模块 include mime.types; #加载的多媒体资源类型配置文件 default_type application/octet-stream; #默认类型(16进制) sendfile on; #优化配置选项 keepalive_timeout 65; #长连接超时时间65秒 server { listen 80; #默认监听的端口 server_name localhost; #网站域名 location / { #网站站点根目录位置 root html; #网站文件 index index.html index.htm; #网站首页 } error_page 500 502 503 504 /50x.html; #错误页面500,502.503.504返回50x.html location = /50x.html { root html; } } } 1.5 启动 /application/nginx/sbin/nginx –t #语法检查并测试 /application/nginx/sbin/nginx #启动 /application/nginx/sbin/nginx -s reload #平滑重启,不影响用户访问 /application/nginx/sbin/nginx -s stop #关闭 /application/nginx/sbin/nginx -V #查看版本及安装的模块 启动后会生成几个temp目录浏览器访问 编译安装Nginx完成 2、编译安装php 2.1下载并安装相关编译器mkdir -p /service/tools #创建目录 cd /service/tools/ wget http://mirrors.sohu.com/php/php-5.5.38.tar.gz #下载包 tar xf php-5.5.38.tar.gz #解压 yum install gcc gcc-c++ glibc -y #安装编译器,如果已经编译安装了nginx则不需要此步骤 yum install -y libxml2-devel curl curl-devel libjpeg-devel libpng-devel freetype-devel 安装编译时所需库 cd php-5.5.38 #进入php-5.5.38目录 2.2 编译安装编译生成makefile** ./configure --prefix=/application/php-5.5.38 --with-jpeg-dir=/usr/lib64 --with-freetype-dir=/usr/lib64/ --with-curl --enable-fpm --enable-mbstring --with-gd --with-fpm-user=nginx --with-fpm-group=nginx make && make install 3、配置 [root@Web02 php-5.5.38]# ln -s /application/php-5.5.38 /application/php #创建软链接 [root@Web02 php-5.5.38]# ln -s /application/php/bin/* /usr/bin/ #创建命令软链接 [root@Web02 php-5.5.38]# cp php.ini-production /application/php-5.5.38/etc/php.ini 拷贝默认配置文件 [root@Web02 php-5.5.38]# cp /application/php-5.5.38/etc/php-fpm.conf.default /application/php-5.5.38/etc/php-fpm.conf 拷贝默认php-fpm配置文件,php-fpm 启动进程数 4、启动 [root@Web02 php-5.5.38]# /application/php/sbin/php-fpm #启动php [root@Web02 php-5.5.38]# netstat -lntup|grep 9000 #查看进程9000端口 tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN 97399/php-fpm 5、配置nginx使其支持php 查看nginx.conf.default有关php的部分(65-71行),将此内容添加到nginx.conf中,并修改fastcgi_param指定script文件名documentrootdocumentrootfastcgi_script_name可以在/application/nginx/conf/fastcgi.conf查看 65 #location ~ \.php$ { 66 # root html; 67 # fastcgi_pass 127.0.0.1:9000; 68 # fastcgi_index index.php; 69 # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; 70 # include fastcgi_params; 71 #} [root@Web02 php-5.5.38]# cd /application/nginx/conf/ [root@Web02 conf]# vim nginx.conf server { listen 80; server_name localhost; index index.php index.html index.htm; location / { root html; } location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME documentrootdocumentrootfastcgi_script_name; include fastcgi_params; } } } 这个配置的意思是 在浏览器中访问的.php文件,实际读取的是 $document_root(网站根目录)下的.php文件 -- 也就是说当访问127.0.0.1/index.php的时候,需要读取网站根目录下面的index.php文件,如果没有配置这一配置项时,nginx不回去网站根目录下访问.php文件,所以返回空白 配置项目中:include fastcgi_params; fastcgi_params 文件中含有各个nginx常量的定义,默认情况 SCRIPT_FILENAME = /scripts$fastcgi_script_name检查语法nginx -t 6、配置网盘,下载解压可道云kodexplorer [root@Web02 conf]# cd ../html/ #进入到站点目录 [root@Web02 html]# ls 50x.html index.html [root@Web02 html]# rm -rf * #删除原有的站点文件 [root@Web02 html]# wget http://static.kodcloud.com/update/download/kodexplorer4.37.zip 下载 [root@Web02 html]# unzip kodexplorer4.37.zip #解压 [root@Web02 html]# nginx #启动nginx 浏览器访问 根据提示操作 su -c 'setenforce 0' #关闭selinux,su -c 指定命令,用root执行 chmod -R 777 /var/www/html/ #按照提示修改权限 刷新页面重新访问,成功,设置管理员用户名和密码,进行登录及后续图形界面操作

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

企业私有云之mariadb集群高可用

上篇文章介绍了openstack组件rabbitmq高可用,现在介绍其另一个重要组件mysql高可用。 我是本次选择mysql的版本是mariadb,集群方法是galera cluster多主集群。 其实也有很多其他方案,如pxc、mha等等,选择galera的原因是安装方便,使用与维护也方便,多主模式任何一个节点挂了都可以在另外节点查看数据,同时openstack各组件也支持配置集群方式的配置。 简介 MariaDBGaleraCluster是一套在mysqlinnodb存储引擎上面实现multi-master及数据实时同步的系统架构,业务层面无需做读写分离工作,数据库读写压力都能按照既定的规则分发到各个节点上去。在数据方面完全兼容MariaDB和MySQL。 特性 (1).同步复制Synchronousreplication (2).Active-activemulti-master拓扑逻辑 (3).可对集群中任一节点进行数据读写 (4).自动成员控制,故障节点自动从集群中移除 (5).自动节点加入 (6).真正并行的复制,基于行级 (7).直接客户端连接,原生的MySQL接口 (8).每个节点都包含完整的数据副本 (9).多台数据库中数据同步由wsrep接口实现 不过局限性也有很多,比如复制仅支持innode,节点必须是3个等等,具体看官网介绍。 下面是安装 环境 系统centos 7.1 /etc/hosts是 node1192.168.1.18 node2192.168.1.20 node3192.168.1.19 一、安装基础库(所有节点运行) yum-yinstallmakecmakebcgccgcc-c++autoconflibjpeglibjpeg-devellibpnglibpng-develfreetypefreetype-devellibxml2libxml2-develzlibzlib-develglibcglibc-develglib2glib2-develbzip2bzip2-develncursesncurses-develcurlcurl-devele2fsprogse2fsprogs-develkrb5-devellibidnlibidn-developensslopenssl-develnss_ldapopenldapopenldap-developenldap-clientsopenldap-serverslibxslt-devellibevent-develntplibtool-ltdlbisonlibtoolvim-enhancedtarwgetreadline-devellibyaml-develpatchtelnetlrzszsysstatscreenpartedrsynclibselinux-pythondmidecodentpdatesaropenssh-clientsman 二、配置mariadb源(所有节点运行) cat>/etc/yum.repos.d/mariadb.repo<<EOF #MariaDB10.1CentOSrepositorylist-created2016-05-2407:59UTC #http://mariadb.org/mariadb/repositories/ [mariadb] name=MariaDB baseurl=http://yum.mariadb.org/10.1/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 EOF 三、安装(所有节点运行) yuminstallMariaDB-serverMariaDB-client-y 四、配置 1、在node1里运行 主要是修改bind-address、wsrep_cluster_name、wsrep_node_address、wsrep_node_name [root@mysql-cluster-1my.cnf.d]#cat/etc/my.cnf.d/server.cnf|grep-v'^#'|sed'/^$/d' [server] [mysqld] collation-server=utf8_general_ci init-connect='SETNAMESutf8' character-set-server=utf8 skip-name-resolve skip-host-cache open_files_limit=65535 max_connections=5000 bind-address=192.168.1.18 binlog_format=row default_storage_engine=InnoDB innodb_autoinc_lock_mode=2 innodb_file_per_table character-set-server=utf8 [galera] wsrep_on=ON wsrep_provider=/usr/lib64/galera/libgalera_smm.so wsrep_provider_options="pc.recovery=TRUE;gcache.size=300M" wsrep_cluster_address='gcomm://' wsrep_cluster_name='ck-galera' wsrep_node_address='192.168.1.18' wsrep_node_name='m-1' wsrep_sst_method=rsync [embedded] [mariadb] [mariadb-10.1] 启动 systemctlenablemariadb systemctlstartmariadb 初始化 [root@mysql-cluster-1log]#mysql_secure_installation NOTE:RUNNINGALLPARTSOFTHISSCRIPTISRECOMMENDEDFORALLMariaDB SERVERSINPRODUCTIONUSE!PLEASEREADEACHSTEPCAREFULLY! InordertologintoMariaDBtosecureit,we'llneedthecurrent passwordfortherootuser.Ifyou'vejustinstalledMariaDB,and youhaven'tsettherootpasswordyet,thepasswordwillbeblank, soyoushouldjustpressenterhere. Entercurrentpasswordforroot(enterfornone): OK,successfullyusedpassword,movingon... SettingtherootpasswordensuresthatnobodycanlogintotheMariaDB rootuserwithouttheproperauthorisation. Setrootpassword?[Y/n]y Newpassword: Re-enternewpassword: Passwordupdatedsuccessfully! Reloadingprivilegetables.. ...Success! Bydefault,aMariaDBinstallationhasananonymoususer,allowinganyone tologintoMariaDBwithouthavingtohaveauseraccountcreatedfor them.Thisisintendedonlyfortesting,andtomaketheinstallation goabitsmoother.Youshouldremovethembeforemovingintoa productionenvironment. Removeanonymoususers?[Y/n]y ...Success! Normally,rootshouldonlybeallowedtoconnectfrom'localhost'.This ensuresthatsomeonecannotguessattherootpasswordfromthenetwork. Disallowrootloginremotely?[Y/n]n ...skipping. Bydefault,MariaDBcomeswithadatabasenamed'test'thatanyonecan access.Thisisalsointendedonlyfortesting,andshouldberemoved beforemovingintoaproductionenvironment. Removetestdatabaseandaccesstoit?[Y/n]y -Droppingtestdatabase... ...Success! -Removingprivilegesontestdatabase... ...Success! Reloadingtheprivilegetableswillensurethatallchangesmadesofar willtakeeffectimmediately. Reloadprivilegetablesnow?[Y/n]y ...Success! Cleaningup... Alldone!Ifyou'vecompletedalloftheabovesteps,yourMariaDB installationshouldnowbesecure. ThanksforusingMariaDB! 查询集群数量 [root@mysql-cluster-1log]#mysql-uroot-p-e"showstatuswhereVariable_namelike'wsrep_cluster_size'" Enterpassword: +--------------------+-------+ |Variable_name|Value| +--------------------+-------+ |wsrep_cluster_size|1| +--------------------+-------+ 可以看到只有一个 查看当前集群ip [root@mysql-cluster-1log]#mysql-uroot-p-e"showstatuswhereVariable_namelike'wsrep_incoming_addresses'" Enterpassword: +--------------------------+-------------------+ |Variable_name|Value| +--------------------------+-------------------+ |wsrep_incoming_addresses|192.168.1.18:3306| +--------------------------+-------------------+ 2、在node里配置 同样修改bind-address、wsrep_cluster_name、wsrep_node_address、wsrep_node_name [root@mysql-cluster-2log]#grep-v'^#'/etc/my.cnf.d/server.cnf|sed'/^$/d' [server] [mysqld] collation-server=utf8_general_ci init-connect='SETNAMESutf8' character-set-server=utf8 skip-name-resolve skip-host-cache open_files_limit=65535 max_connections=5000 bind-address=192.168.1.20 binlog_format=row default_storage_engine=InnoDB innodb_autoinc_lock_mode=2 innodb_file_per_table character-set-server=utf8 [galera] wsrep_on=ON wsrep_provider=/usr/lib64/galera/libgalera_smm.so wsrep_provider_options="pc.recovery=TRUE;gcache.size=300M" wsrep_cluster_address='gcomm://192.168.1.18' wsrep_cluster_name='ck-galera' wsrep_node_address='192.168.1.20' wsrep_node_name='m-2' wsrep_sst_method=rsync [embedded] [mariadb] [mariadb-10.1] 启动 systemctlenablemariadb systemctlstartmariadb 查看集群数量 [root@mysql-cluster-2log]#mysql-uroot-p-e"showstatuswhereVariable_namelike'wsrep_cluster_size'" Enterpassword: +--------------------+-------+ |Variable_name|Value| +--------------------+-------+ |wsrep_cluster_size|2| +--------------------+-------+ 可以看到已经有2个节点了 查看集群ip [root@mysql-cluster-2log]#mysql-uroot-p-e"showstatuswhereVariable_namelike'wsrep_incoming_addresses'" Enterpassword: +--------------------------+-------------------------------------+ |Variable_name|Value| +--------------------------+-------------------------------------+ |wsrep_incoming_addresses|192.168.1.20:3306,192.168.1.18:3306| +--------------------------+-------------------------------------+ 可以看到node1与node2都在里面 3、在node3里配置 修改跟node1与node2一样 [root@mysql-cluster-3~]#grep-v'^#'/etc/my.cnf.d/server.cnf|sed'/^$/d' [server] [mysqld] collation-server=utf8_general_ci init-connect='SETNAMESutf8' character-set-server=utf8 skip-name-resolve skip-host-cache open_files_limit=65535 max_connections=5000 bind-address=192.168.1.19 binlog_format=row default_storage_engine=InnoDB innodb_autoinc_lock_mode=2 innodb_file_per_table character-set-server=utf8 [galera] wsrep_on=ON wsrep_provider=/usr/lib64/galera/libgalera_smm.so wsrep_provider_options="pc.recovery=TRUE;gcache.size=300M" wsrep_cluster_address='gcomm://192.168.1.18,192.168.1.20' wsrep_cluster_name='ck-galera' wsrep_node_address='192.168.1.19' wsrep_node_name='m-3' wsrep_sst_method=rsync [embedded] [mariadb] [mariadb-10.1] 启动 systemctlenablemariadb systemctlstartmariadb 查看集群数量 [root@mysql-cluster-3~]#mysql-uroot-p-e"showstatuswhereVariable_namelike'wsrep_cluster_size'" Enterpassword: +--------------------+-------+ |Variable_name|Value| +--------------------+-------+ |wsrep_cluster_size|3| +--------------------+-------+ 查看集群ip [root@mysql-cluster-3~]#mysql-uroot-p-e"showstatuswhereVariable_namelike'wsrep_incoming_addresses'" Enterpassword: +--------------------------+-------------------------------------------------------+ |Variable_name|Value| +--------------------------+-------------------------------------------------------+ |wsrep_incoming_addresses|192.168.1.19:3306,192.168.1.20:3306,192.168.1.18:3306| +--------------------------+-------------------------------------------------------+ 可以看到3个节点都在里面了。 下一步大家如果想测试,可以在任意一个节点里创建数据库与表,插入数据后,在另外节点里查看是否有对应信息,我这里就不列举了。

资源下载

更多资源
Mario

Mario

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

Spring

Spring

Spring框架(Spring Framework)是由Rod Johnson于2002年提出的开源Java企业级应用框架,旨在通过使用JavaBean替代传统EJB实现方式降低企业级编程开发的复杂性。该框架基于简单性、可测试性和松耦合性设计理念,提供核心容器、应用上下文、数据访问集成等模块,支持整合Hibernate、Struts等第三方框架,其适用范围不仅限于服务器端开发,绝大多数Java应用均可从中受益。

Sublime Text

Sublime Text

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

WebStorm

WebStorm

WebStorm 是jetbrains公司旗下一款JavaScript 开发工具。目前已经被广大中国JS开发者誉为“Web前端开发神器”、“最强大的HTML5编辑器”、“最智能的JavaScript IDE”等。与IntelliJ IDEA同源,继承了IntelliJ IDEA强大的JS部分的功能。

用户登录
用户注册