zoukankan      html  css  js  c++  java
  • Linux配置SVN和MemCached

    SVN

     Linux安装svn

      yum -y install subversion(安装svn)

      mkdir -p /svndata/projects/easyBuy

      svnadmin create /svndata/projects/easyBuy(创建svn)

      cd /svndata/projects/easyBuy/conf(修改配置文件)

      vi authz(添加用户)

        

      vi passwd(创建密码)

        

      vi svnserve.conf(设置权限)

        

        

        

      svnserve -d -r /svndata(启动svn;-d:后台执行,-r:版本库的根目录)

      iptables -I INPUT -p tcp --dport 3690 -j ACCEPT

      service iptables save(开启svn默认端口)

     MyEclipse添加svn

      将 site-1.10.13-1.9.x 中的如下文件复制到:

      

      

      

      

      

     提交/上传项目

      

    MemCached

     Linux安装MemCached和Telnet

      yum -y install memcached(安装Memcached)

      memcached -u root -d -m 1024 -p 11211(启动Memcached)

      iptables -I INPUT -p tcp --dport 11211 -j ACCEPT

      service iptables save(开启Memcached端口)

      rpm -q telnet-server

      rpm -q telnet(查看是否已安装Telnet服务端和客户端)

      yum -y install telnet-server

      yum -y install telnet(安装Telnet)

      vi /etc/xinetd.d/telnet  (修改xinetd配置)

        

      service xinetd restart(重启xinetd)

      chkconfig --list telnet(查看telnet是否开启)

      telnet 127.0.0.1 11211(使用telnet连接IP)

        add <key> [time] <length>

        <value>(添加)

        get <key>(获取)

        set <key> [time] <length>

        <value>(修改或添加)

        flush_all(清空)

        Ctrl+]

        quit(退出)

     MyEclipse连接MemCached

    import java.util.ArrayList;
    import java.util.List;
    
    import com.danga.MemCached.MemCachedClient;
    import com.danga.MemCached.SockIOPool;
    
    public class MemcachedUtils {
    
        static MemCachedClient client = null;
    
        static String[] connectUrls = new String[] { "127.0.0.1:11211" };
    
        static {
            String[] attr = connectUrls;
            client = new MemCachedClient();
            SockIOPool pool = SockIOPool.getInstance();
            pool.setServers(attr);
            pool.setWeights(new Integer[] { 3 });
            pool.setInitConn(5);
            pool.setMinConn(5);
            pool.setMaxConn(200);
            pool.setMaxIdle(1000 * 30 * 30);
            pool.setMaintSleep(30);
            pool.setNagle(false);
            pool.setSocketConnectTO(30);
            pool.initialize();
        }
    
        public static void add(String key, Object object) {
            client.set(key, object);
        }
    
        public static void del(String key) {
            client.delete(key);
        }
    
        public static Object get(String key) {
            return client.get(key);
        }
    
        /**
         * 测试
         */
        public static void main(String args[]) {
            List<String> name = new ArrayList<String>();
            name.add("1111");
            name.add("2222");
            name.add("3333");
            name.add("4444");
            name.add("5555");
            add("name", name);
            List<String> test = (List<String>) get("name");
            System.out.print(test);
        }
    }
  • 相关阅读:
    CSS浮动元素的水平居中
    html5移动web开发实战必读书记
    再说CSS3渐变——线性渐变
    链栈学习笔记
    用数组实现从文件搜索帐户和验证密码
    启程!
    在Application中集成Microsoft Translator服务之获取访问令牌
    在Application中集成Microsoft Translator服务之开发前准备
    Kinetic使用注意点--canvas
    Kinetic使用注意点--blob
  • 原文地址:https://www.cnblogs.com/xhddbky/p/9496818.html
Copyright © 2011-2022 走看看